nexus-agents 2.58.0 → 2.60.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/{chunk-JLYJQ7OG.js → chunk-5JSMLCCK.js} +392 -374
- package/dist/chunk-5JSMLCCK.js.map +1 -0
- package/dist/chunk-FDNWRZNJ.js +22 -0
- package/dist/chunk-FDNWRZNJ.js.map +1 -0
- package/dist/{chunk-L3NHOUEX.js → chunk-FEWWXGFE.js} +30 -30
- package/dist/{chunk-L3NHOUEX.js.map → chunk-FEWWXGFE.js.map} +1 -1
- package/dist/{chunk-GJ5BJU7A.js → chunk-MJ3K4FYS.js} +2 -2
- package/dist/{chunk-7EYQBG3W.js → chunk-XRXUCE6K.js} +8 -7
- package/dist/{chunk-7EYQBG3W.js.map → chunk-XRXUCE6K.js.map} +1 -1
- package/dist/cli.js +48 -51
- package/dist/cli.js.map +1 -1
- package/dist/{consensus-vote-HDM6HA5Z.js → consensus-vote-PRLGGUNY.js} +3 -2
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/nexus-data-dir-M6DYKIHJ.js +12 -0
- package/dist/{registry-command-S46JJ2SX.js → registry-command-TTXAUCOK.js} +7 -5
- package/dist/registry-command-TTXAUCOK.js.map +1 -0
- package/dist/{setup-command-KSQEYBDA.js → setup-command-LIX2S7JD.js} +4 -3
- package/dist/setup-command-LIX2S7JD.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-JLYJQ7OG.js.map +0 -1
- package/dist/registry-command-S46JJ2SX.js.map +0 -1
- /package/dist/{chunk-GJ5BJU7A.js.map → chunk-MJ3K4FYS.js.map} +0 -0
- /package/dist/{consensus-vote-HDM6HA5Z.js.map → consensus-vote-PRLGGUNY.js.map} +0 -0
- /package/dist/{setup-command-KSQEYBDA.js.map → nexus-data-dir-M6DYKIHJ.js.map} +0 -0
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SharedMemoryStore
|
|
3
|
+
} from "./chunk-ED6VQWNG.js";
|
|
1
4
|
import {
|
|
2
5
|
getTokenEnvVars,
|
|
3
6
|
resolveToken
|
|
4
7
|
} from "./chunk-EZXOJZYE.js";
|
|
8
|
+
import {
|
|
9
|
+
executeExpert
|
|
10
|
+
} from "./chunk-JKDHWOQL.js";
|
|
5
11
|
import {
|
|
6
12
|
ClaudeAdapter,
|
|
7
13
|
DEFAULT_RELEVANCE_CONFIG,
|
|
@@ -29,7 +35,7 @@ import {
|
|
|
29
35
|
withAccessPolicy,
|
|
30
36
|
withProgressHeartbeat,
|
|
31
37
|
wrapToolWithTimeout
|
|
32
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-FEWWXGFE.js";
|
|
33
39
|
import {
|
|
34
40
|
REGISTRY_PATH,
|
|
35
41
|
getProjectRoot,
|
|
@@ -56,22 +62,22 @@ import {
|
|
|
56
62
|
extractSymbolIndex,
|
|
57
63
|
extractSymbols
|
|
58
64
|
} from "./chunk-BQ4YXGGQ.js";
|
|
59
|
-
import {
|
|
60
|
-
SharedMemoryStore
|
|
61
|
-
} from "./chunk-ED6VQWNG.js";
|
|
62
65
|
import {
|
|
63
66
|
DEFAULT_TASK_TTL_MS,
|
|
64
67
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
65
68
|
clampTaskTtl,
|
|
66
69
|
getAvailabilityCache,
|
|
67
70
|
resolveFallback
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-XRXUCE6K.js";
|
|
69
72
|
import {
|
|
70
73
|
DEFAULTS
|
|
71
74
|
} from "./chunk-H43PABG4.js";
|
|
72
75
|
import {
|
|
73
76
|
resolveInsideRoot
|
|
74
77
|
} from "./chunk-NUBSJGQZ.js";
|
|
78
|
+
import {
|
|
79
|
+
nexusDataPath
|
|
80
|
+
} from "./chunk-FDNWRZNJ.js";
|
|
75
81
|
import {
|
|
76
82
|
BUILT_IN_EXPERTS,
|
|
77
83
|
BuiltInExpertTypeSchema,
|
|
@@ -97,9 +103,6 @@ import {
|
|
|
97
103
|
import {
|
|
98
104
|
getFallbackChainForCategory
|
|
99
105
|
} from "./chunk-PTGBJFSD.js";
|
|
100
|
-
import {
|
|
101
|
-
executeExpert
|
|
102
|
-
} from "./chunk-JKDHWOQL.js";
|
|
103
106
|
import {
|
|
104
107
|
ClaudeCliAdapter,
|
|
105
108
|
CliDetectionCache,
|
|
@@ -13860,7 +13863,7 @@ function wouldCreateCycle(from, to, getNode) {
|
|
|
13860
13863
|
return canReach(to, from, /* @__PURE__ */ new Set(), getNode);
|
|
13861
13864
|
}
|
|
13862
13865
|
function findCyclePath(from, to, getNode) {
|
|
13863
|
-
const
|
|
13866
|
+
const path20 = [from, to];
|
|
13864
13867
|
const visited = /* @__PURE__ */ new Set([from]);
|
|
13865
13868
|
const findPath = (current) => {
|
|
13866
13869
|
if (current === from) return true;
|
|
@@ -13869,9 +13872,9 @@ function findCyclePath(from, to, getNode) {
|
|
|
13869
13872
|
for (const depId of node.dependencies.keys()) {
|
|
13870
13873
|
if (!visited.has(depId)) {
|
|
13871
13874
|
visited.add(depId);
|
|
13872
|
-
|
|
13875
|
+
path20.push(depId);
|
|
13873
13876
|
if (findPath(depId)) return true;
|
|
13874
|
-
|
|
13877
|
+
path20.pop();
|
|
13875
13878
|
} else if (depId === from) {
|
|
13876
13879
|
return true;
|
|
13877
13880
|
}
|
|
@@ -13879,7 +13882,7 @@ function findCyclePath(from, to, getNode) {
|
|
|
13879
13882
|
return false;
|
|
13880
13883
|
};
|
|
13881
13884
|
findPath(to);
|
|
13882
|
-
return
|
|
13885
|
+
return path20;
|
|
13883
13886
|
}
|
|
13884
13887
|
function detectCycleDFS(nodeId, visited, stack, getNode) {
|
|
13885
13888
|
visited.add(nodeId);
|
|
@@ -13898,29 +13901,29 @@ function detectCycleDFS(nodeId, visited, stack, getNode) {
|
|
|
13898
13901
|
return false;
|
|
13899
13902
|
}
|
|
13900
13903
|
function findCycleFromNode(startId, getNode) {
|
|
13901
|
-
const
|
|
13904
|
+
const path20 = [];
|
|
13902
13905
|
const visited = /* @__PURE__ */ new Set();
|
|
13903
13906
|
const dfs = (nodeId) => {
|
|
13904
|
-
if (
|
|
13905
|
-
const cycleStart =
|
|
13906
|
-
|
|
13907
|
-
|
|
13907
|
+
if (path20.includes(nodeId)) {
|
|
13908
|
+
const cycleStart = path20.indexOf(nodeId);
|
|
13909
|
+
path20.splice(0, cycleStart);
|
|
13910
|
+
path20.push(nodeId);
|
|
13908
13911
|
return true;
|
|
13909
13912
|
}
|
|
13910
13913
|
if (visited.has(nodeId)) return false;
|
|
13911
13914
|
visited.add(nodeId);
|
|
13912
|
-
|
|
13915
|
+
path20.push(nodeId);
|
|
13913
13916
|
const node = getNode(nodeId);
|
|
13914
13917
|
if (node) {
|
|
13915
13918
|
for (const depId of node.dependencies.keys()) {
|
|
13916
13919
|
if (dfs(depId)) return true;
|
|
13917
13920
|
}
|
|
13918
13921
|
}
|
|
13919
|
-
|
|
13922
|
+
path20.pop();
|
|
13920
13923
|
return false;
|
|
13921
13924
|
};
|
|
13922
13925
|
dfs(startId);
|
|
13923
|
-
return
|
|
13926
|
+
return path20;
|
|
13924
13927
|
}
|
|
13925
13928
|
|
|
13926
13929
|
// src/agents/skills/skill-dependency-graph.ts
|
|
@@ -15078,7 +15081,6 @@ function createContextItem(id, content, source, relevance, timestamp) {
|
|
|
15078
15081
|
// src/agents/wave-checkpoint-persistence.ts
|
|
15079
15082
|
import * as fs from "fs";
|
|
15080
15083
|
import * as path from "path";
|
|
15081
|
-
import * as os from "os";
|
|
15082
15084
|
|
|
15083
15085
|
// src/agents/wave-checkpoint-types.ts
|
|
15084
15086
|
import { z as z27 } from "zod";
|
|
@@ -15103,13 +15105,13 @@ var WaveCheckpointEntrySchema = z27.object({
|
|
|
15103
15105
|
|
|
15104
15106
|
// src/agents/wave-checkpoint-persistence.ts
|
|
15105
15107
|
var logger5 = createLogger({ component: "wave-checkpoint" });
|
|
15106
|
-
var
|
|
15108
|
+
var CHECKPOINT_SUBDIR = "checkpoints";
|
|
15107
15109
|
var DIR_MODE = 448;
|
|
15108
15110
|
function getCheckpointDir(customDir) {
|
|
15109
15111
|
if (customDir !== void 0) {
|
|
15110
15112
|
return path.resolve(customDir);
|
|
15111
15113
|
}
|
|
15112
|
-
return
|
|
15114
|
+
return nexusDataPath(CHECKPOINT_SUBDIR);
|
|
15113
15115
|
}
|
|
15114
15116
|
function ensureCheckpointDir(customDir) {
|
|
15115
15117
|
const dirPath = getCheckpointDir(customDir);
|
|
@@ -18466,18 +18468,18 @@ var DependencyGraph = class {
|
|
|
18466
18468
|
}
|
|
18467
18469
|
const startNode = firstNode;
|
|
18468
18470
|
const visited = /* @__PURE__ */ new Set();
|
|
18469
|
-
const
|
|
18471
|
+
const path20 = [];
|
|
18470
18472
|
const dfs = (nodeId) => {
|
|
18471
|
-
if (
|
|
18472
|
-
const cycleStart =
|
|
18473
|
-
|
|
18473
|
+
if (path20.includes(nodeId)) {
|
|
18474
|
+
const cycleStart = path20.indexOf(nodeId);
|
|
18475
|
+
path20.splice(0, cycleStart);
|
|
18474
18476
|
return true;
|
|
18475
18477
|
}
|
|
18476
18478
|
if (visited.has(nodeId)) {
|
|
18477
18479
|
return false;
|
|
18478
18480
|
}
|
|
18479
18481
|
visited.add(nodeId);
|
|
18480
|
-
|
|
18482
|
+
path20.push(nodeId);
|
|
18481
18483
|
const node = this.nodes.get(nodeId);
|
|
18482
18484
|
if (node) {
|
|
18483
18485
|
for (const depId of node.dependencies) {
|
|
@@ -18488,11 +18490,11 @@ var DependencyGraph = class {
|
|
|
18488
18490
|
}
|
|
18489
18491
|
}
|
|
18490
18492
|
}
|
|
18491
|
-
|
|
18493
|
+
path20.pop();
|
|
18492
18494
|
return false;
|
|
18493
18495
|
};
|
|
18494
18496
|
dfs(startNode);
|
|
18495
|
-
return
|
|
18497
|
+
return path20.length > 0 ? path20 : cycleNodes.slice(0, 3);
|
|
18496
18498
|
}
|
|
18497
18499
|
/**
|
|
18498
18500
|
* Gets the execution order (topologically sorted step IDs).
|
|
@@ -19344,9 +19346,9 @@ function getBuiltInTemplatesPath() {
|
|
|
19344
19346
|
join3(dirname2(currentDir), "workflows", "templates"),
|
|
19345
19347
|
join3(dirname2(currentDir), "dist", "workflows", "templates")
|
|
19346
19348
|
];
|
|
19347
|
-
for (const
|
|
19348
|
-
if (existsSync3(
|
|
19349
|
-
return
|
|
19349
|
+
for (const path20 of possiblePaths) {
|
|
19350
|
+
if (existsSync3(path20)) {
|
|
19351
|
+
return path20;
|
|
19350
19352
|
}
|
|
19351
19353
|
}
|
|
19352
19354
|
return join3(currentDir, "templates");
|
|
@@ -19887,9 +19889,9 @@ function validateRequiredInputs(inputs, required) {
|
|
|
19887
19889
|
}
|
|
19888
19890
|
|
|
19889
19891
|
// src/workflows/expression-resolver-helpers.ts
|
|
19890
|
-
function getNestedValue(obj,
|
|
19892
|
+
function getNestedValue(obj, path20) {
|
|
19891
19893
|
let current = obj;
|
|
19892
|
-
for (const key of
|
|
19894
|
+
for (const key of path20) {
|
|
19893
19895
|
if (current === null || current === void 0) {
|
|
19894
19896
|
return void 0;
|
|
19895
19897
|
}
|
|
@@ -19900,24 +19902,24 @@ function getNestedValue(obj, path21) {
|
|
|
19900
19902
|
}
|
|
19901
19903
|
return current;
|
|
19902
19904
|
}
|
|
19903
|
-
function resolveInputs(
|
|
19904
|
-
const value = getNestedValue(context.inputs,
|
|
19905
|
+
function resolveInputs(path20, context) {
|
|
19906
|
+
const value = getNestedValue(context.inputs, path20);
|
|
19905
19907
|
if (value === void 0) {
|
|
19906
19908
|
return {
|
|
19907
19909
|
success: false,
|
|
19908
|
-
error: `Input '${
|
|
19910
|
+
error: `Input '${path20.join(".")}' not found`
|
|
19909
19911
|
};
|
|
19910
19912
|
}
|
|
19911
19913
|
return { success: true, value };
|
|
19912
19914
|
}
|
|
19913
|
-
function validateStepPath(
|
|
19914
|
-
if (
|
|
19915
|
+
function validateStepPath(path20) {
|
|
19916
|
+
if (path20.length < 2) {
|
|
19915
19917
|
return {
|
|
19916
19918
|
success: false,
|
|
19917
19919
|
error: "Steps expression requires at least stepId and output"
|
|
19918
19920
|
};
|
|
19919
19921
|
}
|
|
19920
|
-
if (
|
|
19922
|
+
if (path20[0] === void 0 || path20[1] === void 0) {
|
|
19921
19923
|
return {
|
|
19922
19924
|
success: false,
|
|
19923
19925
|
error: "Steps expression requires stepId and output"
|
|
@@ -19943,12 +19945,12 @@ function validateStepResult(stepId, outputKey, stepResult) {
|
|
|
19943
19945
|
}
|
|
19944
19946
|
return null;
|
|
19945
19947
|
}
|
|
19946
|
-
function resolveSteps(
|
|
19947
|
-
const pathError = validateStepPath(
|
|
19948
|
+
function resolveSteps(path20, context) {
|
|
19949
|
+
const pathError = validateStepPath(path20);
|
|
19948
19950
|
if (pathError !== null) return pathError;
|
|
19949
|
-
const stepId =
|
|
19950
|
-
const outputKey =
|
|
19951
|
-
const rest =
|
|
19951
|
+
const stepId = path20[0] ?? "";
|
|
19952
|
+
const outputKey = path20[1] ?? "";
|
|
19953
|
+
const rest = path20.slice(2);
|
|
19952
19954
|
const stepResult = context.stepResults.get(stepId);
|
|
19953
19955
|
const earlyReturn = validateStepResult(stepId, outputKey, stepResult);
|
|
19954
19956
|
if (earlyReturn !== null) return earlyReturn;
|
|
@@ -19964,15 +19966,15 @@ function resolveSteps(path21, context) {
|
|
|
19964
19966
|
}
|
|
19965
19967
|
return { success: true, value };
|
|
19966
19968
|
}
|
|
19967
|
-
function resolveVariables(
|
|
19968
|
-
if (
|
|
19969
|
+
function resolveVariables(path20, context) {
|
|
19970
|
+
if (path20.length === 0) {
|
|
19969
19971
|
return {
|
|
19970
19972
|
success: false,
|
|
19971
19973
|
error: "Variables expression requires a variable name"
|
|
19972
19974
|
};
|
|
19973
19975
|
}
|
|
19974
|
-
const varName =
|
|
19975
|
-
const rest =
|
|
19976
|
+
const varName = path20[0];
|
|
19977
|
+
const rest = path20.slice(1);
|
|
19976
19978
|
if (varName === void 0) {
|
|
19977
19979
|
return {
|
|
19978
19980
|
success: false,
|
|
@@ -20995,8 +20997,8 @@ var WorkflowEngine = class {
|
|
|
20995
20997
|
this.config = resolveConfig2(config);
|
|
20996
20998
|
}
|
|
20997
20999
|
/** Load workflow template from file. */
|
|
20998
|
-
async loadTemplate(
|
|
20999
|
-
return this.deps.loadWorkflowFile(
|
|
21000
|
+
async loadTemplate(path20) {
|
|
21001
|
+
return this.deps.loadWorkflowFile(path20);
|
|
21000
21002
|
}
|
|
21001
21003
|
/** Execute a workflow with inputs. */
|
|
21002
21004
|
async execute(workflow, inputs) {
|
|
@@ -21100,8 +21102,8 @@ var WorkflowEngine = class {
|
|
|
21100
21102
|
}
|
|
21101
21103
|
return Promise.resolve(templates);
|
|
21102
21104
|
}
|
|
21103
|
-
createTemplate(workflow,
|
|
21104
|
-
const t = { name: workflow.name, version: workflow.version, path:
|
|
21105
|
+
createTemplate(workflow, path20, category) {
|
|
21106
|
+
const t = { name: workflow.name, version: workflow.version, path: path20, category };
|
|
21105
21107
|
if (workflow.description !== void 0) t.description = workflow.description;
|
|
21106
21108
|
return t;
|
|
21107
21109
|
}
|
|
@@ -21387,8 +21389,8 @@ function createParseWorkflow() {
|
|
|
21387
21389
|
};
|
|
21388
21390
|
}
|
|
21389
21391
|
function createLoadWorkflowFile() {
|
|
21390
|
-
return async (
|
|
21391
|
-
const result = await loadWorkflowFile(
|
|
21392
|
+
return async (path20) => {
|
|
21393
|
+
const result = await loadWorkflowFile(path20);
|
|
21392
21394
|
if (!result.ok) {
|
|
21393
21395
|
if (result.error instanceof ParseError) {
|
|
21394
21396
|
return result;
|
|
@@ -21617,13 +21619,12 @@ function withLogging(toolName, handler3, logger56) {
|
|
|
21617
21619
|
// src/mcp/middleware/auth-handler.ts
|
|
21618
21620
|
import { randomBytes, timingSafeEqual } from "crypto";
|
|
21619
21621
|
import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync4, mkdirSync as mkdirSync2 } from "fs";
|
|
21620
|
-
import {
|
|
21621
|
-
|
|
21622
|
-
var DEFAULT_AUTH_DIR = ".nexus-agents/auth";
|
|
21622
|
+
import { dirname as dirname3 } from "path";
|
|
21623
|
+
var DEFAULT_AUTH_SUBDIR = "auth";
|
|
21623
21624
|
var DEFAULT_TOKEN_FILE = "server-token";
|
|
21624
21625
|
var TOKEN_LENGTH_BYTES = 32;
|
|
21625
21626
|
function getDefaultTokenPath() {
|
|
21626
|
-
return
|
|
21627
|
+
return nexusDataPath(DEFAULT_AUTH_SUBDIR, DEFAULT_TOKEN_FILE);
|
|
21627
21628
|
}
|
|
21628
21629
|
function generateSecureToken() {
|
|
21629
21630
|
return randomBytes(TOKEN_LENGTH_BYTES).toString("hex");
|
|
@@ -23437,10 +23438,10 @@ function calculateZStatistic(params) {
|
|
|
23437
23438
|
function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
|
|
23438
23439
|
const difference = p1 - p2;
|
|
23439
23440
|
const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
|
|
23440
|
-
const
|
|
23441
|
+
const z104 = getZScore(confidence);
|
|
23441
23442
|
return {
|
|
23442
|
-
lower: difference -
|
|
23443
|
-
upper: difference +
|
|
23443
|
+
lower: difference - z104 * seDiff,
|
|
23444
|
+
upper: difference + z104 * seDiff,
|
|
23444
23445
|
estimate: difference,
|
|
23445
23446
|
confidence,
|
|
23446
23447
|
n: total1 + total2,
|
|
@@ -23463,11 +23464,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
|
|
|
23463
23464
|
standardError: 0
|
|
23464
23465
|
};
|
|
23465
23466
|
}
|
|
23466
|
-
const
|
|
23467
|
-
const z210 =
|
|
23467
|
+
const z104 = getZScore(opts.confidence);
|
|
23468
|
+
const z210 = z104 * z104;
|
|
23468
23469
|
const denominator = 1 + z210 / n;
|
|
23469
23470
|
const center = (p + z210 / (2 * n)) / denominator;
|
|
23470
|
-
const margin =
|
|
23471
|
+
const margin = z104 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
23471
23472
|
const lower = Math.max(0, center - margin);
|
|
23472
23473
|
const upper = Math.min(1, center + margin);
|
|
23473
23474
|
const standardError = Math.sqrt(p * (1 - p) / n);
|
|
@@ -23497,8 +23498,8 @@ function meanConfidenceInterval(values, options = {}) {
|
|
|
23497
23498
|
const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
|
|
23498
23499
|
const stdDev = Math.sqrt(variance);
|
|
23499
23500
|
const standardError = stdDev / Math.sqrt(n);
|
|
23500
|
-
const
|
|
23501
|
-
const margin =
|
|
23501
|
+
const z104 = getZScore(opts.confidence);
|
|
23502
|
+
const margin = z104 * standardError;
|
|
23502
23503
|
return {
|
|
23503
23504
|
lower: mean - margin,
|
|
23504
23505
|
upper: mean + margin,
|
|
@@ -27030,31 +27031,31 @@ var GraphBuilder = class {
|
|
|
27030
27031
|
}
|
|
27031
27032
|
const visited = /* @__PURE__ */ new Set();
|
|
27032
27033
|
const stack = /* @__PURE__ */ new Set();
|
|
27033
|
-
const
|
|
27034
|
+
const path20 = [];
|
|
27034
27035
|
for (const nodeId of this.nodes.keys()) {
|
|
27035
|
-
const cycle = this.dfs(nodeId, adj, visited, stack,
|
|
27036
|
+
const cycle = this.dfs(nodeId, adj, visited, stack, path20);
|
|
27036
27037
|
if (cycle !== void 0) return cycle;
|
|
27037
27038
|
}
|
|
27038
27039
|
return void 0;
|
|
27039
27040
|
}
|
|
27040
|
-
dfs(nodeId, adj, visited, stack,
|
|
27041
|
+
dfs(nodeId, adj, visited, stack, path20) {
|
|
27041
27042
|
if (stack.has(nodeId)) {
|
|
27042
|
-
const cycleStart =
|
|
27043
|
-
const cyclePath =
|
|
27043
|
+
const cycleStart = path20.indexOf(nodeId);
|
|
27044
|
+
const cyclePath = path20.slice(cycleStart);
|
|
27044
27045
|
cyclePath.push(nodeId);
|
|
27045
27046
|
return { type: "cycle_detected", path: cyclePath };
|
|
27046
27047
|
}
|
|
27047
27048
|
if (visited.has(nodeId)) return void 0;
|
|
27048
27049
|
visited.add(nodeId);
|
|
27049
27050
|
stack.add(nodeId);
|
|
27050
|
-
|
|
27051
|
+
path20.push(nodeId);
|
|
27051
27052
|
const neighbors = adj.get(nodeId) ?? [];
|
|
27052
27053
|
for (const neighbor of neighbors) {
|
|
27053
|
-
const cycle = this.dfs(neighbor, adj, visited, stack,
|
|
27054
|
+
const cycle = this.dfs(neighbor, adj, visited, stack, path20);
|
|
27054
27055
|
if (cycle !== void 0) return cycle;
|
|
27055
27056
|
}
|
|
27056
27057
|
stack.delete(nodeId);
|
|
27057
|
-
|
|
27058
|
+
path20.pop();
|
|
27058
27059
|
return void 0;
|
|
27059
27060
|
}
|
|
27060
27061
|
checkReachability() {
|
|
@@ -27594,13 +27595,13 @@ function emitPipelineStageEvent(prefix, stage, status, details) {
|
|
|
27594
27595
|
|
|
27595
27596
|
// src/pipeline/trace-writer.ts
|
|
27596
27597
|
import { mkdir, writeFile, rename, unlink } from "fs/promises";
|
|
27597
|
-
import { join as
|
|
27598
|
+
import { join as join5 } from "path";
|
|
27598
27599
|
var logger18 = createLogger({ component: "TraceWriter" });
|
|
27599
27600
|
var MAX_BUFFER_SIZE = 5e4;
|
|
27600
27601
|
var TraceWriter = class {
|
|
27601
27602
|
constructor(bus, options) {
|
|
27602
27603
|
this.options = options;
|
|
27603
|
-
this.runDir =
|
|
27604
|
+
this.runDir = join5(options.runsDir, options.runId);
|
|
27604
27605
|
this.maxBuffer = options.maxBufferSize ?? MAX_BUFFER_SIZE;
|
|
27605
27606
|
this.unsubscribe = bus.subscribe({}, (event) => {
|
|
27606
27607
|
if (!this.stopped) {
|
|
@@ -27621,7 +27622,7 @@ var TraceWriter = class {
|
|
|
27621
27622
|
if (this.buffer.length === 0) return;
|
|
27622
27623
|
await mkdir(this.runDir, { recursive: true });
|
|
27623
27624
|
const lines = this.buffer.map((e) => JSON.stringify(e)).join("\n");
|
|
27624
|
-
const tracePath =
|
|
27625
|
+
const tracePath = join5(this.runDir, "trace.jsonl");
|
|
27625
27626
|
const traceTmp = `${tracePath}.tmp.${String(process.pid)}`;
|
|
27626
27627
|
try {
|
|
27627
27628
|
await writeFile(traceTmp, lines + "\n", "utf-8");
|
|
@@ -27634,7 +27635,7 @@ var TraceWriter = class {
|
|
|
27634
27635
|
throw err2;
|
|
27635
27636
|
}
|
|
27636
27637
|
const indexContent = this.buildIndex();
|
|
27637
|
-
const indexPath =
|
|
27638
|
+
const indexPath = join5(this.runDir, "index.md");
|
|
27638
27639
|
const indexTmp = `${indexPath}.tmp.${String(process.pid)}`;
|
|
27639
27640
|
try {
|
|
27640
27641
|
await writeFile(indexTmp, indexContent, "utf-8");
|
|
@@ -27722,8 +27723,8 @@ function extractModelAttribution(event) {
|
|
|
27722
27723
|
};
|
|
27723
27724
|
}
|
|
27724
27725
|
function extractRoutingAttribution(event) {
|
|
27725
|
-
const
|
|
27726
|
-
return { modelId: event.selectedModel, reasoning: event.reasoning, decisionPath:
|
|
27726
|
+
const path20 = event.decisionPath !== void 0 ? [...event.decisionPath] : void 0;
|
|
27727
|
+
return { modelId: event.selectedModel, reasoning: event.reasoning, decisionPath: path20 };
|
|
27727
27728
|
}
|
|
27728
27729
|
function extractPipelineAttribution(event) {
|
|
27729
27730
|
if (event.type === "pipeline.completed") {
|
|
@@ -29284,10 +29285,8 @@ function createSicaOrchestratorAdapter(sicaAgent, _logger) {
|
|
|
29284
29285
|
|
|
29285
29286
|
// src/mcp/tools/research-auto-catalog.ts
|
|
29286
29287
|
import * as fs4 from "fs";
|
|
29287
|
-
import * as path4 from "path";
|
|
29288
|
-
import * as os2 from "os";
|
|
29289
29288
|
import { z as z51 } from "zod";
|
|
29290
|
-
var
|
|
29289
|
+
var CATALOG_SUBDIR = "research";
|
|
29291
29290
|
var CATALOG_FILE = "pending-catalog.json";
|
|
29292
29291
|
var FILE_MODE = 384;
|
|
29293
29292
|
var DIR_MODE2 = 448;
|
|
@@ -29305,7 +29304,7 @@ var PersistedCatalogSchema = z51.object({
|
|
|
29305
29304
|
savedAt: z51.string()
|
|
29306
29305
|
});
|
|
29307
29306
|
function getCatalogPath() {
|
|
29308
|
-
return
|
|
29307
|
+
return nexusDataPath(CATALOG_SUBDIR, CATALOG_FILE);
|
|
29309
29308
|
}
|
|
29310
29309
|
function loadPersistedCatalog(logger56) {
|
|
29311
29310
|
const filePath = getCatalogPath();
|
|
@@ -29330,7 +29329,7 @@ function loadPersistedCatalog(logger56) {
|
|
|
29330
29329
|
}
|
|
29331
29330
|
}
|
|
29332
29331
|
function savePersistedCatalog(references, logger56) {
|
|
29333
|
-
const dirPath =
|
|
29332
|
+
const dirPath = nexusDataPath(CATALOG_SUBDIR);
|
|
29334
29333
|
const filePath = getCatalogPath();
|
|
29335
29334
|
const tempPath = `${filePath}.tmp.${String(process.pid)}`;
|
|
29336
29335
|
try {
|
|
@@ -31931,8 +31930,8 @@ function isReflectiveShadowMode() {
|
|
|
31931
31930
|
}
|
|
31932
31931
|
|
|
31933
31932
|
// src/mcp/tools/orchestrate-reflection.ts
|
|
31934
|
-
import * as
|
|
31935
|
-
import * as
|
|
31933
|
+
import * as os from "os";
|
|
31934
|
+
import * as path4 from "path";
|
|
31936
31935
|
var logger28 = createLogger({ component: "orchestrate-reflection" });
|
|
31937
31936
|
var REFLECTION_MAX_TOKENS2 = 1e3;
|
|
31938
31937
|
var REFLECTION_WRITE_CONFIDENCE_THRESHOLD = 0.6;
|
|
@@ -32023,7 +32022,7 @@ function writeLearningsToSession(learnings, taskDescription) {
|
|
|
32023
32022
|
}
|
|
32024
32023
|
if (eligible.length === 0) return 0;
|
|
32025
32024
|
try {
|
|
32026
|
-
const memoryDir =
|
|
32025
|
+
const memoryDir = path4.join(os.homedir(), ".nexus-agents", "memory", "sessions");
|
|
32027
32026
|
const memory = createSessionMemory(memoryDir);
|
|
32028
32027
|
const sessionId = `reflection-${String(Date.now())}`;
|
|
32029
32028
|
const startResult = memory.startSession(sessionId);
|
|
@@ -32471,8 +32470,8 @@ function hashObjective(userObjective) {
|
|
|
32471
32470
|
|
|
32472
32471
|
// src/context/structured-task-state.ts
|
|
32473
32472
|
import * as fs5 from "fs";
|
|
32474
|
-
import * as
|
|
32475
|
-
import * as
|
|
32473
|
+
import * as path5 from "path";
|
|
32474
|
+
import * as os2 from "os";
|
|
32476
32475
|
|
|
32477
32476
|
// src/context/structured-task-state-types.ts
|
|
32478
32477
|
import { z as z55 } from "zod";
|
|
@@ -32595,15 +32594,15 @@ var StructuredTaskLogEntrySchema = z55.discriminatedUnion("event", [
|
|
|
32595
32594
|
|
|
32596
32595
|
// src/context/structured-task-state.ts
|
|
32597
32596
|
var logger29 = createLogger({ component: "structured-task-state" });
|
|
32598
|
-
var TASKS_DIR =
|
|
32597
|
+
var TASKS_DIR = path5.join(".nexus-agents", "tasks");
|
|
32599
32598
|
var FILE_MODE2 = 384;
|
|
32600
32599
|
var DIR_MODE3 = 448;
|
|
32601
32600
|
function getTasksDir(customDir) {
|
|
32602
|
-
if (customDir !== void 0) return
|
|
32603
|
-
return
|
|
32601
|
+
if (customDir !== void 0) return path5.resolve(customDir);
|
|
32602
|
+
return path5.join(os2.homedir(), TASKS_DIR);
|
|
32604
32603
|
}
|
|
32605
32604
|
function getLogPath(taskId, customDir) {
|
|
32606
|
-
return
|
|
32605
|
+
return path5.join(getTasksDir(customDir), `state-${taskId}.jsonl`);
|
|
32607
32606
|
}
|
|
32608
32607
|
function validateTaskId(taskId) {
|
|
32609
32608
|
if (taskId.includes("..") || taskId.includes("/") || taskId.includes("\\")) {
|
|
@@ -36384,18 +36383,18 @@ function parseArxivEntries(xml, source, topic = "") {
|
|
|
36384
36383
|
|
|
36385
36384
|
// src/cli/research-helpers-sources-io.ts
|
|
36386
36385
|
import * as fs6 from "fs/promises";
|
|
36387
|
-
import * as
|
|
36386
|
+
import * as path6 from "path";
|
|
36388
36387
|
import { parse as parseYaml2, stringify as stringifyYaml } from "yaml";
|
|
36389
36388
|
var SOURCES_FILE = "sources.yaml";
|
|
36390
36389
|
function validatePath3(constructedPath, allowedRoot) {
|
|
36391
36390
|
const resolved = resolveInsideRoot(constructedPath, allowedRoot);
|
|
36392
36391
|
if (resolved === null) {
|
|
36393
|
-
const root =
|
|
36392
|
+
const root = path6.resolve(allowedRoot);
|
|
36394
36393
|
return {
|
|
36395
36394
|
ok: false,
|
|
36396
36395
|
error: {
|
|
36397
36396
|
code: "PATH_TRAVERSAL",
|
|
36398
|
-
message: `Path ${
|
|
36397
|
+
message: `Path ${path6.resolve(constructedPath)} is outside ${root}`
|
|
36399
36398
|
}
|
|
36400
36399
|
};
|
|
36401
36400
|
}
|
|
@@ -36403,7 +36402,7 @@ function validatePath3(constructedPath, allowedRoot) {
|
|
|
36403
36402
|
}
|
|
36404
36403
|
async function loadSourcesRegistry(rootDir) {
|
|
36405
36404
|
const root = rootDir ?? getProjectRoot();
|
|
36406
|
-
const filePath =
|
|
36405
|
+
const filePath = path6.join(root, REGISTRY_PATH, SOURCES_FILE);
|
|
36407
36406
|
const pathResult = validatePath3(filePath, root);
|
|
36408
36407
|
if (!pathResult.ok) return pathResult;
|
|
36409
36408
|
try {
|
|
@@ -36429,7 +36428,7 @@ async function loadSourcesRegistry(rootDir) {
|
|
|
36429
36428
|
}
|
|
36430
36429
|
async function saveSourcesRegistry(registry, rootDir) {
|
|
36431
36430
|
const root = rootDir ?? getProjectRoot();
|
|
36432
|
-
const filePath =
|
|
36431
|
+
const filePath = path6.join(root, REGISTRY_PATH, SOURCES_FILE);
|
|
36433
36432
|
const pathResult = validatePath3(filePath, root);
|
|
36434
36433
|
if (!pathResult.ok) return pathResult;
|
|
36435
36434
|
try {
|
|
@@ -36736,12 +36735,12 @@ function rankDiscoveredItems(items, topic) {
|
|
|
36736
36735
|
|
|
36737
36736
|
// src/cli/research-helpers-index-ops.ts
|
|
36738
36737
|
import * as fs7 from "fs/promises";
|
|
36739
|
-
import * as
|
|
36738
|
+
import * as path7 from "path";
|
|
36740
36739
|
function getRegistryPath() {
|
|
36741
|
-
return
|
|
36740
|
+
return path7.resolve(process.cwd(), "docs/research/registry");
|
|
36742
36741
|
}
|
|
36743
36742
|
function getIndexPath() {
|
|
36744
|
-
return
|
|
36743
|
+
return path7.resolve(process.cwd(), "docs/research/RESEARCH_INDEX.md");
|
|
36745
36744
|
}
|
|
36746
36745
|
async function handleStatsCommand(options) {
|
|
36747
36746
|
const registryPath = getRegistryPath();
|
|
@@ -36771,7 +36770,7 @@ async function handleRefreshCommand(options) {
|
|
|
36771
36770
|
if (!mdResult.ok) {
|
|
36772
36771
|
return `Error: Failed to generate markdown: ${mdResult.error.message}`;
|
|
36773
36772
|
}
|
|
36774
|
-
await fs7.mkdir(
|
|
36773
|
+
await fs7.mkdir(path7.dirname(outputPath), { recursive: true });
|
|
36775
36774
|
await fs7.writeFile(outputPath, mdResult.value, "utf-8");
|
|
36776
36775
|
const stats = index.stats;
|
|
36777
36776
|
return [
|
|
@@ -38711,12 +38710,12 @@ function extractFileReferences(markdown) {
|
|
|
38711
38710
|
let match;
|
|
38712
38711
|
FILE_REF_PATTERN.lastIndex = 0;
|
|
38713
38712
|
while ((match = FILE_REF_PATTERN.exec(markdown)) !== null) {
|
|
38714
|
-
const
|
|
38715
|
-
if (
|
|
38716
|
-
seen.add(
|
|
38713
|
+
const path20 = match[1];
|
|
38714
|
+
if (path20 === void 0 || seen.has(path20)) continue;
|
|
38715
|
+
seen.add(path20);
|
|
38717
38716
|
const lineStr = match[2];
|
|
38718
38717
|
const line = lineStr !== void 0 ? parseInt(lineStr, 10) : void 0;
|
|
38719
|
-
refs.push(line !== void 0 ? { path:
|
|
38718
|
+
refs.push(line !== void 0 ? { path: path20, line } : { path: path20 });
|
|
38720
38719
|
}
|
|
38721
38720
|
return refs;
|
|
38722
38721
|
}
|
|
@@ -40000,7 +39999,7 @@ function registerExtractSymbolsTool(server, deps) {
|
|
|
40000
39999
|
|
|
40001
40000
|
// src/mcp/tools/query-trace-tool.ts
|
|
40002
40001
|
import { readFile as readFile5, stat as stat3 } from "fs/promises";
|
|
40003
|
-
import { join as
|
|
40002
|
+
import { join as join9, resolve as resolve11, sep as sep3 } from "path";
|
|
40004
40003
|
import { z as z84 } from "zod";
|
|
40005
40004
|
var QueryTraceInputSchema = z84.object({
|
|
40006
40005
|
runId: z84.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/, "runId must be alphanumeric, hyphens, or underscores").describe("Run ID to query traces for"),
|
|
@@ -40041,7 +40040,7 @@ var EMPTY_RESPONSE = {
|
|
|
40041
40040
|
};
|
|
40042
40041
|
async function queryTraceFromDisk(input, runsDir) {
|
|
40043
40042
|
const dir = runsDir ?? DEFAULT_RUNS_DIR;
|
|
40044
|
-
const tracePath =
|
|
40043
|
+
const tracePath = join9(dir, input.runId, "trace.jsonl");
|
|
40045
40044
|
const resolvedDir = resolve11(dir);
|
|
40046
40045
|
const resolvedTrace = resolve11(tracePath);
|
|
40047
40046
|
if (!resolvedTrace.startsWith(resolvedDir + sep3) && resolvedTrace !== resolvedDir) {
|
|
@@ -40351,11 +40350,11 @@ var InMemoryAuditStorage = class {
|
|
|
40351
40350
|
|
|
40352
40351
|
// src/audit/audit-storage.ts
|
|
40353
40352
|
import * as fs9 from "fs";
|
|
40354
|
-
import * as
|
|
40353
|
+
import * as path8 from "path";
|
|
40355
40354
|
function validateLogDir(logDir, allowedRoot) {
|
|
40356
|
-
const resolvedRoot =
|
|
40357
|
-
const resolvedLogDir =
|
|
40358
|
-
if (!resolvedLogDir.startsWith(resolvedRoot +
|
|
40355
|
+
const resolvedRoot = path8.resolve(allowedRoot);
|
|
40356
|
+
const resolvedLogDir = path8.resolve(allowedRoot, logDir);
|
|
40357
|
+
if (!resolvedLogDir.startsWith(resolvedRoot + path8.sep) && resolvedLogDir !== resolvedRoot) {
|
|
40359
40358
|
return {
|
|
40360
40359
|
ok: false,
|
|
40361
40360
|
error: new SecurityError("Path traversal detected: logDir escapes allowed root directory", {
|
|
@@ -40378,10 +40377,10 @@ function validateLogDirBasic(logDir) {
|
|
|
40378
40377
|
};
|
|
40379
40378
|
}
|
|
40380
40379
|
}
|
|
40381
|
-
const resolved =
|
|
40380
|
+
const resolved = path8.resolve(logDir);
|
|
40382
40381
|
const systemDirs = ["/etc", "/var", "/usr", "/bin", "/sbin", "/root", "/proc", "/sys"];
|
|
40383
40382
|
for (const sysDir of systemDirs) {
|
|
40384
|
-
if (resolved === sysDir || resolved.startsWith(sysDir +
|
|
40383
|
+
if (resolved === sysDir || resolved.startsWith(sysDir + path8.sep)) {
|
|
40385
40384
|
return {
|
|
40386
40385
|
ok: false,
|
|
40387
40386
|
error: new SecurityError("logDir cannot be a system directory", {
|
|
@@ -40470,7 +40469,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
40470
40469
|
const existingFiles = this.getExistingLogFiles();
|
|
40471
40470
|
const latestFileName = existingFiles[0];
|
|
40472
40471
|
if (existingFiles.length > 0 && latestFileName !== void 0) {
|
|
40473
|
-
const latestFile =
|
|
40472
|
+
const latestFile = path8.join(this.logDir, latestFileName);
|
|
40474
40473
|
const stats = fs9.statSync(latestFile);
|
|
40475
40474
|
if (stats.size < this.maxFileSizeBytes) {
|
|
40476
40475
|
this.currentFile = latestFile;
|
|
@@ -40493,7 +40492,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
40493
40492
|
this.writeStream.end();
|
|
40494
40493
|
this.writeStream = null;
|
|
40495
40494
|
}
|
|
40496
|
-
this.currentFile =
|
|
40495
|
+
this.currentFile = path8.join(this.logDir, this.generateFileName());
|
|
40497
40496
|
this.currentFileSize = 0;
|
|
40498
40497
|
this.openWriteStream();
|
|
40499
40498
|
this.logger.debug("Rotated audit log file", { file: this.currentFile });
|
|
@@ -40504,7 +40503,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
40504
40503
|
if (files.length > this.maxFiles) {
|
|
40505
40504
|
const filesToDelete = files.slice(this.maxFiles);
|
|
40506
40505
|
for (const file of filesToDelete) {
|
|
40507
|
-
const filePath =
|
|
40506
|
+
const filePath = path8.join(this.logDir, file);
|
|
40508
40507
|
fs9.unlinkSync(filePath);
|
|
40509
40508
|
this.logger.info("Pruned old audit log", { file });
|
|
40510
40509
|
}
|
|
@@ -40558,7 +40557,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
40558
40557
|
let skipped = 0;
|
|
40559
40558
|
for (const file of files) {
|
|
40560
40559
|
if (results.length >= limit) break;
|
|
40561
|
-
const filePath =
|
|
40560
|
+
const filePath = path8.join(this.logDir, file);
|
|
40562
40561
|
const events = await readAuditFile({
|
|
40563
40562
|
filePath,
|
|
40564
40563
|
criteria,
|
|
@@ -41529,7 +41528,7 @@ function resolveConfidence(rule) {
|
|
|
41529
41528
|
}
|
|
41530
41529
|
|
|
41531
41530
|
// src/mcp/tools/security-scan.ts
|
|
41532
|
-
import * as
|
|
41531
|
+
import * as path9 from "path";
|
|
41533
41532
|
var logger33 = createLogger({ component: "security-scan" });
|
|
41534
41533
|
var SCAN_TIMEOUT_MS = 3e5;
|
|
41535
41534
|
async function isSemgrepAvailable() {
|
|
@@ -41556,9 +41555,9 @@ async function runSemgrep(targetDir, rulesets) {
|
|
|
41556
41555
|
return stdout;
|
|
41557
41556
|
}
|
|
41558
41557
|
function validateTargetPath(target) {
|
|
41559
|
-
const root =
|
|
41560
|
-
const resolved =
|
|
41561
|
-
if (resolved !== root && !resolved.startsWith(root +
|
|
41558
|
+
const root = path9.resolve(process.cwd());
|
|
41559
|
+
const resolved = path9.resolve(root, target);
|
|
41560
|
+
if (resolved !== root && !resolved.startsWith(root + path9.sep)) {
|
|
41562
41561
|
throw new Error(
|
|
41563
41562
|
`Invalid target path: must resolve inside ${root} (got ${resolved})`
|
|
41564
41563
|
);
|
|
@@ -41987,8 +41986,8 @@ async function runOsvCheck(targetDir, enabled) {
|
|
|
41987
41986
|
if (!enabled) return [];
|
|
41988
41987
|
try {
|
|
41989
41988
|
const fs20 = await import("fs");
|
|
41990
|
-
const
|
|
41991
|
-
const pkgPath =
|
|
41989
|
+
const path20 = await import("path");
|
|
41990
|
+
const pkgPath = path20.join(targetDir, "package.json");
|
|
41992
41991
|
if (!fs20.existsSync(pkgPath)) return [];
|
|
41993
41992
|
const pkg = JSON.parse(fs20.readFileSync(pkgPath, "utf-8"));
|
|
41994
41993
|
const deps = Object.entries(pkg.dependencies ?? {}).slice(0, 20).map(([name, version]) => ({
|
|
@@ -42099,11 +42098,10 @@ async function persistMobiMemState() {
|
|
|
42099
42098
|
try {
|
|
42100
42099
|
const { isPersistenceEnabled } = await import("./learning-persistence-WMWZJZ35.js");
|
|
42101
42100
|
if (!isPersistenceEnabled()) return;
|
|
42102
|
-
const
|
|
42103
|
-
const path21 = await import("path");
|
|
42101
|
+
const { nexusDataPath: nexusDataPath2 } = await import("./nexus-data-dir-M6DYKIHJ.js");
|
|
42104
42102
|
const { createMobiMem } = await import("./mobimem-QDBP37H7.js");
|
|
42105
42103
|
const mobimem = createMobiMem();
|
|
42106
|
-
const savePath =
|
|
42104
|
+
const savePath = nexusDataPath2("memory", "mobimem-state.json");
|
|
42107
42105
|
await mobimem.save(savePath);
|
|
42108
42106
|
} catch {
|
|
42109
42107
|
}
|
|
@@ -42257,7 +42255,7 @@ ${contextBlock}`;
|
|
|
42257
42255
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
42258
42256
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
42259
42257
|
try {
|
|
42260
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
42258
|
+
const { executeVoting } = await import("./consensus-vote-PRLGGUNY.js");
|
|
42261
42259
|
const votingResult = await executeVoting(
|
|
42262
42260
|
{
|
|
42263
42261
|
proposal: plan.slice(0, 4e3),
|
|
@@ -42417,7 +42415,7 @@ function extractIssues(text) {
|
|
|
42417
42415
|
|
|
42418
42416
|
// src/pipeline/pipeline-checkpoint.ts
|
|
42419
42417
|
import * as fs10 from "fs";
|
|
42420
|
-
import * as
|
|
42418
|
+
import * as path10 from "path";
|
|
42421
42419
|
var logger38 = createLogger({ component: "pipeline-checkpoint" });
|
|
42422
42420
|
var SESSION_ID_REGEX = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
42423
42421
|
function validateSessionId(sessionId) {
|
|
@@ -42429,7 +42427,7 @@ function getCheckpointPath(sessionId, customDir) {
|
|
|
42429
42427
|
logger38.warn("Checkpoint directory unavailable", { error: dirResult.error.message });
|
|
42430
42428
|
return null;
|
|
42431
42429
|
}
|
|
42432
|
-
return
|
|
42430
|
+
return path10.join(dirResult.value, `pipeline-${sessionId}.jsonl`);
|
|
42433
42431
|
}
|
|
42434
42432
|
function saveStageCheckpoint(sessionId, stage, data, customDir) {
|
|
42435
42433
|
if (!validateSessionId(sessionId)) {
|
|
@@ -42521,10 +42519,6 @@ function checkpointToResult(state) {
|
|
|
42521
42519
|
return result;
|
|
42522
42520
|
}
|
|
42523
42521
|
|
|
42524
|
-
// src/pipeline/dev-pipeline.ts
|
|
42525
|
-
import { homedir as homedir6 } from "os";
|
|
42526
|
-
import { join as join14 } from "path";
|
|
42527
|
-
|
|
42528
42522
|
// src/orchestration/qa-loop.ts
|
|
42529
42523
|
var logger39 = createLogger({ component: "qa-loop" });
|
|
42530
42524
|
var DEFAULT_MAX_QA_ITERATIONS = 3;
|
|
@@ -42611,7 +42605,7 @@ async function runDevPipelineInner(task, stages, options, sid, prior) {
|
|
|
42611
42605
|
function createTraceWriter(sessionId) {
|
|
42612
42606
|
if (sessionId === void 0) return null;
|
|
42613
42607
|
try {
|
|
42614
|
-
const tracesDir =
|
|
42608
|
+
const tracesDir = nexusDataPath("traces");
|
|
42615
42609
|
return new TraceWriter(getPipelineEventBus(), {
|
|
42616
42610
|
runsDir: tracesDir,
|
|
42617
42611
|
runId: `pipeline-${sessionId}`
|
|
@@ -43106,11 +43100,11 @@ async function extractSymbolsForTask(task) {
|
|
|
43106
43100
|
const fileRefs = task.match(/(?:src|lib|packages)\/[^\s,)]+\.ts/g);
|
|
43107
43101
|
if (fileRefs === null || fileRefs.length === 0) return null;
|
|
43108
43102
|
const { extractSymbols: extractSymbols2 } = await import("./symbol-extractor-UEBANFSN.js");
|
|
43109
|
-
const
|
|
43103
|
+
const path20 = await import("path");
|
|
43110
43104
|
const summaries = [];
|
|
43111
43105
|
for (const ref of fileRefs.slice(0, 3)) {
|
|
43112
43106
|
try {
|
|
43113
|
-
const resolved =
|
|
43107
|
+
const resolved = path20.resolve(ref);
|
|
43114
43108
|
const result = await extractSymbols2(resolved);
|
|
43115
43109
|
const exported = result.symbols.filter((s) => s.exported);
|
|
43116
43110
|
if (exported.length > 0) {
|
|
@@ -43127,12 +43121,12 @@ async function extractSymbolsForTask(task) {
|
|
|
43127
43121
|
async function retrieveAdaptiveMemory(task) {
|
|
43128
43122
|
try {
|
|
43129
43123
|
const { AdaptiveMemoryBackend } = await import("./adaptive-memory-TSZEJUJC.js");
|
|
43130
|
-
const
|
|
43131
|
-
const
|
|
43132
|
-
const baseDir =
|
|
43124
|
+
const path20 = await import("path");
|
|
43125
|
+
const { nexusDataPath: nexusDataPath2 } = await import("./nexus-data-dir-M6DYKIHJ.js");
|
|
43126
|
+
const baseDir = nexusDataPath2("memory");
|
|
43133
43127
|
const memory = new AdaptiveMemoryBackend({
|
|
43134
|
-
dbPath:
|
|
43135
|
-
markdownDir:
|
|
43128
|
+
dbPath: path20.join(baseDir, "adaptive.db"),
|
|
43129
|
+
markdownDir: path20.join(baseDir, "adaptive-md")
|
|
43136
43130
|
});
|
|
43137
43131
|
const key = task.slice(0, 50).replace(/\s+/g, "-").toLowerCase();
|
|
43138
43132
|
const result = await memory.retrieve(key);
|
|
@@ -43581,7 +43575,7 @@ function registerQueryTaskStateTool(server, deps) {
|
|
|
43581
43575
|
|
|
43582
43576
|
// src/mcp/tools/verify-audit-chain-tool.ts
|
|
43583
43577
|
import * as fs11 from "fs/promises";
|
|
43584
|
-
import * as
|
|
43578
|
+
import * as path11 from "path";
|
|
43585
43579
|
import { z as z92 } from "zod";
|
|
43586
43580
|
var VerifyAuditChainInputSchema = z92.object({
|
|
43587
43581
|
logDir: z92.string().min(1).max(512).describe(
|
|
@@ -43593,7 +43587,7 @@ async function loadAuditEvents(dir, logger56) {
|
|
|
43593
43587
|
const auditFiles = entries.filter((name) => name.startsWith("audit-") && name.endsWith(".jsonl")).sort();
|
|
43594
43588
|
const events = [];
|
|
43595
43589
|
for (const filename of auditFiles) {
|
|
43596
|
-
const fullPath =
|
|
43590
|
+
const fullPath = path11.join(dir, filename);
|
|
43597
43591
|
let content;
|
|
43598
43592
|
try {
|
|
43599
43593
|
content = await fs11.readFile(fullPath, "utf-8");
|
|
@@ -43628,7 +43622,7 @@ async function handler2(args, ctx) {
|
|
|
43628
43622
|
if (!parsed.success) {
|
|
43629
43623
|
return toolError(`Validation error: ${formatZodError(parsed.error)}`);
|
|
43630
43624
|
}
|
|
43631
|
-
const resolvedDir =
|
|
43625
|
+
const resolvedDir = path11.resolve(parsed.data.logDir);
|
|
43632
43626
|
let dirStats;
|
|
43633
43627
|
try {
|
|
43634
43628
|
dirStats = await fs11.stat(resolvedDir);
|
|
@@ -43678,7 +43672,7 @@ function registerVerifyAuditChainTool(server, deps) {
|
|
|
43678
43672
|
// src/mcp/tools/pipeline-tool.ts
|
|
43679
43673
|
import { z as z93 } from "zod";
|
|
43680
43674
|
import * as fs12 from "fs";
|
|
43681
|
-
import * as
|
|
43675
|
+
import * as path12 from "path";
|
|
43682
43676
|
var PipelineInputSchema = z93.object({
|
|
43683
43677
|
/** The task to execute. */
|
|
43684
43678
|
task: z93.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
|
|
@@ -43721,8 +43715,8 @@ function buildOutput2(result) {
|
|
|
43721
43715
|
}
|
|
43722
43716
|
function resolveTask(task, specFile) {
|
|
43723
43717
|
if (specFile === void 0) return task;
|
|
43724
|
-
const resolved =
|
|
43725
|
-
const cwdRoot =
|
|
43718
|
+
const resolved = path12.resolve(specFile);
|
|
43719
|
+
const cwdRoot = path12.resolve(".");
|
|
43726
43720
|
if (!resolved.startsWith(cwdRoot)) {
|
|
43727
43721
|
throw new Error(`Path traversal denied: specFile must be within ${cwdRoot}`);
|
|
43728
43722
|
}
|
|
@@ -43776,6 +43770,29 @@ function registerPipelineTool(server, _deps) {
|
|
|
43776
43770
|
});
|
|
43777
43771
|
}
|
|
43778
43772
|
|
|
43773
|
+
// src/mcp/tools/supply-chain-tradeoff-panel.ts
|
|
43774
|
+
import { z as z94 } from "zod";
|
|
43775
|
+
var DEFAULT_AXES = [
|
|
43776
|
+
"build_time_determinism",
|
|
43777
|
+
"supply_chain_risk",
|
|
43778
|
+
"update_cadence"
|
|
43779
|
+
];
|
|
43780
|
+
var MAX_AXES = 6;
|
|
43781
|
+
var MAX_AXIS_NAME_LENGTH = 64;
|
|
43782
|
+
var MAX_PROPOSAL_LENGTH = 4e3;
|
|
43783
|
+
var MAX_CONTEXT_LENGTH = 4e3;
|
|
43784
|
+
var SupplyChainTradeoffPanelInputSchema = z94.object({
|
|
43785
|
+
proposal: z94.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
|
|
43786
|
+
axes: z94.array(z94.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
|
|
43787
|
+
`Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
|
|
43788
|
+
),
|
|
43789
|
+
context: z94.string().max(MAX_CONTEXT_LENGTH).optional().describe(
|
|
43790
|
+
"Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
|
|
43791
|
+
),
|
|
43792
|
+
quickMode: z94.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
|
|
43793
|
+
simulate: z94.boolean().optional().default(false).describe("Use simulated voters (testing only)")
|
|
43794
|
+
});
|
|
43795
|
+
|
|
43779
43796
|
// src/mcp/tools/tool-annotations.ts
|
|
43780
43797
|
var TOOL_ANNOTATIONS = {
|
|
43781
43798
|
delegate_to_model: {
|
|
@@ -44194,7 +44211,8 @@ function registerTools(server, options) {
|
|
|
44194
44211
|
"search_codebase",
|
|
44195
44212
|
"run_dev_pipeline",
|
|
44196
44213
|
"run_pipeline",
|
|
44197
|
-
"pr_review"
|
|
44214
|
+
"pr_review",
|
|
44215
|
+
"supply_chain_tradeoff_panel"
|
|
44198
44216
|
],
|
|
44199
44217
|
logger: logger56,
|
|
44200
44218
|
rateLimiter
|
|
@@ -44322,40 +44340,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
|
|
|
44322
44340
|
})(RiskLevel || {});
|
|
44323
44341
|
|
|
44324
44342
|
// src/mcp/safety/stpa-schemas.ts
|
|
44325
|
-
import { z as
|
|
44326
|
-
var HazardCategorySchema =
|
|
44327
|
-
var HazardSeveritySchema =
|
|
44328
|
-
var ConstraintPrioritySchema =
|
|
44329
|
-
var RiskLevelSchema =
|
|
44330
|
-
var TriggerPatternSchema =
|
|
44331
|
-
parameter:
|
|
44332
|
-
matchType:
|
|
44333
|
-
pattern:
|
|
44334
|
-
reason:
|
|
44343
|
+
import { z as z95 } from "zod";
|
|
44344
|
+
var HazardCategorySchema = z95.enum(HazardCategory);
|
|
44345
|
+
var HazardSeveritySchema = z95.enum(HazardSeverity);
|
|
44346
|
+
var ConstraintPrioritySchema = z95.enum(ConstraintPriority);
|
|
44347
|
+
var RiskLevelSchema = z95.enum(RiskLevel);
|
|
44348
|
+
var TriggerPatternSchema = z95.object({
|
|
44349
|
+
parameter: z95.string().min(1),
|
|
44350
|
+
matchType: z95.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
|
|
44351
|
+
pattern: z95.string(),
|
|
44352
|
+
reason: z95.string()
|
|
44335
44353
|
});
|
|
44336
|
-
var HazardSchema =
|
|
44337
|
-
id:
|
|
44338
|
-
description:
|
|
44354
|
+
var HazardSchema = z95.object({
|
|
44355
|
+
id: z95.string().min(1),
|
|
44356
|
+
description: z95.string(),
|
|
44339
44357
|
category: HazardCategorySchema,
|
|
44340
44358
|
severity: HazardSeveritySchema,
|
|
44341
|
-
likelihood:
|
|
44342
|
-
triggerConditions:
|
|
44343
|
-
consequences:
|
|
44359
|
+
likelihood: z95.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
|
|
44360
|
+
triggerConditions: z95.array(z95.string()),
|
|
44361
|
+
consequences: z95.array(z95.string())
|
|
44344
44362
|
});
|
|
44345
|
-
var UnsafeControlActionSchema =
|
|
44346
|
-
id:
|
|
44347
|
-
toolName:
|
|
44348
|
-
type:
|
|
44349
|
-
description:
|
|
44350
|
-
unsafeContext:
|
|
44351
|
-
relatedHazards:
|
|
44352
|
-
triggerPatterns:
|
|
44363
|
+
var UnsafeControlActionSchema = z95.object({
|
|
44364
|
+
id: z95.string().min(1),
|
|
44365
|
+
toolName: z95.string().min(1),
|
|
44366
|
+
type: z95.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
|
|
44367
|
+
description: z95.string(),
|
|
44368
|
+
unsafeContext: z95.string(),
|
|
44369
|
+
relatedHazards: z95.array(z95.string()),
|
|
44370
|
+
triggerPatterns: z95.array(TriggerPatternSchema).optional()
|
|
44353
44371
|
});
|
|
44354
|
-
var SafetyConstraintSchema =
|
|
44355
|
-
id:
|
|
44356
|
-
description:
|
|
44357
|
-
mitigates:
|
|
44358
|
-
enforcement:
|
|
44372
|
+
var SafetyConstraintSchema = z95.object({
|
|
44373
|
+
id: z95.string().min(1),
|
|
44374
|
+
description: z95.string(),
|
|
44375
|
+
mitigates: z95.array(z95.string()),
|
|
44376
|
+
enforcement: z95.enum([
|
|
44359
44377
|
"prevent",
|
|
44360
44378
|
"require_confirmation",
|
|
44361
44379
|
"alert",
|
|
@@ -44363,54 +44381,54 @@ var SafetyConstraintSchema = z94.object({
|
|
|
44363
44381
|
"rate_limit",
|
|
44364
44382
|
"require_privilege"
|
|
44365
44383
|
]),
|
|
44366
|
-
validationFunction:
|
|
44384
|
+
validationFunction: z95.string().optional(),
|
|
44367
44385
|
priority: ConstraintPrioritySchema
|
|
44368
44386
|
});
|
|
44369
|
-
var PropertySchemaSchema =
|
|
44370
|
-
type:
|
|
44371
|
-
description:
|
|
44372
|
-
enum:
|
|
44373
|
-
pattern:
|
|
44374
|
-
minimum:
|
|
44375
|
-
maximum:
|
|
44387
|
+
var PropertySchemaSchema = z95.object({
|
|
44388
|
+
type: z95.string(),
|
|
44389
|
+
description: z95.string().optional(),
|
|
44390
|
+
enum: z95.array(z95.unknown()).optional(),
|
|
44391
|
+
pattern: z95.string().optional(),
|
|
44392
|
+
minimum: z95.number().optional(),
|
|
44393
|
+
maximum: z95.number().optional()
|
|
44376
44394
|
});
|
|
44377
|
-
var ToolInputSchemaSchema =
|
|
44378
|
-
type:
|
|
44379
|
-
properties:
|
|
44380
|
-
required:
|
|
44381
|
-
additionalProperties:
|
|
44395
|
+
var ToolInputSchemaSchema = z95.object({
|
|
44396
|
+
type: z95.string(),
|
|
44397
|
+
properties: z95.record(z95.string(), PropertySchemaSchema).optional(),
|
|
44398
|
+
required: z95.array(z95.string()).optional(),
|
|
44399
|
+
additionalProperties: z95.boolean().optional()
|
|
44382
44400
|
});
|
|
44383
|
-
var ToolDefinitionSchema =
|
|
44384
|
-
name:
|
|
44385
|
-
description:
|
|
44401
|
+
var ToolDefinitionSchema = z95.object({
|
|
44402
|
+
name: z95.string().min(1),
|
|
44403
|
+
description: z95.string(),
|
|
44386
44404
|
inputSchema: ToolInputSchemaSchema
|
|
44387
44405
|
});
|
|
44388
|
-
var AnalysisConfigurationSchema =
|
|
44389
|
-
includeLowSeverity:
|
|
44390
|
-
generateAllConstraints:
|
|
44391
|
-
checkInteractions:
|
|
44392
|
-
maxHazardsPerTool:
|
|
44393
|
-
categories:
|
|
44406
|
+
var AnalysisConfigurationSchema = z95.object({
|
|
44407
|
+
includeLowSeverity: z95.boolean().default(true),
|
|
44408
|
+
generateAllConstraints: z95.boolean().default(true),
|
|
44409
|
+
checkInteractions: z95.boolean().default(true),
|
|
44410
|
+
maxHazardsPerTool: z95.number().int().min(1).max(100).default(50),
|
|
44411
|
+
categories: z95.array(HazardCategorySchema).default([])
|
|
44394
44412
|
});
|
|
44395
|
-
var ConstraintViolationSchema =
|
|
44396
|
-
constraintId:
|
|
44397
|
-
constraintDescription:
|
|
44413
|
+
var ConstraintViolationSchema = z95.object({
|
|
44414
|
+
constraintId: z95.string().min(1),
|
|
44415
|
+
constraintDescription: z95.string(),
|
|
44398
44416
|
severity: HazardSeveritySchema,
|
|
44399
|
-
details:
|
|
44400
|
-
remediation:
|
|
44417
|
+
details: z95.string(),
|
|
44418
|
+
remediation: z95.string()
|
|
44401
44419
|
});
|
|
44402
|
-
var ValidationWarningSchema =
|
|
44403
|
-
code:
|
|
44404
|
-
message:
|
|
44405
|
-
affected:
|
|
44420
|
+
var ValidationWarningSchema = z95.object({
|
|
44421
|
+
code: z95.string().min(1),
|
|
44422
|
+
message: z95.string(),
|
|
44423
|
+
affected: z95.string()
|
|
44406
44424
|
});
|
|
44407
|
-
var ValidationResultSchema =
|
|
44408
|
-
valid:
|
|
44409
|
-
toolName:
|
|
44410
|
-
violations:
|
|
44411
|
-
passed:
|
|
44412
|
-
warnings:
|
|
44413
|
-
validatedAt:
|
|
44425
|
+
var ValidationResultSchema = z95.object({
|
|
44426
|
+
valid: z95.boolean(),
|
|
44427
|
+
toolName: z95.string().min(1),
|
|
44428
|
+
violations: z95.array(ConstraintViolationSchema),
|
|
44429
|
+
passed: z95.array(z95.string()),
|
|
44430
|
+
warnings: z95.array(ValidationWarningSchema),
|
|
44431
|
+
validatedAt: z95.date()
|
|
44414
44432
|
});
|
|
44415
44433
|
|
|
44416
44434
|
// src/mcp/safety/stpa-types.ts
|
|
@@ -45495,22 +45513,22 @@ var GeminiResponseParser = class {
|
|
|
45495
45513
|
};
|
|
45496
45514
|
|
|
45497
45515
|
// src/cli-adapters/task-analyzer.ts
|
|
45498
|
-
import { z as
|
|
45499
|
-
var TaskProfileSchema =
|
|
45516
|
+
import { z as z96 } from "zod";
|
|
45517
|
+
var TaskProfileSchema = z96.object({
|
|
45500
45518
|
/** Estimated input tokens required */
|
|
45501
|
-
contextRequired:
|
|
45519
|
+
contextRequired: z96.number().min(0),
|
|
45502
45520
|
/** Reasoning complexity on 0-10 scale */
|
|
45503
|
-
reasoningComplexity:
|
|
45521
|
+
reasoningComplexity: z96.number().min(0).max(10),
|
|
45504
45522
|
/** Whether task involves code generation */
|
|
45505
|
-
codeGeneration:
|
|
45523
|
+
codeGeneration: z96.boolean(),
|
|
45506
45524
|
/** Whether task involves multimodal content (images, etc.) */
|
|
45507
|
-
multimodal:
|
|
45525
|
+
multimodal: z96.boolean(),
|
|
45508
45526
|
/** Whether task can be split into parallel subtasks */
|
|
45509
|
-
parallelizable:
|
|
45527
|
+
parallelizable: z96.boolean(),
|
|
45510
45528
|
/** Whether cost should be minimized */
|
|
45511
|
-
budgetSensitive:
|
|
45529
|
+
budgetSensitive: z96.boolean(),
|
|
45512
45530
|
/** Primary task type classification */
|
|
45513
|
-
taskType:
|
|
45531
|
+
taskType: z96.enum([
|
|
45514
45532
|
"architecture",
|
|
45515
45533
|
"code_implementation",
|
|
45516
45534
|
"code_review",
|
|
@@ -45524,53 +45542,53 @@ var TaskProfileSchema = z95.object({
|
|
|
45524
45542
|
});
|
|
45525
45543
|
|
|
45526
45544
|
// src/cli-adapters/router-types.ts
|
|
45527
|
-
import { z as
|
|
45528
|
-
var RouterConfigSchema =
|
|
45529
|
-
minCapacityThreshold:
|
|
45530
|
-
preferCostEfficient:
|
|
45531
|
-
maxDecisionTimeMs:
|
|
45545
|
+
import { z as z97 } from "zod";
|
|
45546
|
+
var RouterConfigSchema = z97.object({
|
|
45547
|
+
minCapacityThreshold: z97.number().min(0).max(1).default(0.1),
|
|
45548
|
+
preferCostEfficient: z97.boolean().default(false),
|
|
45549
|
+
maxDecisionTimeMs: z97.number().min(1).max(1e3).default(100)
|
|
45532
45550
|
});
|
|
45533
45551
|
|
|
45534
45552
|
// src/cli-adapters/agreement-cascade-types.ts
|
|
45535
|
-
import { z as
|
|
45536
|
-
var AgreementCascadeConfigSchema =
|
|
45537
|
-
agreementThreshold:
|
|
45538
|
-
maxStages:
|
|
45539
|
-
modelTimeoutMs:
|
|
45553
|
+
import { z as z98 } from "zod";
|
|
45554
|
+
var AgreementCascadeConfigSchema = z98.object({
|
|
45555
|
+
agreementThreshold: z98.number().min(0.5).max(1).default(0.7),
|
|
45556
|
+
maxStages: z98.number().int().min(1).max(5).default(3),
|
|
45557
|
+
modelTimeoutMs: z98.number().int().min(1e3).max(3e5).default(6e4)
|
|
45540
45558
|
});
|
|
45541
45559
|
|
|
45542
45560
|
// src/cli-adapters/agreement-cascade-router.ts
|
|
45543
45561
|
var logger42 = createLogger({ component: "agreement-cascade-router" });
|
|
45544
45562
|
|
|
45545
45563
|
// src/cli-adapters/daao-types.ts
|
|
45546
|
-
import { z as
|
|
45547
|
-
var EncodedFeaturesSchema =
|
|
45564
|
+
import { z as z99 } from "zod";
|
|
45565
|
+
var EncodedFeaturesSchema = z99.object({
|
|
45548
45566
|
/** Lexical complexity score (vocabulary diversity, rare words) */
|
|
45549
|
-
lexicalComplexity:
|
|
45567
|
+
lexicalComplexity: z99.number().min(0).max(1),
|
|
45550
45568
|
/** Syntactic complexity score (sentence structure, nesting) */
|
|
45551
|
-
syntacticComplexity:
|
|
45569
|
+
syntacticComplexity: z99.number().min(0).max(1),
|
|
45552
45570
|
/** Semantic density score (concept density, abstraction level) */
|
|
45553
|
-
semanticDensity:
|
|
45571
|
+
semanticDensity: z99.number().min(0).max(1),
|
|
45554
45572
|
/** Technical specificity (domain-specific terminology) */
|
|
45555
|
-
technicalSpecificity:
|
|
45573
|
+
technicalSpecificity: z99.number().min(0).max(1),
|
|
45556
45574
|
/** Task scope (breadth of requirements) */
|
|
45557
|
-
taskScope:
|
|
45575
|
+
taskScope: z99.number().min(0).max(1),
|
|
45558
45576
|
/** Constraint complexity (constraints, edge cases, requirements) */
|
|
45559
|
-
constraintComplexity:
|
|
45577
|
+
constraintComplexity: z99.number().min(0).max(1),
|
|
45560
45578
|
/** Ambiguity level (inverse - higher means more clear/specific) */
|
|
45561
|
-
clarity:
|
|
45579
|
+
clarity: z99.number().min(0).max(1),
|
|
45562
45580
|
/** Output complexity expectation */
|
|
45563
|
-
outputComplexity:
|
|
45581
|
+
outputComplexity: z99.number().min(0).max(1)
|
|
45564
45582
|
});
|
|
45565
|
-
var FeatureWeightsSchema =
|
|
45566
|
-
lexicalComplexity:
|
|
45567
|
-
syntacticComplexity:
|
|
45568
|
-
semanticDensity:
|
|
45569
|
-
technicalSpecificity:
|
|
45570
|
-
taskScope:
|
|
45571
|
-
constraintComplexity:
|
|
45572
|
-
clarity:
|
|
45573
|
-
outputComplexity:
|
|
45583
|
+
var FeatureWeightsSchema = z99.object({
|
|
45584
|
+
lexicalComplexity: z99.number().min(0).max(1),
|
|
45585
|
+
syntacticComplexity: z99.number().min(0).max(1),
|
|
45586
|
+
semanticDensity: z99.number().min(0).max(1),
|
|
45587
|
+
technicalSpecificity: z99.number().min(0).max(1),
|
|
45588
|
+
taskScope: z99.number().min(0).max(1),
|
|
45589
|
+
constraintComplexity: z99.number().min(0).max(1),
|
|
45590
|
+
clarity: z99.number().min(0).max(1),
|
|
45591
|
+
outputComplexity: z99.number().min(0).max(1)
|
|
45574
45592
|
});
|
|
45575
45593
|
var DEFAULT_FEATURE_WEIGHTS = {
|
|
45576
45594
|
lexicalComplexity: 0.1,
|
|
@@ -45592,50 +45610,50 @@ var DEFAULT_DAAO_TIER_TO_CLIS = {
|
|
|
45592
45610
|
balanced: ["codex", "opencode", "gemini", "claude"],
|
|
45593
45611
|
powerful: ["claude", "codex", "opencode", "gemini"]
|
|
45594
45612
|
};
|
|
45595
|
-
var DAAOConfigSchema =
|
|
45613
|
+
var DAAOConfigSchema = z99.object({
|
|
45596
45614
|
/** Difficulty thresholds for level classification */
|
|
45597
|
-
thresholds:
|
|
45598
|
-
easyUpperBound:
|
|
45599
|
-
hardLowerBound:
|
|
45615
|
+
thresholds: z99.object({
|
|
45616
|
+
easyUpperBound: z99.number().min(0).max(1),
|
|
45617
|
+
hardLowerBound: z99.number().min(0).max(1)
|
|
45600
45618
|
}).default(DEFAULT_DAAO_THRESHOLDS),
|
|
45601
45619
|
/** Feature weights for difficulty aggregation */
|
|
45602
45620
|
weights: FeatureWeightsSchema.default(DEFAULT_FEATURE_WEIGHTS),
|
|
45603
45621
|
/** Mapping from model tier to CLI preference order */
|
|
45604
|
-
tierToClis:
|
|
45605
|
-
|
|
45606
|
-
|
|
45622
|
+
tierToClis: z99.record(
|
|
45623
|
+
z99.enum(["fast", "balanced", "powerful"]),
|
|
45624
|
+
z99.array(z99.enum(["claude", "gemini", "codex", "opencode"]))
|
|
45607
45625
|
).default(DEFAULT_DAAO_TIER_TO_CLIS),
|
|
45608
45626
|
/** Enable adaptive calibration from outcomes */
|
|
45609
|
-
enableCalibration:
|
|
45627
|
+
enableCalibration: z99.boolean().default(true),
|
|
45610
45628
|
/** Maximum outcomes to store for calibration */
|
|
45611
|
-
maxCalibrationOutcomes:
|
|
45629
|
+
maxCalibrationOutcomes: z99.number().int().positive().default(1e3),
|
|
45612
45630
|
/** Minimum outcomes before applying calibration adjustments */
|
|
45613
|
-
minCalibrationOutcomes:
|
|
45631
|
+
minCalibrationOutcomes: z99.number().int().positive().default(50),
|
|
45614
45632
|
/** Reconstruction error threshold for typical patterns */
|
|
45615
|
-
typicalPatternThreshold:
|
|
45633
|
+
typicalPatternThreshold: z99.number().min(0).max(1).default(0.3),
|
|
45616
45634
|
/** Verbose logging */
|
|
45617
|
-
verbose:
|
|
45635
|
+
verbose: z99.boolean().default(false)
|
|
45618
45636
|
});
|
|
45619
45637
|
|
|
45620
45638
|
// src/cli-adapters/task-classifier.ts
|
|
45621
|
-
import { z as
|
|
45622
|
-
var ClassificationPatternsSchema =
|
|
45623
|
-
code:
|
|
45624
|
-
research:
|
|
45625
|
-
documentation:
|
|
45626
|
-
analysis:
|
|
45639
|
+
import { z as z100 } from "zod";
|
|
45640
|
+
var ClassificationPatternsSchema = z100.object({
|
|
45641
|
+
code: z100.array(z100.string()).readonly(),
|
|
45642
|
+
research: z100.array(z100.string()).readonly(),
|
|
45643
|
+
documentation: z100.array(z100.string()).readonly(),
|
|
45644
|
+
analysis: z100.array(z100.string()).readonly()
|
|
45627
45645
|
});
|
|
45628
45646
|
|
|
45629
45647
|
// src/cli-adapters/response-cache-types.ts
|
|
45630
|
-
import { z as
|
|
45631
|
-
var ResponseCacheConfigSchema =
|
|
45632
|
-
defaultTTL:
|
|
45648
|
+
import { z as z101 } from "zod";
|
|
45649
|
+
var ResponseCacheConfigSchema = z101.object({
|
|
45650
|
+
defaultTTL: z101.number().min(1e3).max(36e5).default(3e5),
|
|
45633
45651
|
// 5 minutes
|
|
45634
|
-
maxEntries:
|
|
45635
|
-
maxMemoryMB:
|
|
45636
|
-
cleanupInterval:
|
|
45652
|
+
maxEntries: z101.number().min(10).max(1e5).default(1e3),
|
|
45653
|
+
maxMemoryMB: z101.number().min(1).max(1e3).default(50),
|
|
45654
|
+
cleanupInterval: z101.number().min(1e3).max(6e5).default(6e4),
|
|
45637
45655
|
// 1 minute
|
|
45638
|
-
enableLogging:
|
|
45656
|
+
enableLogging: z101.boolean().default(false)
|
|
45639
45657
|
});
|
|
45640
45658
|
|
|
45641
45659
|
// src/cli-adapters/response-cache-utils.ts
|
|
@@ -45643,12 +45661,12 @@ import { createHash as createHash4 } from "crypto";
|
|
|
45643
45661
|
var logger43 = createLogger({ component: "ResponseCacheUtils" });
|
|
45644
45662
|
|
|
45645
45663
|
// src/cli-adapters/unified-routing-types.ts
|
|
45646
|
-
import { z as
|
|
45647
|
-
var UnifiedRoutingDecisionSchema =
|
|
45648
|
-
selectedCli:
|
|
45649
|
-
confidence:
|
|
45650
|
-
reason:
|
|
45651
|
-
strategy:
|
|
45664
|
+
import { z as z102 } from "zod";
|
|
45665
|
+
var UnifiedRoutingDecisionSchema = z102.object({
|
|
45666
|
+
selectedCli: z102.string(),
|
|
45667
|
+
confidence: z102.number().min(0).max(1),
|
|
45668
|
+
reason: z102.string(),
|
|
45669
|
+
strategy: z102.enum([
|
|
45652
45670
|
"composite",
|
|
45653
45671
|
"quality",
|
|
45654
45672
|
"budget",
|
|
@@ -45660,57 +45678,57 @@ var UnifiedRoutingDecisionSchema = z101.object({
|
|
|
45660
45678
|
"linucb",
|
|
45661
45679
|
"direct"
|
|
45662
45680
|
]),
|
|
45663
|
-
decisionTimeMs:
|
|
45664
|
-
alternatives:
|
|
45665
|
-
stagesExecuted:
|
|
45666
|
-
withinBudget:
|
|
45667
|
-
estimatedComplexity:
|
|
45668
|
-
estimatedTokens:
|
|
45669
|
-
topsisScore:
|
|
45670
|
-
ucbScore:
|
|
45671
|
-
resolvedAtStage:
|
|
45672
|
-
consensusReached:
|
|
45673
|
-
agreementScore:
|
|
45674
|
-
metadata:
|
|
45681
|
+
decisionTimeMs: z102.number().nonnegative(),
|
|
45682
|
+
alternatives: z102.array(z102.string()).readonly(),
|
|
45683
|
+
stagesExecuted: z102.array(z102.string()).readonly(),
|
|
45684
|
+
withinBudget: z102.boolean().optional(),
|
|
45685
|
+
estimatedComplexity: z102.enum(["simple", "moderate", "complex", "expert"]).optional(),
|
|
45686
|
+
estimatedTokens: z102.number().int().positive().optional(),
|
|
45687
|
+
topsisScore: z102.number().optional(),
|
|
45688
|
+
ucbScore: z102.number().optional(),
|
|
45689
|
+
resolvedAtStage: z102.number().int().nonnegative().optional(),
|
|
45690
|
+
consensusReached: z102.boolean().optional(),
|
|
45691
|
+
agreementScore: z102.number().min(0).max(1).optional(),
|
|
45692
|
+
metadata: z102.record(z102.string(), z102.unknown()).optional()
|
|
45675
45693
|
});
|
|
45676
45694
|
|
|
45677
45695
|
// src/learning/outcome-feedback-types.ts
|
|
45678
|
-
import { z as
|
|
45679
|
-
var QualitySignalsSchema =
|
|
45680
|
-
testsPass:
|
|
45681
|
-
lintErrors:
|
|
45682
|
-
userApproved:
|
|
45683
|
-
retryCount:
|
|
45684
|
-
completionRatio:
|
|
45685
|
-
validStructure:
|
|
45686
|
-
coherenceScore:
|
|
45696
|
+
import { z as z103 } from "zod";
|
|
45697
|
+
var QualitySignalsSchema = z103.object({
|
|
45698
|
+
testsPass: z103.boolean().optional(),
|
|
45699
|
+
lintErrors: z103.number().int().min(0).optional(),
|
|
45700
|
+
userApproved: z103.boolean().optional(),
|
|
45701
|
+
retryCount: z103.number().int().min(0).default(0),
|
|
45702
|
+
completionRatio: z103.number().min(0).max(1).default(1),
|
|
45703
|
+
validStructure: z103.boolean().optional(),
|
|
45704
|
+
coherenceScore: z103.number().min(0).max(1).optional()
|
|
45687
45705
|
});
|
|
45688
|
-
var RoutingDecisionSchema =
|
|
45689
|
-
id:
|
|
45690
|
-
timestamp:
|
|
45691
|
-
query:
|
|
45692
|
-
routerType:
|
|
45693
|
-
selectedModel:
|
|
45694
|
-
selectedTier:
|
|
45695
|
-
armIndex:
|
|
45696
|
-
banditContext:
|
|
45697
|
-
queryFeatures:
|
|
45698
|
-
ucbScore:
|
|
45699
|
-
confidence:
|
|
45700
|
-
traceId:
|
|
45701
|
-
domain:
|
|
45706
|
+
var RoutingDecisionSchema = z103.object({
|
|
45707
|
+
id: z103.uuid(),
|
|
45708
|
+
timestamp: z103.iso.datetime(),
|
|
45709
|
+
query: z103.string(),
|
|
45710
|
+
routerType: z103.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
|
|
45711
|
+
selectedModel: z103.string(),
|
|
45712
|
+
selectedTier: z103.enum(["strong", "weak"]).optional(),
|
|
45713
|
+
armIndex: z103.number().int().min(0).optional(),
|
|
45714
|
+
banditContext: z103.record(z103.string(), z103.unknown()).optional(),
|
|
45715
|
+
queryFeatures: z103.record(z103.string(), z103.unknown()).optional(),
|
|
45716
|
+
ucbScore: z103.number().optional(),
|
|
45717
|
+
confidence: z103.number().min(0).max(1).optional(),
|
|
45718
|
+
traceId: z103.string(),
|
|
45719
|
+
domain: z103.string().optional()
|
|
45702
45720
|
});
|
|
45703
|
-
var TaskOutcomeSchema =
|
|
45704
|
-
routingDecisionId:
|
|
45705
|
-
timestamp:
|
|
45706
|
-
outcomeClass:
|
|
45707
|
-
success:
|
|
45708
|
-
qualityScore:
|
|
45709
|
-
durationMs:
|
|
45710
|
-
tokenUsage:
|
|
45711
|
-
errorMessage:
|
|
45721
|
+
var TaskOutcomeSchema = z103.object({
|
|
45722
|
+
routingDecisionId: z103.uuid(),
|
|
45723
|
+
timestamp: z103.iso.datetime(),
|
|
45724
|
+
outcomeClass: z103.enum(["success", "partial", "failure", "timeout", "error"]),
|
|
45725
|
+
success: z103.boolean(),
|
|
45726
|
+
qualityScore: z103.number().min(0).max(1),
|
|
45727
|
+
durationMs: z103.number().min(0),
|
|
45728
|
+
tokenUsage: z103.number().int().min(0),
|
|
45729
|
+
errorMessage: z103.string().optional(),
|
|
45712
45730
|
qualitySignals: QualitySignalsSchema,
|
|
45713
|
-
traceId:
|
|
45731
|
+
traceId: z103.string()
|
|
45714
45732
|
});
|
|
45715
45733
|
var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
45716
45734
|
maxPendingDecisions: 1e3,
|
|
@@ -45725,17 +45743,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
|
45725
45743
|
targetTokenUsage: 2e3,
|
|
45726
45744
|
maxHistorySize: 1e4
|
|
45727
45745
|
};
|
|
45728
|
-
var FeedbackCollectorConfigSchema =
|
|
45729
|
-
maxPendingDecisions:
|
|
45730
|
-
pendingTimeoutMs:
|
|
45731
|
-
enableAutoReward:
|
|
45732
|
-
qualityWeight:
|
|
45733
|
-
speedWeight:
|
|
45734
|
-
efficiencyWeight:
|
|
45735
|
-
retryPenalty:
|
|
45736
|
-
targetDurationMs:
|
|
45737
|
-
targetTokenUsage:
|
|
45738
|
-
maxHistorySize:
|
|
45746
|
+
var FeedbackCollectorConfigSchema = z103.object({
|
|
45747
|
+
maxPendingDecisions: z103.number().int().positive().default(1e3),
|
|
45748
|
+
pendingTimeoutMs: z103.number().positive().default(3e5),
|
|
45749
|
+
enableAutoReward: z103.boolean().default(true),
|
|
45750
|
+
qualityWeight: z103.number().min(0).max(1).default(0.5),
|
|
45751
|
+
speedWeight: z103.number().min(0).max(1).default(0.2),
|
|
45752
|
+
efficiencyWeight: z103.number().min(0).max(1).default(0.2),
|
|
45753
|
+
retryPenalty: z103.number().min(0).max(1).default(0.1),
|
|
45754
|
+
targetDurationMs: z103.number().positive().default(5e3),
|
|
45755
|
+
targetTokenUsage: z103.number().positive().default(2e3),
|
|
45756
|
+
maxHistorySize: z103.number().int().positive().default(1e4)
|
|
45739
45757
|
});
|
|
45740
45758
|
|
|
45741
45759
|
// src/learning/outcome-feedback-helpers.ts
|
|
@@ -48129,13 +48147,13 @@ function createEmptyContext() {
|
|
|
48129
48147
|
approachHistory: []
|
|
48130
48148
|
};
|
|
48131
48149
|
}
|
|
48132
|
-
function assignRelevance(
|
|
48150
|
+
function assignRelevance(path20, response) {
|
|
48133
48151
|
const lowerResponse = response.toLowerCase();
|
|
48134
|
-
const lowerPath =
|
|
48152
|
+
const lowerPath = path20.toLowerCase();
|
|
48135
48153
|
const idx = lowerResponse.indexOf(lowerPath);
|
|
48136
48154
|
if (idx === -1) return "low";
|
|
48137
48155
|
const surroundStart = Math.max(0, idx - 100);
|
|
48138
|
-
const surroundEnd = Math.min(lowerResponse.length, idx +
|
|
48156
|
+
const surroundEnd = Math.min(lowerResponse.length, idx + path20.length + 100);
|
|
48139
48157
|
const surrounding = lowerResponse.slice(surroundStart, surroundEnd);
|
|
48140
48158
|
if (/(?:root cause|bug|fix|patch|change|modify|edit)/i.test(surrounding)) {
|
|
48141
48159
|
return "high";
|
|
@@ -48279,9 +48297,9 @@ var SAFE_COMMIT_RE = /^[0-9a-f]{7,40}$/i;
|
|
|
48279
48297
|
var SAFE_REPO_RE = /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/;
|
|
48280
48298
|
async function tryExistingClone(repoDir, commit, exec5) {
|
|
48281
48299
|
const fs20 = await import("fs/promises");
|
|
48282
|
-
const
|
|
48300
|
+
const path20 = await import("path");
|
|
48283
48301
|
try {
|
|
48284
|
-
await fs20.access(
|
|
48302
|
+
await fs20.access(path20.join(repoDir, ".git"));
|
|
48285
48303
|
await exec5(`git checkout -- .`, { cwd: repoDir, timeout: GIT_TIMEOUT_MS });
|
|
48286
48304
|
await exec5(`git clean -fd`, { cwd: repoDir, timeout: GIT_TIMEOUT_MS });
|
|
48287
48305
|
try {
|
|
@@ -48300,7 +48318,7 @@ async function tryExistingClone(repoDir, commit, exec5) {
|
|
|
48300
48318
|
}
|
|
48301
48319
|
}
|
|
48302
48320
|
async function cloneRepository(repo, commit, workDir) {
|
|
48303
|
-
const
|
|
48321
|
+
const path20 = await import("path");
|
|
48304
48322
|
const fs20 = await import("fs/promises");
|
|
48305
48323
|
const childProcess = await import("child_process");
|
|
48306
48324
|
const { promisify: promisify9 } = await import("util");
|
|
@@ -48311,7 +48329,7 @@ async function cloneRepository(repo, commit, workDir) {
|
|
|
48311
48329
|
if (!SAFE_COMMIT_RE.test(commit)) {
|
|
48312
48330
|
return { ok: false, error: new AgentRunnerError(`Invalid commit hash: ${commit}`) };
|
|
48313
48331
|
}
|
|
48314
|
-
const repoDir =
|
|
48332
|
+
const repoDir = path20.join(workDir, repo.replaceAll("/", "__"));
|
|
48315
48333
|
try {
|
|
48316
48334
|
await fs20.mkdir(workDir, { recursive: true });
|
|
48317
48335
|
const cloned = await tryExistingClone(repoDir, commit, exec5);
|
|
@@ -48330,8 +48348,8 @@ async function applyPatch(repoDir, patch) {
|
|
|
48330
48348
|
const { promisify: promisify9 } = await import("util");
|
|
48331
48349
|
const exec5 = promisify9(childProcess.exec);
|
|
48332
48350
|
const fs20 = await import("fs/promises");
|
|
48333
|
-
const
|
|
48334
|
-
const patchFile =
|
|
48351
|
+
const path20 = await import("path");
|
|
48352
|
+
const patchFile = path20.join(repoDir, ".agent_patch.diff");
|
|
48335
48353
|
try {
|
|
48336
48354
|
await fs20.writeFile(patchFile, patch);
|
|
48337
48355
|
await exec5(`git apply --whitespace=fix ${patchFile}`, {
|
|
@@ -49469,7 +49487,7 @@ function transformHarnessOutput(raw) {
|
|
|
49469
49487
|
// src/swe-bench/harness-file-operations.ts
|
|
49470
49488
|
import { spawn } from "child_process";
|
|
49471
49489
|
import * as fs14 from "fs/promises";
|
|
49472
|
-
import * as
|
|
49490
|
+
import * as path13 from "path";
|
|
49473
49491
|
var capitalizeFirst = capitalize;
|
|
49474
49492
|
function buildHarnessArgs(config) {
|
|
49475
49493
|
const args = [
|
|
@@ -49566,7 +49584,7 @@ function createInitialProgress(totalCount) {
|
|
|
49566
49584
|
};
|
|
49567
49585
|
}
|
|
49568
49586
|
function getResultsFilePath(config) {
|
|
49569
|
-
return
|
|
49587
|
+
return path13.join(config.outputDir, config.runId, "results.json");
|
|
49570
49588
|
}
|
|
49571
49589
|
|
|
49572
49590
|
// src/swe-bench/harness-process-runner.ts
|
|
@@ -50123,7 +50141,7 @@ function formatValidationResult(result) {
|
|
|
50123
50141
|
}
|
|
50124
50142
|
|
|
50125
50143
|
// src/swe-bench/evaluation-harness-helpers.ts
|
|
50126
|
-
import * as
|
|
50144
|
+
import * as os3 from "os";
|
|
50127
50145
|
function calculateMetrics(results) {
|
|
50128
50146
|
const totalInstances = results.length;
|
|
50129
50147
|
const predictedInstances = totalInstances;
|
|
@@ -50215,12 +50233,12 @@ function createProgressAdapter(totalPredictions, onProgress) {
|
|
|
50215
50233
|
}
|
|
50216
50234
|
function getMemoryInfo() {
|
|
50217
50235
|
return {
|
|
50218
|
-
total:
|
|
50219
|
-
free:
|
|
50236
|
+
total: os3.totalmem(),
|
|
50237
|
+
free: os3.freemem()
|
|
50220
50238
|
};
|
|
50221
50239
|
}
|
|
50222
50240
|
function getCpuCores() {
|
|
50223
|
-
return
|
|
50241
|
+
return os3.cpus().length;
|
|
50224
50242
|
}
|
|
50225
50243
|
|
|
50226
50244
|
// src/swe-bench/evaluation-harness.ts
|
|
@@ -51304,11 +51322,11 @@ function parsePatch(patch) {
|
|
|
51304
51322
|
import { execFile as execFile5 } from "child_process";
|
|
51305
51323
|
import { promisify as promisify7 } from "util";
|
|
51306
51324
|
import * as fs15 from "fs/promises";
|
|
51307
|
-
import * as
|
|
51325
|
+
import * as path14 from "path";
|
|
51308
51326
|
var execFileAsync5 = promisify7(execFile5);
|
|
51309
51327
|
var MAX_OUTPUT_BUFFER = 5 * 1024 * 1024;
|
|
51310
51328
|
async function writeTempPatch(patch, workDir) {
|
|
51311
|
-
const tempPath =
|
|
51329
|
+
const tempPath = path14.join(workDir, `.patch-${String(getTimeProvider().now())}.patch`);
|
|
51312
51330
|
await fs15.writeFile(tempPath, patch, "utf-8");
|
|
51313
51331
|
return tempPath;
|
|
51314
51332
|
}
|
|
@@ -51559,9 +51577,9 @@ var TestRunnerError = class extends Error {
|
|
|
51559
51577
|
|
|
51560
51578
|
// src/swe-bench/test-runner-parser.ts
|
|
51561
51579
|
import * as fs16 from "fs/promises";
|
|
51562
|
-
import * as
|
|
51580
|
+
import * as path15 from "path";
|
|
51563
51581
|
async function readJsonResults(workDir) {
|
|
51564
|
-
const jsonPath =
|
|
51582
|
+
const jsonPath = path15.join(workDir, "test-results.json");
|
|
51565
51583
|
try {
|
|
51566
51584
|
const content = await fs16.readFile(jsonPath, "utf-8");
|
|
51567
51585
|
return JSON.parse(content);
|
|
@@ -51756,7 +51774,7 @@ ${getStderr()}`.trim();
|
|
|
51756
51774
|
import { exec as exec3 } from "child_process";
|
|
51757
51775
|
import { promisify as promisify8 } from "util";
|
|
51758
51776
|
import * as fs17 from "fs/promises";
|
|
51759
|
-
import * as
|
|
51777
|
+
import * as path16 from "path";
|
|
51760
51778
|
var execAsync3 = promisify8(exec3);
|
|
51761
51779
|
var FRAMEWORK_CONFIG_FILES = {
|
|
51762
51780
|
pytest: ["pytest.ini", "pyproject.toml", "setup.cfg", "conftest.py", "tox.ini"],
|
|
@@ -51862,7 +51880,7 @@ var TestRunner = class {
|
|
|
51862
51880
|
async findConfigFiles(workDir, configFiles) {
|
|
51863
51881
|
const found = [];
|
|
51864
51882
|
for (const file of configFiles) {
|
|
51865
|
-
const filePath =
|
|
51883
|
+
const filePath = path16.join(workDir, file);
|
|
51866
51884
|
try {
|
|
51867
51885
|
await fs17.access(filePath);
|
|
51868
51886
|
found.push(file);
|
|
@@ -52015,7 +52033,7 @@ async function detectTestFramework(workDir) {
|
|
|
52015
52033
|
|
|
52016
52034
|
// src/swe-bench/report-generator.ts
|
|
52017
52035
|
import * as fs18 from "fs/promises";
|
|
52018
|
-
import * as
|
|
52036
|
+
import * as path17 from "path";
|
|
52019
52037
|
|
|
52020
52038
|
// src/swe-bench/report-renderer.ts
|
|
52021
52039
|
function renderReport(report, format) {
|
|
@@ -52371,7 +52389,7 @@ var ReportGenerator = class {
|
|
|
52371
52389
|
async save(report, config) {
|
|
52372
52390
|
this.logger.info("Saving report", { outputPath: config.outputPath });
|
|
52373
52391
|
const content = await this.render(report, config.format);
|
|
52374
|
-
await fs18.mkdir(
|
|
52392
|
+
await fs18.mkdir(path17.dirname(config.outputPath), { recursive: true });
|
|
52375
52393
|
await fs18.writeFile(config.outputPath, content, "utf-8");
|
|
52376
52394
|
this.logger.info("Report saved", { path: config.outputPath, format: config.format });
|
|
52377
52395
|
}
|
|
@@ -52591,14 +52609,14 @@ async function exportReport(result, outputPath, config) {
|
|
|
52591
52609
|
|
|
52592
52610
|
// src/swe-bench/trace-logger.ts
|
|
52593
52611
|
import { appendFile, writeFile as writeFile6 } from "fs/promises";
|
|
52594
|
-
import * as
|
|
52612
|
+
import * as path18 from "path";
|
|
52595
52613
|
function deriveTracePath(outputPath) {
|
|
52596
|
-
const ext =
|
|
52614
|
+
const ext = path18.extname(outputPath);
|
|
52597
52615
|
const base = outputPath.slice(0, outputPath.length - ext.length);
|
|
52598
52616
|
return `${base}-trace.jsonl`;
|
|
52599
52617
|
}
|
|
52600
52618
|
function deriveStatusPath(outputPath) {
|
|
52601
|
-
const ext =
|
|
52619
|
+
const ext = path18.extname(outputPath);
|
|
52602
52620
|
const base = outputPath.slice(0, outputPath.length - ext.length);
|
|
52603
52621
|
return `${base}-status.json`;
|
|
52604
52622
|
}
|
|
@@ -52804,7 +52822,7 @@ function getStdinLifecycleMonitor() {
|
|
|
52804
52822
|
|
|
52805
52823
|
// src/pipeline/task-tracker.ts
|
|
52806
52824
|
import * as fs19 from "fs";
|
|
52807
|
-
import * as
|
|
52825
|
+
import * as path19 from "path";
|
|
52808
52826
|
var logger55 = createLogger({ component: "task-tracker" });
|
|
52809
52827
|
async function exec4(cmd, args, timeout = 15e3) {
|
|
52810
52828
|
const { execFile: execFile6 } = await import("child_process");
|
|
@@ -52882,8 +52900,8 @@ var JsonTaskTracker = class {
|
|
|
52882
52900
|
outputPath;
|
|
52883
52901
|
constructor(config) {
|
|
52884
52902
|
const dir = config.outputDir ?? ".nexus-pipeline";
|
|
52885
|
-
this.outputPath =
|
|
52886
|
-
fs19.mkdirSync(
|
|
52903
|
+
this.outputPath = path19.resolve(dir, "tasks.json");
|
|
52904
|
+
fs19.mkdirSync(path19.dirname(this.outputPath), { recursive: true });
|
|
52887
52905
|
}
|
|
52888
52906
|
async createTask(title, body) {
|
|
52889
52907
|
const id = String(this.nextId++);
|
|
@@ -53643,4 +53661,4 @@ export {
|
|
|
53643
53661
|
detectBackend,
|
|
53644
53662
|
createTaskTracker
|
|
53645
53663
|
};
|
|
53646
|
-
//# sourceMappingURL=chunk-
|
|
53664
|
+
//# sourceMappingURL=chunk-5JSMLCCK.js.map
|