baro-ai 0.118.2 → 0.118.3
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/cli.mjs +294 -213
- package/dist/cli.mjs.map +1 -1
- package/dist/runner.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1133,8 +1133,8 @@ var require_common2 = __commonJS({
|
|
|
1133
1133
|
}
|
|
1134
1134
|
return debug;
|
|
1135
1135
|
}
|
|
1136
|
-
function extend(namespace,
|
|
1137
|
-
const newDebug = createDebug(this.namespace + (typeof
|
|
1136
|
+
function extend(namespace, delimiter3) {
|
|
1137
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace);
|
|
1138
1138
|
newDebug.log = this.log;
|
|
1139
1139
|
return newDebug;
|
|
1140
1140
|
}
|
|
@@ -22728,7 +22728,7 @@ var require_cross_spawn = __commonJS({
|
|
|
22728
22728
|
enoent.hookChildProcess(spawned, parsed);
|
|
22729
22729
|
return spawned;
|
|
22730
22730
|
}
|
|
22731
|
-
function
|
|
22731
|
+
function spawnSync2(command, args, options) {
|
|
22732
22732
|
const parsed = parse(command, args, options);
|
|
22733
22733
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
22734
22734
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
@@ -22736,7 +22736,7 @@ var require_cross_spawn = __commonJS({
|
|
|
22736
22736
|
}
|
|
22737
22737
|
module.exports = spawn7;
|
|
22738
22738
|
module.exports.spawn = spawn7;
|
|
22739
|
-
module.exports.sync =
|
|
22739
|
+
module.exports.sync = spawnSync2;
|
|
22740
22740
|
module.exports._parse = parse;
|
|
22741
22741
|
module.exports._enoent = enoent;
|
|
22742
22742
|
}
|
|
@@ -22744,8 +22744,8 @@ var require_cross_spawn = __commonJS({
|
|
|
22744
22744
|
|
|
22745
22745
|
// ../baro-memory/dist/vectra-store.js
|
|
22746
22746
|
import { LocalIndex } from "vectra";
|
|
22747
|
-
import { readFileSync as readFileSync15, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, existsSync as
|
|
22748
|
-
import { join as
|
|
22747
|
+
import { readFileSync as readFileSync15, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, existsSync as existsSync13, renameSync as renameSync5, rmSync as rmSync3, readdirSync as readdirSync6, statSync as statSync7, lstatSync as lstatSync4 } from "fs";
|
|
22748
|
+
import { join as join19 } from "path";
|
|
22749
22749
|
import { tmpdir as tmpdir5, homedir as homedir4 } from "os";
|
|
22750
22750
|
async function createMemoryStore(config2) {
|
|
22751
22751
|
const cfg = { ...DEFAULTS, ...config2 };
|
|
@@ -22758,23 +22758,23 @@ async function createMemoryStore(config2) {
|
|
|
22758
22758
|
if (cfg.disabled) {
|
|
22759
22759
|
return new NoOpMemoryStore();
|
|
22760
22760
|
}
|
|
22761
|
-
const sessionPath = cfg.sessionPath ||
|
|
22761
|
+
const sessionPath = cfg.sessionPath || join19(tmpdir5(), `baro-memory-${process.pid}-${Date.now()}`);
|
|
22762
22762
|
validateSessionPath(sessionPath);
|
|
22763
22763
|
mkdirSync7(sessionPath, { recursive: true });
|
|
22764
|
-
const indexPath =
|
|
22764
|
+
const indexPath = join19(sessionPath, "index");
|
|
22765
22765
|
mkdirSync7(indexPath, { recursive: true });
|
|
22766
22766
|
const index = new LocalIndex(indexPath);
|
|
22767
22767
|
if (!await index.isIndexCreated()) {
|
|
22768
22768
|
await index.createIndex({ version: 1 });
|
|
22769
22769
|
}
|
|
22770
22770
|
const transformers = await import("@xenova/transformers");
|
|
22771
|
-
transformers.env.cacheDir = process.env.TRANSFORMERS_CACHE ||
|
|
22771
|
+
transformers.env.cacheDir = process.env.TRANSFORMERS_CACHE || join19(homedir4(), ".baro", "models");
|
|
22772
22772
|
const { pipeline: pipeline2 } = transformers;
|
|
22773
22773
|
const extractor = await pipeline2("feature-extraction", cfg.embeddingModel);
|
|
22774
22774
|
return new VectraMemoryStore(index, extractor, sessionPath, cfg);
|
|
22775
22775
|
}
|
|
22776
22776
|
function validateSessionPath(sessionPath) {
|
|
22777
|
-
const resolved =
|
|
22777
|
+
const resolved = join19(sessionPath);
|
|
22778
22778
|
if (resolved.includes("..")) {
|
|
22779
22779
|
throw new Error(`Invalid session path (contains ..): ${resolved}`);
|
|
22780
22780
|
}
|
|
@@ -22792,13 +22792,13 @@ function validateSessionPath(sessionPath) {
|
|
|
22792
22792
|
}
|
|
22793
22793
|
function pruneOldSessions(sessionsDir) {
|
|
22794
22794
|
try {
|
|
22795
|
-
if (!
|
|
22795
|
+
if (!existsSync13(sessionsDir))
|
|
22796
22796
|
return;
|
|
22797
22797
|
const now = Date.now();
|
|
22798
22798
|
for (const entry of readdirSync6(sessionsDir)) {
|
|
22799
22799
|
if (!entry.startsWith("run-"))
|
|
22800
22800
|
continue;
|
|
22801
|
-
const entryPath =
|
|
22801
|
+
const entryPath = join19(sessionsDir, entry);
|
|
22802
22802
|
try {
|
|
22803
22803
|
const stat2 = lstatSync4(entryPath);
|
|
22804
22804
|
if (stat2.isSymbolicLink())
|
|
@@ -22855,10 +22855,10 @@ var init_vectra_store = __esm({
|
|
|
22855
22855
|
this.index = index;
|
|
22856
22856
|
this.extractor = extractor;
|
|
22857
22857
|
this.sessionPath = sessionPath;
|
|
22858
|
-
this.indexPath =
|
|
22859
|
-
this.indexFilePath =
|
|
22860
|
-
this.cachePath =
|
|
22861
|
-
this.lockPath =
|
|
22858
|
+
this.indexPath = join19(sessionPath, "index");
|
|
22859
|
+
this.indexFilePath = join19(this.indexPath, "index.json");
|
|
22860
|
+
this.cachePath = join19(sessionPath, "cache.json");
|
|
22861
|
+
this.lockPath = join19(sessionPath, "cache.lock");
|
|
22862
22862
|
this.config = config2;
|
|
22863
22863
|
}
|
|
22864
22864
|
/**
|
|
@@ -22870,9 +22870,9 @@ var init_vectra_store = __esm({
|
|
|
22870
22870
|
*/
|
|
22871
22871
|
refreshIndexIfChanged() {
|
|
22872
22872
|
try {
|
|
22873
|
-
if (!
|
|
22873
|
+
if (!existsSync13(this.indexFilePath))
|
|
22874
22874
|
return;
|
|
22875
|
-
const mtimeMs =
|
|
22875
|
+
const mtimeMs = statSync7(this.indexFilePath).mtimeMs;
|
|
22876
22876
|
if (mtimeMs === this.lastIndexMtimeMs)
|
|
22877
22877
|
return;
|
|
22878
22878
|
const newIndex = new LocalIndex(this.indexPath);
|
|
@@ -23084,7 +23084,7 @@ ${result.content}
|
|
|
23084
23084
|
*/
|
|
23085
23085
|
loadCache() {
|
|
23086
23086
|
try {
|
|
23087
|
-
if (
|
|
23087
|
+
if (existsSync13(this.cachePath)) {
|
|
23088
23088
|
const raw = readFileSync15(this.cachePath, "utf-8");
|
|
23089
23089
|
if (raw.trim()) {
|
|
23090
23090
|
return JSON.parse(raw);
|
|
@@ -23111,7 +23111,7 @@ ${result.content}
|
|
|
23111
23111
|
}
|
|
23112
23112
|
} finally {
|
|
23113
23113
|
try {
|
|
23114
|
-
if (
|
|
23114
|
+
if (existsSync13(this.lockPath))
|
|
23115
23115
|
rmSync3(this.lockPath);
|
|
23116
23116
|
} catch {
|
|
23117
23117
|
}
|
|
@@ -23170,13 +23170,13 @@ var init_dist2 = __esm({
|
|
|
23170
23170
|
});
|
|
23171
23171
|
|
|
23172
23172
|
// ../baro-orchestrator/scripts/cli.ts
|
|
23173
|
-
import { existsSync as
|
|
23173
|
+
import { existsSync as existsSync19, readFileSync as readFileSync20 } from "fs";
|
|
23174
23174
|
import { resolve as resolve16 } from "path";
|
|
23175
23175
|
|
|
23176
23176
|
// ../baro-orchestrator/src/orchestrate.ts
|
|
23177
|
-
import { existsSync as
|
|
23177
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync12, mkdtempSync as mkdtempSync2, rmSync as rmSync6 } from "fs";
|
|
23178
23178
|
import { homedir as homedir7, hostname, tmpdir as tmpdir10 } from "os";
|
|
23179
|
-
import { dirname as dirname10, join as
|
|
23179
|
+
import { dirname as dirname10, join as join28 } from "path";
|
|
23180
23180
|
import { fileURLToPath } from "url";
|
|
23181
23181
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
23182
23182
|
|
|
@@ -24436,10 +24436,10 @@ var SSEDecoder = class {
|
|
|
24436
24436
|
return null;
|
|
24437
24437
|
}
|
|
24438
24438
|
};
|
|
24439
|
-
function partition(str2,
|
|
24440
|
-
const index = str2.indexOf(
|
|
24439
|
+
function partition(str2, delimiter3) {
|
|
24440
|
+
const index = str2.indexOf(delimiter3);
|
|
24441
24441
|
if (index !== -1) {
|
|
24442
|
-
return [str2.substring(0, index),
|
|
24442
|
+
return [str2.substring(0, index), delimiter3, str2.substring(index + delimiter3.length)];
|
|
24443
24443
|
}
|
|
24444
24444
|
return [str2, "", ""];
|
|
24445
24445
|
}
|
|
@@ -33119,10 +33119,10 @@ var SSEDecoder2 = class {
|
|
|
33119
33119
|
return null;
|
|
33120
33120
|
}
|
|
33121
33121
|
};
|
|
33122
|
-
function partition2(str2,
|
|
33123
|
-
const index = str2.indexOf(
|
|
33122
|
+
function partition2(str2, delimiter3) {
|
|
33123
|
+
const index = str2.indexOf(delimiter3);
|
|
33124
33124
|
if (index !== -1) {
|
|
33125
|
-
return [str2.substring(0, index),
|
|
33125
|
+
return [str2.substring(0, index), delimiter3, str2.substring(index + delimiter3.length)];
|
|
33126
33126
|
}
|
|
33127
33127
|
return [str2, "", ""];
|
|
33128
33128
|
}
|
|
@@ -38700,10 +38700,10 @@ var SSEDecoder3 = class {
|
|
|
38700
38700
|
return null;
|
|
38701
38701
|
}
|
|
38702
38702
|
};
|
|
38703
|
-
function partition3(str2,
|
|
38704
|
-
const index = str2.indexOf(
|
|
38703
|
+
function partition3(str2, delimiter3) {
|
|
38704
|
+
const index = str2.indexOf(delimiter3);
|
|
38705
38705
|
if (index !== -1) {
|
|
38706
|
-
return [str2.substring(0, index),
|
|
38706
|
+
return [str2.substring(0, index), delimiter3, str2.substring(index + delimiter3.length)];
|
|
38707
38707
|
}
|
|
38708
38708
|
return [str2, "", ""];
|
|
38709
38709
|
}
|
|
@@ -44211,13 +44211,13 @@ function extractStderr(e2) {
|
|
|
44211
44211
|
|
|
44212
44212
|
// ../baro-orchestrator/src/integration/dependency-materializer.ts
|
|
44213
44213
|
import { createHash as createHash5 } from "crypto";
|
|
44214
|
-
import { existsSync as
|
|
44214
|
+
import { existsSync as existsSync8, readFileSync as readFileSync8, symlinkSync } from "fs";
|
|
44215
44215
|
import { homedir as homedir3 } from "os";
|
|
44216
|
-
import { join as
|
|
44216
|
+
import { join as join11, relative as relative5, resolve as resolve7 } from "path";
|
|
44217
44217
|
|
|
44218
44218
|
// ../baro-orchestrator/src/verification/verify.ts
|
|
44219
|
-
import { existsSync as
|
|
44220
|
-
import { isAbsolute as isAbsolute4, join as
|
|
44219
|
+
import { existsSync as existsSync7, lstatSync as lstatSync2, readdirSync as readdirSync3, readFileSync as readFileSync7, realpathSync as realpathSync5, statSync as statSync5 } from "fs";
|
|
44220
|
+
import { isAbsolute as isAbsolute4, join as join10, relative as relative4, resolve as resolve6, sep as sep3 } from "path";
|
|
44221
44221
|
|
|
44222
44222
|
// ../baro-orchestrator/src/harness/liveness.ts
|
|
44223
44223
|
function envSecs(name, fallbackSecs) {
|
|
@@ -44668,6 +44668,86 @@ function createCeilingResolver(root, repoRoot, floorMs) {
|
|
|
44668
44668
|
};
|
|
44669
44669
|
}
|
|
44670
44670
|
|
|
44671
|
+
// ../baro-orchestrator/src/verification/jvm-commands.ts
|
|
44672
|
+
import { spawnSync } from "child_process";
|
|
44673
|
+
import { accessSync, constants, existsSync as existsSync4, statSync as statSync2 } from "fs";
|
|
44674
|
+
import { delimiter, join as join7 } from "path";
|
|
44675
|
+
function detectJvmCommands(cwd, probe2 = {}) {
|
|
44676
|
+
const platform = probe2.platform ?? process.platform;
|
|
44677
|
+
const env = probe2.env ?? process.env;
|
|
44678
|
+
const windows = platform === "win32";
|
|
44679
|
+
const hasBuildFile = [...MAVEN_FILES, ...GRADLE_FILES].some(
|
|
44680
|
+
(name) => existsSync4(join7(cwd, name))
|
|
44681
|
+
);
|
|
44682
|
+
if (!hasBuildFile) return [];
|
|
44683
|
+
if (!(probe2.javaRuns ?? javaRuns)(env)) return [];
|
|
44684
|
+
const commands = [];
|
|
44685
|
+
if (MAVEN_FILES.some((name) => existsSync4(join7(cwd, name)))) {
|
|
44686
|
+
const tool = wrapperOrTool(cwd, windows ? "mvnw.cmd" : "mvnw", "mvn", env, windows);
|
|
44687
|
+
if (tool) {
|
|
44688
|
+
commands.push({ label: "mvn test", tool, args: ["-B", "test"] });
|
|
44689
|
+
}
|
|
44690
|
+
}
|
|
44691
|
+
if (GRADLE_FILES.some((name) => existsSync4(join7(cwd, name)))) {
|
|
44692
|
+
const tool = wrapperOrTool(cwd, windows ? "gradlew.bat" : "gradlew", "gradle", env, windows);
|
|
44693
|
+
if (tool) {
|
|
44694
|
+
commands.push({
|
|
44695
|
+
label: "gradle test",
|
|
44696
|
+
tool,
|
|
44697
|
+
args: ["test", "--console=plain"]
|
|
44698
|
+
});
|
|
44699
|
+
}
|
|
44700
|
+
}
|
|
44701
|
+
return commands;
|
|
44702
|
+
}
|
|
44703
|
+
var MAVEN_FILES = ["pom.xml"];
|
|
44704
|
+
var GRADLE_FILES = [
|
|
44705
|
+
"build.gradle",
|
|
44706
|
+
"build.gradle.kts",
|
|
44707
|
+
"settings.gradle",
|
|
44708
|
+
"settings.gradle.kts"
|
|
44709
|
+
];
|
|
44710
|
+
function javaRuns(env) {
|
|
44711
|
+
const java = env.JAVA_HOME ? join7(env.JAVA_HOME, "bin", "java") : "java";
|
|
44712
|
+
try {
|
|
44713
|
+
return spawnSync(java, ["-version"], {
|
|
44714
|
+
env,
|
|
44715
|
+
stdio: "ignore",
|
|
44716
|
+
timeout: 15e3
|
|
44717
|
+
}).status === 0;
|
|
44718
|
+
} catch {
|
|
44719
|
+
return false;
|
|
44720
|
+
}
|
|
44721
|
+
}
|
|
44722
|
+
function wrapperOrTool(cwd, wrapper, tool, env, windows) {
|
|
44723
|
+
if (isFile(join7(cwd, wrapper))) return windows ? `.\\${wrapper}` : `./${wrapper}`;
|
|
44724
|
+
return onPath(tool, env, windows) ? tool : null;
|
|
44725
|
+
}
|
|
44726
|
+
function onPath(tool, env, windows) {
|
|
44727
|
+
const dirs = (env.PATH ?? env.Path ?? "").split(windows ? ";" : delimiter);
|
|
44728
|
+
const names = windows ? [`${tool}.cmd`, `${tool}.bat`, `${tool}.exe`] : [tool];
|
|
44729
|
+
return dirs.some(
|
|
44730
|
+
(dir) => dir.length > 0 && names.some((name) => isExecutable(join7(dir, name), windows))
|
|
44731
|
+
);
|
|
44732
|
+
}
|
|
44733
|
+
function isFile(path7) {
|
|
44734
|
+
try {
|
|
44735
|
+
return statSync2(path7).isFile();
|
|
44736
|
+
} catch {
|
|
44737
|
+
return false;
|
|
44738
|
+
}
|
|
44739
|
+
}
|
|
44740
|
+
function isExecutable(path7, windows) {
|
|
44741
|
+
if (!isFile(path7)) return false;
|
|
44742
|
+
if (windows) return true;
|
|
44743
|
+
try {
|
|
44744
|
+
accessSync(path7, constants.X_OK);
|
|
44745
|
+
return true;
|
|
44746
|
+
} catch {
|
|
44747
|
+
return false;
|
|
44748
|
+
}
|
|
44749
|
+
}
|
|
44750
|
+
|
|
44671
44751
|
// ../baro-orchestrator/src/verification/declared-credit.ts
|
|
44672
44752
|
var MANAGER_SUITE = /^(?:npm|pnpm|yarn|corepack(?: yarn)?) run [A-Za-z0-9_.:-]+(?: \((.+)\))?$/;
|
|
44673
44753
|
var NODE_SCRIPT_SUITE = /^node --test \(.+\)$/;
|
|
@@ -44825,13 +44905,13 @@ function formatDeclaredBudgetEvidence(evidence) {
|
|
|
44825
44905
|
|
|
44826
44906
|
// ../baro-orchestrator/src/verification/declared-verification.ts
|
|
44827
44907
|
import {
|
|
44828
|
-
existsSync as
|
|
44908
|
+
existsSync as existsSync5,
|
|
44829
44909
|
readFileSync as readFileSync4,
|
|
44830
44910
|
realpathSync as realpathSync4,
|
|
44831
|
-
statSync as
|
|
44911
|
+
statSync as statSync3
|
|
44832
44912
|
} from "fs";
|
|
44833
44913
|
import { createHash as createHash4 } from "crypto";
|
|
44834
|
-
import { dirname as dirname5, isAbsolute as isAbsolute3, join as
|
|
44914
|
+
import { dirname as dirname5, isAbsolute as isAbsolute3, join as join8, relative as relative3, resolve as resolve5, sep as sep2 } from "path";
|
|
44835
44915
|
var MAX_COMMAND_LENGTH = 1e3;
|
|
44836
44916
|
var SAFE_SCRIPT_NAME = /^[A-Za-z0-9_.:-]+$/;
|
|
44837
44917
|
var TRUSTED_PACKAGE_SCRIPTS = /* @__PURE__ */ new Set(["build", "typecheck", "test", "lint"]);
|
|
@@ -44967,7 +45047,7 @@ function translateCdScoped(root, requirement, scoped, packageManagers) {
|
|
|
44967
45047
|
let isDirectory = false;
|
|
44968
45048
|
if (contained.path) {
|
|
44969
45049
|
try {
|
|
44970
|
-
isDirectory =
|
|
45050
|
+
isDirectory = statSync3(
|
|
44971
45051
|
realpathSync4(resolve5(root, contained.path))
|
|
44972
45052
|
).isDirectory();
|
|
44973
45053
|
} catch {
|
|
@@ -45108,8 +45188,8 @@ function translateNpxRstest(cwd, requirement, parsed, managers) {
|
|
|
45108
45188
|
"npx rstest focus paths contain an unsafe, non-path, or escaping value"
|
|
45109
45189
|
);
|
|
45110
45190
|
}
|
|
45111
|
-
const manifestPath =
|
|
45112
|
-
const manifest =
|
|
45191
|
+
const manifestPath = join8(cwd, "package.json");
|
|
45192
|
+
const manifest = existsSync5(manifestPath) ? readManifest(manifestPath) : null;
|
|
45113
45193
|
if (!manifest || !exactRstestScript(manifest.scripts?.test)) {
|
|
45114
45194
|
return incomplete(
|
|
45115
45195
|
requirement,
|
|
@@ -45132,8 +45212,8 @@ function translateNpxRstest(cwd, requirement, parsed, managers) {
|
|
|
45132
45212
|
};
|
|
45133
45213
|
}
|
|
45134
45214
|
function trustedScriptAlias(cwd, tokens2) {
|
|
45135
|
-
const manifestPath =
|
|
45136
|
-
if (!
|
|
45215
|
+
const manifestPath = join8(cwd, "package.json");
|
|
45216
|
+
if (!existsSync5(manifestPath)) return null;
|
|
45137
45217
|
const manifest = readManifest(manifestPath);
|
|
45138
45218
|
if (!manifest?.scripts) return null;
|
|
45139
45219
|
const normalized = tokens2.join(" ");
|
|
@@ -45195,7 +45275,7 @@ function extractWorkspaceSelector(rest) {
|
|
|
45195
45275
|
}
|
|
45196
45276
|
function resolveWorkspaceAuthority(cwd, name, managers) {
|
|
45197
45277
|
const declaredWorkspaces = readManifest(
|
|
45198
|
-
|
|
45278
|
+
join8(cwd, "package.json")
|
|
45199
45279
|
)?.workspaces;
|
|
45200
45280
|
const packages = declaredWorkspaces?.packages;
|
|
45201
45281
|
if (!Array.isArray(declaredWorkspaces) && !Array.isArray(packages)) {
|
|
@@ -45211,7 +45291,7 @@ function resolveWorkspaceAuthority(cwd, name, managers) {
|
|
|
45211
45291
|
);
|
|
45212
45292
|
if (byPath) return { authority: byPath };
|
|
45213
45293
|
const byName = candidates.find(
|
|
45214
|
-
(manager) => readManifest(
|
|
45294
|
+
(manager) => readManifest(join8(manager.cwd, "package.json"))?.name === name
|
|
45215
45295
|
);
|
|
45216
45296
|
if (byName) return { authority: byName };
|
|
45217
45297
|
const known = [...new Set(candidates.map(repoRelative))].sort();
|
|
@@ -45226,7 +45306,7 @@ function resolveScriptWorkspace(cwd, script, managers, changedFiles) {
|
|
|
45226
45306
|
})).sort((a, b) => a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0);
|
|
45227
45307
|
if (candidates.length === 0) return null;
|
|
45228
45308
|
const declaring = candidates.filter(
|
|
45229
|
-
(candidate) => typeof readManifest(
|
|
45309
|
+
(candidate) => typeof readManifest(join8(candidate.authority.cwd, "package.json"))?.scripts?.[script] === "string"
|
|
45230
45310
|
);
|
|
45231
45311
|
if (declaring.length === 1) return declaring[0];
|
|
45232
45312
|
if (declaring.length === 0) {
|
|
@@ -45306,8 +45386,8 @@ function translatePackage(cwd, requirement, parsed, managers) {
|
|
|
45306
45386
|
}
|
|
45307
45387
|
workspace = resolved.authority;
|
|
45308
45388
|
}
|
|
45309
|
-
const manifestPath =
|
|
45310
|
-
const manifest =
|
|
45389
|
+
const manifestPath = join8(workspace?.cwd ?? cwd, "package.json");
|
|
45390
|
+
const manifest = existsSync5(manifestPath) ? readManifest(manifestPath) : null;
|
|
45311
45391
|
if (!manifest) {
|
|
45312
45392
|
return incomplete(
|
|
45313
45393
|
requirement,
|
|
@@ -45380,7 +45460,7 @@ function escapesRoot(cwd, candidate) {
|
|
|
45380
45460
|
if (fromRoot === ".." || fromRoot.startsWith(`..${sep2}`) || isAbsolute3(fromRoot)) return true;
|
|
45381
45461
|
try {
|
|
45382
45462
|
let existingAncestor = absolute;
|
|
45383
|
-
while (!
|
|
45463
|
+
while (!existsSync5(existingAncestor)) {
|
|
45384
45464
|
const parent = dirname5(existingAncestor);
|
|
45385
45465
|
if (parent === existingAncestor) return true;
|
|
45386
45466
|
existingAncestor = parent;
|
|
@@ -45410,7 +45490,7 @@ function safeFocusedArg(cwd, value) {
|
|
|
45410
45490
|
)) return false;
|
|
45411
45491
|
const possiblePath = value.includes("=") ? value.slice(value.indexOf("=") + 1) : value;
|
|
45412
45492
|
if (URI_SCHEME.test(value) || URI_SCHEME.test(possiblePath) || isAbsolute3(possiblePath) || /^[A-Za-z]:\//.test(possiblePath) || possiblePath.startsWith("@") || possiblePath.includes("://") || hasParentTraversal(possiblePath)) return false;
|
|
45413
|
-
const pathLike = possiblePath.includes("/") || possiblePath.startsWith(".") ||
|
|
45493
|
+
const pathLike = possiblePath.includes("/") || possiblePath.startsWith(".") || existsSync5(resolve5(cwd, possiblePath));
|
|
45414
45494
|
return !(pathLike && escapesRoot(cwd, possiblePath));
|
|
45415
45495
|
}
|
|
45416
45496
|
function safeRstestFocusPath(cwd, value) {
|
|
@@ -45521,7 +45601,7 @@ function canonicalCargoArgs(tokens2) {
|
|
|
45521
45601
|
return canonical;
|
|
45522
45602
|
}
|
|
45523
45603
|
function translateCargo(cwd, requirement, parsed) {
|
|
45524
|
-
if (!
|
|
45604
|
+
if (!existsSync5(join8(cwd, "Cargo.toml"))) {
|
|
45525
45605
|
return incomplete(
|
|
45526
45606
|
requirement,
|
|
45527
45607
|
"declared cargo test requires Cargo.toml at the repository root"
|
|
@@ -45567,11 +45647,11 @@ function containedPath(cwd, candidate, requireFile) {
|
|
|
45567
45647
|
if (escapesRoot(cwd, candidate)) {
|
|
45568
45648
|
return { reason: `declared node path resolves outside repository: '${candidate}'` };
|
|
45569
45649
|
}
|
|
45570
|
-
if (!
|
|
45650
|
+
if (!existsSync5(absolute)) {
|
|
45571
45651
|
return { reason: `declared node path does not exist: '${candidate}'` };
|
|
45572
45652
|
}
|
|
45573
45653
|
try {
|
|
45574
|
-
if (requireFile && !
|
|
45654
|
+
if (requireFile && !statSync3(realpathSync4(absolute)).isFile()) {
|
|
45575
45655
|
return { reason: `node --check requires a file: '${candidate}'` };
|
|
45576
45656
|
}
|
|
45577
45657
|
} catch (error) {
|
|
@@ -45612,7 +45692,7 @@ function translateNode(cwd, requirement, parsed, manifestRoot = cwd) {
|
|
|
45612
45692
|
flagArgs.push(flag, inlineValue);
|
|
45613
45693
|
if (!token.includes("=")) index += 1;
|
|
45614
45694
|
}
|
|
45615
|
-
if (mode === void 0 && candidates.length === 1 && !
|
|
45695
|
+
if (mode === void 0 && candidates.length === 1 && !existsSync5(join8(cwd, "package.json")) && !existsSync5(join8(manifestRoot, "package.json"))) {
|
|
45616
45696
|
const contained = containedPath(cwd, candidates[0], true);
|
|
45617
45697
|
if (!contained.path) {
|
|
45618
45698
|
return incomplete(
|
|
@@ -45681,7 +45761,7 @@ function translateComposer(cwd, requirement, parsed) {
|
|
|
45681
45761
|
if (!SAFE_SCRIPT_NAME.test(script)) {
|
|
45682
45762
|
return incomplete(requirement, `unsafe composer script name '${script}'`);
|
|
45683
45763
|
}
|
|
45684
|
-
const manifest = readJsonObject(
|
|
45764
|
+
const manifest = readJsonObject(join8(cwd, "composer.json"));
|
|
45685
45765
|
if (!manifest) {
|
|
45686
45766
|
return incomplete(
|
|
45687
45767
|
requirement,
|
|
@@ -45719,7 +45799,7 @@ function translatePhpunit(cwd, requirement, parsed) {
|
|
|
45719
45799
|
const rest = parsed.tokens.slice(1);
|
|
45720
45800
|
const args = [];
|
|
45721
45801
|
const containedPaths = [
|
|
45722
|
-
{ path:
|
|
45802
|
+
{ path: join8(cwd, binary.path), requireFile: true }
|
|
45723
45803
|
];
|
|
45724
45804
|
for (let index = 0; index < rest.length; index += 1) {
|
|
45725
45805
|
const token = rest[index];
|
|
@@ -45752,7 +45832,7 @@ function translatePhpunit(cwd, requirement, parsed) {
|
|
|
45752
45832
|
}
|
|
45753
45833
|
args.push(token, contained.path);
|
|
45754
45834
|
containedPaths.push({
|
|
45755
|
-
path:
|
|
45835
|
+
path: join8(cwd, contained.path),
|
|
45756
45836
|
requireFile: true
|
|
45757
45837
|
});
|
|
45758
45838
|
index += 1;
|
|
@@ -45768,7 +45848,7 @@ function translatePhpunit(cwd, requirement, parsed) {
|
|
|
45768
45848
|
}
|
|
45769
45849
|
args.push(contained.path);
|
|
45770
45850
|
containedPaths.push({
|
|
45771
|
-
path:
|
|
45851
|
+
path: join8(cwd, contained.path),
|
|
45772
45852
|
requireFile: false
|
|
45773
45853
|
});
|
|
45774
45854
|
continue;
|
|
@@ -45780,7 +45860,7 @@ function translatePhpunit(cwd, requirement, parsed) {
|
|
|
45780
45860
|
}
|
|
45781
45861
|
return {
|
|
45782
45862
|
label: ["vendor/bin/phpunit", ...rest].join(" "),
|
|
45783
|
-
tool:
|
|
45863
|
+
tool: join8(cwd, binary.path),
|
|
45784
45864
|
args,
|
|
45785
45865
|
containedPaths
|
|
45786
45866
|
};
|
|
@@ -45798,7 +45878,7 @@ function translateDdev(cwd, requirement, parsed, packageManagers, insideDdev) {
|
|
|
45798
45878
|
if (parsed.tokens.length < 3) {
|
|
45799
45879
|
return incomplete(requirement, "ddev exec requires a command to run");
|
|
45800
45880
|
}
|
|
45801
|
-
if (!
|
|
45881
|
+
if (!existsSync5(join8(cwd, ".ddev", "config.yaml"))) {
|
|
45802
45882
|
return incomplete(
|
|
45803
45883
|
requirement,
|
|
45804
45884
|
"declared ddev test requires .ddev/config.yaml in the repository root"
|
|
@@ -45844,12 +45924,12 @@ function message(error) {
|
|
|
45844
45924
|
}
|
|
45845
45925
|
|
|
45846
45926
|
// ../baro-orchestrator/src/verification/node-test-script.ts
|
|
45847
|
-
import { existsSync as
|
|
45848
|
-
import { join as
|
|
45927
|
+
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
|
|
45928
|
+
import { join as join9 } from "path";
|
|
45849
45929
|
function defaultReadPackageJson(cwd) {
|
|
45850
45930
|
if (cwd === void 0) return null;
|
|
45851
|
-
const path7 =
|
|
45852
|
-
if (!
|
|
45931
|
+
const path7 = join9(cwd, "package.json");
|
|
45932
|
+
if (!existsSync6(path7)) return null;
|
|
45853
45933
|
try {
|
|
45854
45934
|
return JSON.parse(readFileSync5(path7, "utf8"));
|
|
45855
45935
|
} catch {
|
|
@@ -46017,7 +46097,7 @@ function coalesceNodeTestScripts(input, readPackageJson = defaultReadPackageJson
|
|
|
46017
46097
|
}
|
|
46018
46098
|
|
|
46019
46099
|
// ../baro-orchestrator/src/verification/failure-signals.ts
|
|
46020
|
-
import { readFileSync as readFileSync6, statSync as
|
|
46100
|
+
import { readFileSync as readFileSync6, statSync as statSync4 } from "fs";
|
|
46021
46101
|
var BUCKETS = /* @__PURE__ */ new Set([
|
|
46022
46102
|
"environment",
|
|
46023
46103
|
"time-ceiling",
|
|
@@ -46179,7 +46259,7 @@ function loadFailureSignals() {
|
|
|
46179
46259
|
const path7 = process.env.BARO_FAILURE_SIGNALS_FILE;
|
|
46180
46260
|
if (!path7) return FAILURE_SIGNALS;
|
|
46181
46261
|
try {
|
|
46182
|
-
const stat2 =
|
|
46262
|
+
const stat2 = statSync4(path7);
|
|
46183
46263
|
if (!stat2.isFile() || stat2.size > MAX_SIGNALS_FILE_BYTES) {
|
|
46184
46264
|
return FAILURE_SIGNALS;
|
|
46185
46265
|
}
|
|
@@ -46309,9 +46389,9 @@ function malformedDeclaredPackageManager(value) {
|
|
|
46309
46389
|
function detectPackageManager(cwd, manifest, hasPnpmWorkspace) {
|
|
46310
46390
|
const declared = declaredPackageManager(manifest?.packageManager);
|
|
46311
46391
|
if (declared) return declared.manager;
|
|
46312
|
-
if (
|
|
46313
|
-
if (
|
|
46314
|
-
if (
|
|
46392
|
+
if (existsSync7(join10(cwd, "pnpm-lock.yaml")) || hasPnpmWorkspace) return "pnpm";
|
|
46393
|
+
if (existsSync7(join10(cwd, "package-lock.json"))) return "npm";
|
|
46394
|
+
if (existsSync7(join10(cwd, "yarn.lock"))) return "yarn";
|
|
46315
46395
|
return "npm";
|
|
46316
46396
|
}
|
|
46317
46397
|
function packageManagerCommand(pm, declared, script, trailingArgs = []) {
|
|
@@ -46343,8 +46423,8 @@ function workspacePatterns(workspaces) {
|
|
|
46343
46423
|
return [];
|
|
46344
46424
|
}
|
|
46345
46425
|
function pnpmWorkspacePatterns(cwd) {
|
|
46346
|
-
const path7 =
|
|
46347
|
-
if (!
|
|
46426
|
+
const path7 = join10(cwd, "pnpm-workspace.yaml");
|
|
46427
|
+
if (!existsSync7(path7)) return [];
|
|
46348
46428
|
const patterns = [];
|
|
46349
46429
|
let inPackages = false;
|
|
46350
46430
|
for (const line of readFileSync7(path7, "utf8").split(/\r?\n/)) {
|
|
@@ -46367,20 +46447,20 @@ function workspacePackageDirs(cwd, workspaces) {
|
|
|
46367
46447
|
const addIfPackage = (candidate) => {
|
|
46368
46448
|
const absolute = resolve6(candidate);
|
|
46369
46449
|
const fromRoot = relative4(root, absolute);
|
|
46370
|
-
if (fromRoot === "" || fromRoot === ".." || fromRoot.startsWith(`..${sep3}`) || isAbsolute4(fromRoot) || !
|
|
46450
|
+
if (fromRoot === "" || fromRoot === ".." || fromRoot.startsWith(`..${sep3}`) || isAbsolute4(fromRoot) || !existsSync7(join10(absolute, "package.json"))) return;
|
|
46371
46451
|
dirs.add(absolute);
|
|
46372
46452
|
};
|
|
46373
46453
|
for (const rawPattern of workspacePatterns(workspaces)) {
|
|
46374
46454
|
const pattern = rawPattern.replace(/\\/g, "/").replace(/\/$/, "");
|
|
46375
46455
|
if (!pattern.includes("*")) {
|
|
46376
|
-
addIfPackage(
|
|
46456
|
+
addIfPackage(join10(root, pattern));
|
|
46377
46457
|
continue;
|
|
46378
46458
|
}
|
|
46379
46459
|
if (!pattern.endsWith("/*") || pattern.slice(0, -2).includes("*")) continue;
|
|
46380
|
-
const parent =
|
|
46381
|
-
if (!
|
|
46460
|
+
const parent = join10(root, pattern.slice(0, -2));
|
|
46461
|
+
if (!existsSync7(parent)) continue;
|
|
46382
46462
|
for (const entry of readdirSync3(parent, { withFileTypes: true })) {
|
|
46383
|
-
if (entry.isDirectory()) addIfPackage(
|
|
46463
|
+
if (entry.isDirectory()) addIfPackage(join10(parent, entry.name));
|
|
46384
46464
|
}
|
|
46385
46465
|
}
|
|
46386
46466
|
return [...dirs].sort();
|
|
@@ -46392,9 +46472,9 @@ function supportedWorkspacePattern(pattern) {
|
|
|
46392
46472
|
function detectCommands(cwd) {
|
|
46393
46473
|
const cmds = [];
|
|
46394
46474
|
const javascriptPackageManagers = [];
|
|
46395
|
-
const pkgPath =
|
|
46396
|
-
const hasPackageManifest =
|
|
46397
|
-
const hasPnpmWorkspace =
|
|
46475
|
+
const pkgPath = join10(cwd, "package.json");
|
|
46476
|
+
const hasPackageManifest = existsSync7(pkgPath);
|
|
46477
|
+
const hasPnpmWorkspace = existsSync7(join10(cwd, "pnpm-workspace.yaml"));
|
|
46398
46478
|
if (hasPackageManifest || hasPnpmWorkspace) {
|
|
46399
46479
|
const manifest = hasPackageManifest ? readPackageManifest(pkgPath) : null;
|
|
46400
46480
|
if (hasPackageManifest && !manifest) {
|
|
@@ -46452,7 +46532,7 @@ function detectCommands(cwd) {
|
|
|
46452
46532
|
);
|
|
46453
46533
|
const workspaces = workspaceDirs2.map((workspaceCwd) => ({
|
|
46454
46534
|
cwd: workspaceCwd,
|
|
46455
|
-
manifest: readPackageManifest(
|
|
46535
|
+
manifest: readPackageManifest(join10(workspaceCwd, "package.json"))
|
|
46456
46536
|
}));
|
|
46457
46537
|
if (!managerResolutionFailed) {
|
|
46458
46538
|
const managerSnapshot = {
|
|
@@ -46498,29 +46578,30 @@ function detectCommands(cwd) {
|
|
|
46498
46578
|
}
|
|
46499
46579
|
}
|
|
46500
46580
|
}
|
|
46501
|
-
if (
|
|
46581
|
+
if (existsSync7(join10(cwd, "Cargo.toml"))) {
|
|
46502
46582
|
cmds.push({ label: "cargo build", tool: "cargo", args: ["build"] });
|
|
46503
46583
|
cmds.push({ label: "cargo test", tool: "cargo", args: ["test"] });
|
|
46504
46584
|
}
|
|
46505
|
-
if (
|
|
46585
|
+
if (existsSync7(join10(cwd, "go.mod"))) {
|
|
46506
46586
|
cmds.push({ label: "go build ./...", tool: "go", args: ["build", "./..."] });
|
|
46507
46587
|
cmds.push({ label: "go test ./...", tool: "go", args: ["test", "./..."] });
|
|
46508
46588
|
}
|
|
46589
|
+
cmds.push(...detectJvmCommands(cwd));
|
|
46509
46590
|
return { commands: cmds, javascriptPackageManagers };
|
|
46510
46591
|
}
|
|
46511
46592
|
function staleDependencyReasons(cwd) {
|
|
46512
|
-
const pkgPath =
|
|
46513
|
-
if (!
|
|
46593
|
+
const pkgPath = join10(cwd, "package.json");
|
|
46594
|
+
if (!existsSync7(pkgPath)) return [];
|
|
46514
46595
|
const manifest = readPackageManifest(pkgPath);
|
|
46515
46596
|
if (!manifest) return [];
|
|
46516
46597
|
const reasons = [];
|
|
46517
|
-
const nodeModules =
|
|
46598
|
+
const nodeModules = join10(cwd, "node_modules");
|
|
46518
46599
|
const declaresDependencies = hasEntries(manifest.dependencies) || hasEntries(manifest.devDependencies);
|
|
46519
46600
|
const workspaceDirs2 = workspacePackageDirs(cwd, [
|
|
46520
46601
|
...workspacePatterns(manifest.workspaces),
|
|
46521
46602
|
...pnpmWorkspacePatterns(cwd)
|
|
46522
46603
|
]);
|
|
46523
|
-
if (!
|
|
46604
|
+
if (!existsSync7(nodeModules)) {
|
|
46524
46605
|
if (declaresDependencies || workspaceDirs2.length > 0) {
|
|
46525
46606
|
reasons.push("node_modules is missing");
|
|
46526
46607
|
}
|
|
@@ -46528,9 +46609,9 @@ function staleDependencyReasons(cwd) {
|
|
|
46528
46609
|
}
|
|
46529
46610
|
if (linkedOutOfTree(nodeModules, cwd)) return [];
|
|
46530
46611
|
for (const dir of workspaceDirs2) {
|
|
46531
|
-
const name = readPackageManifest(
|
|
46612
|
+
const name = readPackageManifest(join10(dir, "package.json"))?.name;
|
|
46532
46613
|
if (typeof name !== "string" || !name) continue;
|
|
46533
|
-
if (!
|
|
46614
|
+
if (!existsSync7(join10(nodeModules, name))) {
|
|
46534
46615
|
reasons.push(`workspace ${name} is not linked in node_modules`);
|
|
46535
46616
|
}
|
|
46536
46617
|
}
|
|
@@ -46538,12 +46619,12 @@ function staleDependencyReasons(cwd) {
|
|
|
46538
46619
|
"node_modules/.package-lock.json",
|
|
46539
46620
|
"node_modules/.modules.yaml",
|
|
46540
46621
|
"node_modules/.yarn-integrity"
|
|
46541
|
-
].map((relativePath) =>
|
|
46622
|
+
].map((relativePath) => join10(cwd, relativePath)).find((path7) => existsSync7(path7));
|
|
46542
46623
|
if (marker) {
|
|
46543
|
-
const installedAt =
|
|
46624
|
+
const installedAt = statSync5(marker).mtimeMs;
|
|
46544
46625
|
for (const file of ["package.json", "package-lock.json", "pnpm-lock.yaml", "yarn.lock"]) {
|
|
46545
|
-
const path7 =
|
|
46546
|
-
if (
|
|
46626
|
+
const path7 = join10(cwd, file);
|
|
46627
|
+
if (existsSync7(path7) && statSync5(path7).mtimeMs > installedAt + 1e3) {
|
|
46547
46628
|
reasons.push(`${file} changed after the last install`);
|
|
46548
46629
|
}
|
|
46549
46630
|
}
|
|
@@ -46563,9 +46644,9 @@ function hasEntries(value) {
|
|
|
46563
46644
|
return typeof value === "object" && value !== null && Object.keys(value).length > 0;
|
|
46564
46645
|
}
|
|
46565
46646
|
function dependencyRefreshCommand(cwd, reasons) {
|
|
46566
|
-
const manifest = readPackageManifest(
|
|
46647
|
+
const manifest = readPackageManifest(join10(cwd, "package.json"));
|
|
46567
46648
|
const declared = declaredPackageManager(manifest?.packageManager);
|
|
46568
|
-
const pm = detectPackageManager(cwd, manifest,
|
|
46649
|
+
const pm = detectPackageManager(cwd, manifest, existsSync7(join10(cwd, "pnpm-workspace.yaml")));
|
|
46569
46650
|
const yarnMajor = declared?.manager === "yarn" ? Number.parseInt(declared.version.match(/^\d+/)?.[0] ?? "", 10) : Number.NaN;
|
|
46570
46651
|
const command = pm === "yarn" && yarnMajor >= 2 ? { tool: "corepack", args: ["yarn", "install"] } : pm === "npm" ? { tool: "npm", args: ["install", "--no-audit", "--no-fund"] } : { tool: pm, args: ["install"] };
|
|
46571
46652
|
return {
|
|
@@ -46596,8 +46677,8 @@ function canonicalRstestFocus(command) {
|
|
|
46596
46677
|
if (paths.length === 0 || paths.some((value) => value.startsWith("-") || value.includes("=")) || command.containedPaths?.length !== paths.length || paths.some(
|
|
46597
46678
|
(value, index) => command.containedPaths?.[index]?.path !== value
|
|
46598
46679
|
)) return null;
|
|
46599
|
-
const
|
|
46600
|
-
const delimiterAt = command.label.indexOf(
|
|
46680
|
+
const delimiter3 = " -- ";
|
|
46681
|
+
const delimiterAt = command.label.indexOf(delimiter3);
|
|
46601
46682
|
if (delimiterAt < 0) return null;
|
|
46602
46683
|
const baseArgs = command.args.slice(
|
|
46603
46684
|
0,
|
|
@@ -46737,7 +46818,7 @@ function createVerifyPlan(cwd, options = {}) {
|
|
|
46737
46818
|
origin: "declared"
|
|
46738
46819
|
}))
|
|
46739
46820
|
],
|
|
46740
|
-
(commandCwd) => readPackageManifest(
|
|
46821
|
+
(commandCwd) => readPackageManifest(join10(commandCwd ?? cwd, "package.json"))
|
|
46741
46822
|
);
|
|
46742
46823
|
return freezeVerifyPlan(
|
|
46743
46824
|
boundedDeclaredCommands(
|
|
@@ -46979,7 +47060,7 @@ async function runCmd(cwd, c, hostRepoRoot, ceiling, signal, resolveRunCwd) {
|
|
|
46979
47060
|
};
|
|
46980
47061
|
}
|
|
46981
47062
|
const commandCwd = resolveCommandCwd(spawnRunCwd(cwd, hostRepoRoot, resolveRunCwd), c.cwd);
|
|
46982
|
-
if (!
|
|
47063
|
+
if (!existsSync7(commandCwd)) {
|
|
46983
47064
|
return {
|
|
46984
47065
|
status: "failed",
|
|
46985
47066
|
durationMs: 0,
|
|
@@ -47075,7 +47156,7 @@ async function applyRemedy(remedy, ctx) {
|
|
|
47075
47156
|
spawnRunCwd(ctx.cwd, ctx.hostRepoRoot, ctx.options.resolveRunCwd),
|
|
47076
47157
|
void 0
|
|
47077
47158
|
) : ctx.cwd;
|
|
47078
|
-
if (!
|
|
47159
|
+
if (!existsSync7(join10(cwd, "package.json"))) return;
|
|
47079
47160
|
const install2 = dependencyRefreshCommand(cwd, [`retry remedy: ${ctx.reason}`]);
|
|
47080
47161
|
await runCmd(
|
|
47081
47162
|
cwd,
|
|
@@ -47234,7 +47315,7 @@ function creditSkippedDeclaredRequirements(specs, results) {
|
|
|
47234
47315
|
// ../baro-orchestrator/src/integration/dependency-materializer.ts
|
|
47235
47316
|
var LOCKFILE_NAMES = ["package-lock.json", "npm-shrinkwrap.json"];
|
|
47236
47317
|
function npmCachePath(env = process.env) {
|
|
47237
|
-
return env.npm_config_cache ?? env.NPM_CONFIG_CACHE ??
|
|
47318
|
+
return env.npm_config_cache ?? env.NPM_CONFIG_CACHE ?? join11(homedir3(), ".npm");
|
|
47238
47319
|
}
|
|
47239
47320
|
async function materializeDependencies(options) {
|
|
47240
47321
|
const { hostRoot, integrationRoot } = options;
|
|
@@ -47254,7 +47335,7 @@ async function materializeDependencies(options) {
|
|
|
47254
47335
|
const workspaces = [];
|
|
47255
47336
|
let rootMatch = false;
|
|
47256
47337
|
for (const dir of [root, ...workspaceDirs(root)]) {
|
|
47257
|
-
const hostDir =
|
|
47338
|
+
const hostDir = join11(hostRoot, relative5(root, dir));
|
|
47258
47339
|
const match = lockfileMatch(dir, hostDir);
|
|
47259
47340
|
if (dir === root) rootMatch = match === true;
|
|
47260
47341
|
workspaces.push(await materializeWorkspace(dir, hostDir, match ?? rootMatch, runInstall));
|
|
@@ -47262,18 +47343,18 @@ async function materializeDependencies(options) {
|
|
|
47262
47343
|
return { workspaces };
|
|
47263
47344
|
}
|
|
47264
47345
|
async function materializeWorkspace(dir, hostDir, match, runInstall) {
|
|
47265
|
-
if (!
|
|
47346
|
+
if (!existsSync8(join11(dir, "package.json"))) {
|
|
47266
47347
|
return { dir, action: "skipped", reason: "no package.json" };
|
|
47267
47348
|
}
|
|
47268
|
-
const nodeModules =
|
|
47269
|
-
const hostNodeModules =
|
|
47270
|
-
if (match &&
|
|
47349
|
+
const nodeModules = join11(dir, "node_modules");
|
|
47350
|
+
const hostNodeModules = join11(hostDir, "node_modules");
|
|
47351
|
+
if (match && existsSync8(hostNodeModules) && !existsSync8(nodeModules)) {
|
|
47271
47352
|
const linked = linkNodeModules(hostNodeModules, nodeModules);
|
|
47272
47353
|
if (linked === "linked") return { dir, action: "linked", reason: "lockfile matches host" };
|
|
47273
47354
|
if (linked === "exists") return alreadyPresent(dir);
|
|
47274
47355
|
return install(dir, runInstall, "symlink unsupported");
|
|
47275
47356
|
}
|
|
47276
|
-
if (
|
|
47357
|
+
if (existsSync8(nodeModules)) return alreadyPresent(dir);
|
|
47277
47358
|
return install(dir, runInstall, match ? "host has no node_modules" : "lockfile differs from host");
|
|
47278
47359
|
}
|
|
47279
47360
|
function alreadyPresent(dir) {
|
|
@@ -47319,17 +47400,17 @@ function workspaceDirs(root) {
|
|
|
47319
47400
|
}
|
|
47320
47401
|
function readWorkspacesField(dir) {
|
|
47321
47402
|
try {
|
|
47322
|
-
const manifest = JSON.parse(readFileSync8(
|
|
47403
|
+
const manifest = JSON.parse(readFileSync8(join11(dir, "package.json"), "utf8"));
|
|
47323
47404
|
return manifest.workspaces;
|
|
47324
47405
|
} catch {
|
|
47325
47406
|
return void 0;
|
|
47326
47407
|
}
|
|
47327
47408
|
}
|
|
47328
47409
|
function lockfileMatch(dir, hostDir) {
|
|
47329
|
-
const name = LOCKFILE_NAMES.find((candidate) =>
|
|
47410
|
+
const name = LOCKFILE_NAMES.find((candidate) => existsSync8(join11(dir, candidate)));
|
|
47330
47411
|
if (!name) return null;
|
|
47331
|
-
const local = sha256(
|
|
47332
|
-
return local !== null && local === sha256(
|
|
47412
|
+
const local = sha256(join11(dir, name));
|
|
47413
|
+
return local !== null && local === sha256(join11(hostDir, name));
|
|
47333
47414
|
}
|
|
47334
47415
|
function sha256(path7) {
|
|
47335
47416
|
try {
|
|
@@ -47361,7 +47442,7 @@ function capRunDiff(diff) {
|
|
|
47361
47442
|
import { createHash as createHash6 } from "crypto";
|
|
47362
47443
|
import {
|
|
47363
47444
|
appendFileSync,
|
|
47364
|
-
existsSync as
|
|
47445
|
+
existsSync as existsSync9,
|
|
47365
47446
|
mkdirSync as mkdirSync3,
|
|
47366
47447
|
readFileSync as readFileSync9,
|
|
47367
47448
|
readdirSync as readdirSync4,
|
|
@@ -47370,7 +47451,7 @@ import {
|
|
|
47370
47451
|
symlinkSync as symlinkSync2
|
|
47371
47452
|
} from "fs";
|
|
47372
47453
|
import { tmpdir as tmpdir2 } from "os";
|
|
47373
|
-
import { join as
|
|
47454
|
+
import { join as join12, resolve as resolve8 } from "path";
|
|
47374
47455
|
var DEP_DIR_BY_MANIFEST = {
|
|
47375
47456
|
"package.json": "node_modules",
|
|
47376
47457
|
"pnpm-workspace.yaml": "node_modules",
|
|
@@ -47397,7 +47478,7 @@ var WorktreeManager = class {
|
|
|
47397
47478
|
this.repoRoot = repoRoot;
|
|
47398
47479
|
this.gate = gate;
|
|
47399
47480
|
this.runId = runId;
|
|
47400
|
-
this.baseDir =
|
|
47481
|
+
this.baseDir = join12(tmpdir2(), "baro-worktrees", runId);
|
|
47401
47482
|
this.linkDepDirs = opts.linkDepDirs ?? true;
|
|
47402
47483
|
this.allowSharedFallback = opts.allowSharedFallback ?? true;
|
|
47403
47484
|
this.resolveConflictsWithTheirs = opts.resolveConflictsWithTheirs ?? true;
|
|
@@ -47536,7 +47617,7 @@ var WorktreeManager = class {
|
|
|
47536
47617
|
if (name === INTEGRATION_WORKTREE_DIRNAME) {
|
|
47537
47618
|
throw new Error("story id collides with the integration worktree directory");
|
|
47538
47619
|
}
|
|
47539
|
-
return
|
|
47620
|
+
return join12(this.baseDir, name);
|
|
47540
47621
|
}
|
|
47541
47622
|
/** Seal the manager before factories drain. An already-running create
|
|
47542
47623
|
* remains serialized by GitGate; queued/future creates stop at the gate. */
|
|
@@ -47767,7 +47848,7 @@ var WorktreeManager = class {
|
|
|
47767
47848
|
try {
|
|
47768
47849
|
const path7 = this.paths.get(storyId);
|
|
47769
47850
|
const branch = this.branchOf(storyId);
|
|
47770
|
-
if (!path7 || !
|
|
47851
|
+
if (!path7 || !existsSync9(path7) || !this.preserved.has(storyId)) {
|
|
47771
47852
|
const recorded = await this.resolvedRecoveryRef(storyId);
|
|
47772
47853
|
if (recorded) {
|
|
47773
47854
|
this.log(
|
|
@@ -47790,7 +47871,7 @@ var WorktreeManager = class {
|
|
|
47790
47871
|
const backup = await this.createRecoveryBranch(storyId, branch);
|
|
47791
47872
|
this.recordRecoveryRef(storyId, backup);
|
|
47792
47873
|
await this.removeWorktreeQuiet(path7, "releasePreserved");
|
|
47793
|
-
if (
|
|
47874
|
+
if (existsSync9(path7)) {
|
|
47794
47875
|
throw new Error(`could not release preserved worktree for story ${storyId}`);
|
|
47795
47876
|
}
|
|
47796
47877
|
this.paths.delete(storyId);
|
|
@@ -47837,7 +47918,7 @@ var WorktreeManager = class {
|
|
|
47837
47918
|
try {
|
|
47838
47919
|
const path7 = this.paths.get(storyId);
|
|
47839
47920
|
const branch = this.branchOf(storyId);
|
|
47840
|
-
if (!path7 || !
|
|
47921
|
+
if (!path7 || !existsSync9(path7)) {
|
|
47841
47922
|
if (preserveForRecovery) {
|
|
47842
47923
|
let branchHead;
|
|
47843
47924
|
try {
|
|
@@ -48141,7 +48222,7 @@ var WorktreeManager = class {
|
|
|
48141
48222
|
);
|
|
48142
48223
|
continue;
|
|
48143
48224
|
}
|
|
48144
|
-
if (this.preserved.has(storyId) &&
|
|
48225
|
+
if (this.preserved.has(storyId) && existsSync9(path7)) {
|
|
48145
48226
|
let status = "";
|
|
48146
48227
|
try {
|
|
48147
48228
|
;
|
|
@@ -48273,7 +48354,7 @@ var WorktreeManager = class {
|
|
|
48273
48354
|
const scan = (rel, depth) => {
|
|
48274
48355
|
let entries;
|
|
48275
48356
|
try {
|
|
48276
|
-
entries = readdirSync4(
|
|
48357
|
+
entries = readdirSync4(join12(this.repoRoot, rel) || this.repoRoot, { withFileTypes: true });
|
|
48277
48358
|
} catch {
|
|
48278
48359
|
return;
|
|
48279
48360
|
}
|
|
@@ -48291,7 +48372,7 @@ var WorktreeManager = class {
|
|
|
48291
48372
|
if (depth <= 0) return;
|
|
48292
48373
|
for (const e2 of entries) {
|
|
48293
48374
|
if (e2.isDirectory() && !SCAN_SKIP.has(e2.name) && !e2.name.startsWith(".")) {
|
|
48294
|
-
scan(rel ?
|
|
48375
|
+
scan(rel ? join12(rel, e2.name) : e2.name, depth - 1);
|
|
48295
48376
|
}
|
|
48296
48377
|
}
|
|
48297
48378
|
};
|
|
@@ -48339,15 +48420,15 @@ ${missing.join("\n")}
|
|
|
48339
48420
|
}
|
|
48340
48421
|
symlinkDepDirs(worktreePath) {
|
|
48341
48422
|
for (const { rel, dir } of this.depLocations()) {
|
|
48342
|
-
const shared =
|
|
48343
|
-
const dest =
|
|
48344
|
-
if (
|
|
48423
|
+
const shared = join12(this.repoRoot, rel, dir);
|
|
48424
|
+
const dest = join12(worktreePath, rel, dir);
|
|
48425
|
+
if (existsSync9(dest)) continue;
|
|
48345
48426
|
try {
|
|
48346
|
-
if (!
|
|
48347
|
-
mkdirSync3(
|
|
48427
|
+
if (!existsSync9(shared)) mkdirSync3(shared, { recursive: true });
|
|
48428
|
+
mkdirSync3(join12(worktreePath, rel), { recursive: true });
|
|
48348
48429
|
symlinkSync2(shared, dest, "junction");
|
|
48349
48430
|
} catch (e2) {
|
|
48350
|
-
this.log(`could not symlink ${
|
|
48431
|
+
this.log(`could not symlink ${join12(rel, dir)} into worktree (${errMsg3(e2)})`);
|
|
48351
48432
|
}
|
|
48352
48433
|
}
|
|
48353
48434
|
}
|
|
@@ -48378,7 +48459,7 @@ ${missing.join("\n")}
|
|
|
48378
48459
|
);
|
|
48379
48460
|
return;
|
|
48380
48461
|
}
|
|
48381
|
-
const resetSpecs = this.depLocations().map(({ rel, dir }) =>
|
|
48462
|
+
const resetSpecs = this.depLocations().map(({ rel, dir }) => join12(rel, dir));
|
|
48382
48463
|
if (resetSpecs.length) await execQuiet("git", ["reset", "-q", "--", ...resetSpecs], worktreePath);
|
|
48383
48464
|
let staged = [];
|
|
48384
48465
|
let diffFailed = false;
|
|
@@ -48424,7 +48505,7 @@ ${missing.join("\n")}
|
|
|
48424
48505
|
async commitFailedWork(storyId, worktreePath) {
|
|
48425
48506
|
try {
|
|
48426
48507
|
await runRepositoryCommand("git", ["add", "-A"], { cwd: worktreePath });
|
|
48427
|
-
const resetSpecs = this.depLocations().map(({ rel, dir }) =>
|
|
48508
|
+
const resetSpecs = this.depLocations().map(({ rel, dir }) => join12(rel, dir));
|
|
48428
48509
|
if (resetSpecs.length > 0) {
|
|
48429
48510
|
await execQuiet(
|
|
48430
48511
|
"git",
|
|
@@ -48510,7 +48591,7 @@ ${missing.join("\n")}
|
|
|
48510
48591
|
async releaseLogicalStory(storyId, path7, branch) {
|
|
48511
48592
|
await this.secureRecoveryMaterial(storyId, "release_logical_story");
|
|
48512
48593
|
await this.removeWorktreeQuiet(path7, "releaseLogicalStory");
|
|
48513
|
-
if (
|
|
48594
|
+
if (existsSync9(path7)) {
|
|
48514
48595
|
throw new Error(`could not release worktree for story ${storyId}`);
|
|
48515
48596
|
}
|
|
48516
48597
|
this.paths.delete(storyId);
|
|
@@ -48559,7 +48640,7 @@ ${missing.join("\n")}
|
|
|
48559
48640
|
}
|
|
48560
48641
|
async removeWorktreeQuiet(path7, reason) {
|
|
48561
48642
|
await execQuiet("git", ["worktree", "remove", "--force", path7], this.repoRoot);
|
|
48562
|
-
if (
|
|
48643
|
+
if (existsSync9(path7)) {
|
|
48563
48644
|
this.log(`force-removed worktree ${path7} after git refused (${reason})`);
|
|
48564
48645
|
rmSyncQuiet(path7);
|
|
48565
48646
|
} else {
|
|
@@ -48588,9 +48669,9 @@ ${missing.join("\n")}
|
|
|
48588
48669
|
["branch", "--list", branch, "--format=%(refname:short)"],
|
|
48589
48670
|
{ cwd: this.repoRoot }
|
|
48590
48671
|
);
|
|
48591
|
-
if (
|
|
48672
|
+
if (existsSync9(path7) || remainingBranch.trim()) {
|
|
48592
48673
|
throw new Error(
|
|
48593
|
-
`residual setup state remains` + (
|
|
48674
|
+
`residual setup state remains` + (existsSync9(path7) ? ` at ${path7}` : "") + (remainingBranch.trim() ? ` on branch ${branch}` : "")
|
|
48594
48675
|
);
|
|
48595
48676
|
}
|
|
48596
48677
|
}
|
|
@@ -50338,7 +50419,7 @@ function formatRoute(route) {
|
|
|
50338
50419
|
|
|
50339
50420
|
// ../baro-orchestrator/src/execution/auditor.ts
|
|
50340
50421
|
import { createHmac, randomBytes as randomBytes2 } from "crypto";
|
|
50341
|
-
import { appendFileSync as appendFileSync2, chmodSync, existsSync as
|
|
50422
|
+
import { appendFileSync as appendFileSync2, chmodSync, existsSync as existsSync10, mkdirSync as mkdirSync4 } from "fs";
|
|
50342
50423
|
import { dirname as dirname6 } from "path";
|
|
50343
50424
|
|
|
50344
50425
|
// ../baro-orchestrator/src/events/define.ts
|
|
@@ -50596,7 +50677,7 @@ var Auditor = class extends BaseObserver {
|
|
|
50596
50677
|
this.filter = opts.filter;
|
|
50597
50678
|
try {
|
|
50598
50679
|
mkdirSync4(dirname6(this.path), { recursive: true });
|
|
50599
|
-
if (
|
|
50680
|
+
if (existsSync10(this.path)) chmodSync(this.path, 384);
|
|
50600
50681
|
} catch (e2) {
|
|
50601
50682
|
this.disable(`mkdir failed: ${e2?.message ?? String(e2)}`);
|
|
50602
50683
|
}
|
|
@@ -51556,7 +51637,7 @@ function correlationKey(correlation) {
|
|
|
51556
51637
|
// ../baro-orchestrator/src/execution/collaboration-bridge.ts
|
|
51557
51638
|
import {
|
|
51558
51639
|
appendFileSync as appendFileSync3,
|
|
51559
|
-
existsSync as
|
|
51640
|
+
existsSync as existsSync11,
|
|
51560
51641
|
mkdirSync as mkdirSync5,
|
|
51561
51642
|
lstatSync as lstatSync3,
|
|
51562
51643
|
readFileSync as readFileSync11,
|
|
@@ -51569,7 +51650,7 @@ import { randomBytes as randomBytes3, randomUUID as randomUUID3 } from "crypto";
|
|
|
51569
51650
|
import {
|
|
51570
51651
|
createServer
|
|
51571
51652
|
} from "http";
|
|
51572
|
-
import { basename as basename6, join as
|
|
51653
|
+
import { basename as basename6, join as join13 } from "path";
|
|
51573
51654
|
|
|
51574
51655
|
// ../baro-orchestrator/scripts/collaboration-inbox-path.mjs
|
|
51575
51656
|
var INBOX_NAME_PREFIX = "agent-";
|
|
@@ -53683,14 +53764,14 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
53683
53764
|
constructor(opts) {
|
|
53684
53765
|
super();
|
|
53685
53766
|
this.opts = opts;
|
|
53686
|
-
this.outboxDir =
|
|
53687
|
-
this.challengeInflightDir = opts.challengeInflightDir ??
|
|
53767
|
+
this.outboxDir = join13(opts.sessionDir, "outbox");
|
|
53768
|
+
this.challengeInflightDir = opts.challengeInflightDir ?? join13(opts.sessionDir, "challenge-inflight");
|
|
53688
53769
|
if (opts.goalInvariantIds && (opts.goalInvariantIds.some((id) => !validGoalInvariantId(id)) || new Set(opts.goalInvariantIds).size !== opts.goalInvariantIds.length)) {
|
|
53689
53770
|
throw new Error("collaboration bridge goal invariant ids are invalid");
|
|
53690
53771
|
}
|
|
53691
53772
|
this.allowedGoalInvariantIds = opts.goalInvariantIds ? new Set(opts.goalInvariantIds) : null;
|
|
53692
|
-
this.inboxDir =
|
|
53693
|
-
this.decisionsDir =
|
|
53773
|
+
this.inboxDir = join13(opts.sessionDir, "inbox");
|
|
53774
|
+
this.decisionsDir = join13(opts.sessionDir, "decisions");
|
|
53694
53775
|
mkdirSync5(this.challengeInflightDir, { recursive: true });
|
|
53695
53776
|
if (opts.unsafeAllowFilesystemTransport === true) {
|
|
53696
53777
|
mkdirSync5(this.outboxDir, { recursive: true });
|
|
@@ -54029,7 +54110,7 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54029
54110
|
}
|
|
54030
54111
|
this.publishAvailableInflightChallenges();
|
|
54031
54112
|
if (this.opts.unsafeAllowFilesystemTransport === true) {
|
|
54032
|
-
if (!
|
|
54113
|
+
if (!existsSync11(this.outboxDir)) {
|
|
54033
54114
|
this.stopPolling();
|
|
54034
54115
|
return;
|
|
54035
54116
|
}
|
|
@@ -54041,9 +54122,9 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54041
54122
|
});
|
|
54042
54123
|
}
|
|
54043
54124
|
consumeAvailableOutbox() {
|
|
54044
|
-
if (!
|
|
54125
|
+
if (!existsSync11(this.outboxDir)) return;
|
|
54045
54126
|
const files = readdirSync5(this.outboxDir).filter((name) => name.endsWith(".json")).sort();
|
|
54046
|
-
for (const name of files) this.consume(
|
|
54127
|
+
for (const name of files) this.consume(join13(this.outboxDir, name));
|
|
54047
54128
|
}
|
|
54048
54129
|
consume(path7) {
|
|
54049
54130
|
let removeOutboxRecord = true;
|
|
@@ -54146,7 +54227,7 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54146
54227
|
);
|
|
54147
54228
|
return { deliveryGaps };
|
|
54148
54229
|
}
|
|
54149
|
-
const inflightPath =
|
|
54230
|
+
const inflightPath = join13(
|
|
54150
54231
|
this.challengeInflightDir,
|
|
54151
54232
|
`${randomUUID3()}.json`
|
|
54152
54233
|
);
|
|
@@ -54192,12 +54273,12 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54192
54273
|
if (persisted) {
|
|
54193
54274
|
return sameChallenge2(candidate, persisted) ? "duplicate" : `challenge id ${candidate.challengeId} conflicts with persisted evidence`;
|
|
54194
54275
|
}
|
|
54195
|
-
if (
|
|
54276
|
+
if (existsSync11(this.challengeInflightDir)) {
|
|
54196
54277
|
for (const name of readdirSync5(this.challengeInflightDir)) {
|
|
54197
54278
|
if (!name.endsWith(".json")) continue;
|
|
54198
54279
|
try {
|
|
54199
54280
|
const retained = this.readInflightChallenge(
|
|
54200
|
-
|
|
54281
|
+
join13(this.challengeInflightDir, name)
|
|
54201
54282
|
);
|
|
54202
54283
|
if (retained.challengeId !== candidate.challengeId) continue;
|
|
54203
54284
|
return sameChallenge2(candidate, retained) ? "duplicate" : `challenge id ${candidate.challengeId} conflicts with retained evidence`;
|
|
@@ -54232,12 +54313,12 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54232
54313
|
}
|
|
54233
54314
|
}
|
|
54234
54315
|
publishAvailableInflightChallenges() {
|
|
54235
|
-
if (!
|
|
54316
|
+
if (!existsSync11(this.challengeInflightDir)) return;
|
|
54236
54317
|
const files = readdirSync5(this.challengeInflightDir).filter((name) => name.endsWith(".json")).sort();
|
|
54237
54318
|
for (const name of files) {
|
|
54238
54319
|
try {
|
|
54239
54320
|
this.publishInflightChallenge(
|
|
54240
|
-
|
|
54321
|
+
join13(this.challengeInflightDir, name),
|
|
54241
54322
|
false
|
|
54242
54323
|
);
|
|
54243
54324
|
} catch (error) {
|
|
@@ -54288,10 +54369,10 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54288
54369
|
...challenge.storyId ? { storyId: challenge.storyId } : {}
|
|
54289
54370
|
});
|
|
54290
54371
|
}
|
|
54291
|
-
if (!
|
|
54372
|
+
if (!existsSync11(this.challengeInflightDir)) return;
|
|
54292
54373
|
const files = readdirSync5(this.challengeInflightDir).filter((name) => name.endsWith(".json")).sort();
|
|
54293
54374
|
for (const name of files) {
|
|
54294
|
-
const path7 =
|
|
54375
|
+
const path7 = join13(this.challengeInflightDir, name);
|
|
54295
54376
|
try {
|
|
54296
54377
|
const retained = this.readInflightChallenge(path7);
|
|
54297
54378
|
const persisted = receipt.projection.challenges.some(
|
|
@@ -54506,13 +54587,13 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54506
54587
|
resetInbox(agentId) {
|
|
54507
54588
|
if (this.opts.unsafeAllowFilesystemTransport !== true) return;
|
|
54508
54589
|
try {
|
|
54509
|
-
unlinkSync3(
|
|
54590
|
+
unlinkSync3(join13(this.inboxDir, inboxFilenameForAgentId(agentId)));
|
|
54510
54591
|
} catch {
|
|
54511
54592
|
}
|
|
54512
54593
|
}
|
|
54513
54594
|
writeUnsafeInbox(agentId, value) {
|
|
54514
54595
|
appendFileSync3(
|
|
54515
|
-
|
|
54596
|
+
join13(this.inboxDir, inboxFilenameForAgentId(agentId)),
|
|
54516
54597
|
JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...asRecord(value) }) + "\n"
|
|
54517
54598
|
);
|
|
54518
54599
|
}
|
|
@@ -54647,9 +54728,9 @@ var CollaborationBridge = class extends SerializedObserver {
|
|
|
54647
54728
|
writeDecision(proposalId, decision) {
|
|
54648
54729
|
if (this.opts.unsafeAllowFilesystemTransport !== true) return;
|
|
54649
54730
|
const name = safeName(proposalId);
|
|
54650
|
-
const path7 =
|
|
54651
|
-
if (
|
|
54652
|
-
const pending =
|
|
54731
|
+
const path7 = join13(this.decisionsDir, `${name}.json`);
|
|
54732
|
+
if (existsSync11(path7)) return;
|
|
54733
|
+
const pending = join13(
|
|
54653
54734
|
this.decisionsDir,
|
|
54654
54735
|
`.${name}.${randomUUID3()}.tmp`
|
|
54655
54736
|
);
|
|
@@ -62178,8 +62259,8 @@ function projectionContentFingerprint(projection) {
|
|
|
62178
62259
|
}
|
|
62179
62260
|
|
|
62180
62261
|
// ../baro-orchestrator/src/execution/conductor.ts
|
|
62181
|
-
import { existsSync as
|
|
62182
|
-
import { join as
|
|
62262
|
+
import { existsSync as existsSync12, readFileSync as readFileSync12 } from "fs";
|
|
62263
|
+
import { join as join14 } from "path";
|
|
62183
62264
|
|
|
62184
62265
|
// ../baro-orchestrator/src/runtime-graph/legacy-replan.ts
|
|
62185
62266
|
function validateLegacyReplan(prd, value) {
|
|
@@ -63093,9 +63174,9 @@ ${prompt}`;
|
|
|
63093
63174
|
return true;
|
|
63094
63175
|
}
|
|
63095
63176
|
resolvePrompt(story) {
|
|
63096
|
-
const candidatePath = this.opts.promptTemplatePath ??
|
|
63177
|
+
const candidatePath = this.opts.promptTemplatePath ?? join14(this.opts.cwd, "prompt.md");
|
|
63097
63178
|
let prompt;
|
|
63098
|
-
if (
|
|
63179
|
+
if (existsSync12(candidatePath)) {
|
|
63099
63180
|
const tpl = readFileSyncSafe(candidatePath);
|
|
63100
63181
|
prompt = tpl ? applyTemplate(tpl, story) : buildDefaultStoryPrompt(story);
|
|
63101
63182
|
} else {
|
|
@@ -63209,9 +63290,9 @@ var ClaudeStreamResultCollector = class {
|
|
|
63209
63290
|
// ../baro-orchestrator/src/harness/critic-cli-isolation.ts
|
|
63210
63291
|
import { mkdtemp, rm } from "fs/promises";
|
|
63211
63292
|
import { tmpdir as tmpdir3 } from "os";
|
|
63212
|
-
import { join as
|
|
63293
|
+
import { join as join15 } from "path";
|
|
63213
63294
|
async function withIsolatedCriticCwd(run) {
|
|
63214
|
-
const cwd = await mkdtemp(
|
|
63295
|
+
const cwd = await mkdtemp(join15(tmpdir3(), "baro-critic-"));
|
|
63215
63296
|
try {
|
|
63216
63297
|
return await run(cwd);
|
|
63217
63298
|
} finally {
|
|
@@ -63334,7 +63415,7 @@ function extractVerdictJson(text2) {
|
|
|
63334
63415
|
|
|
63335
63416
|
// ../baro-orchestrator/src/acceptance/critic-evidence.ts
|
|
63336
63417
|
import { createHash as createHash16 } from "crypto";
|
|
63337
|
-
import { constants } from "fs";
|
|
63418
|
+
import { constants as constants2 } from "fs";
|
|
63338
63419
|
import { lstat as lstat2, open, readlink, realpath } from "fs/promises";
|
|
63339
63420
|
import { isAbsolute as isAbsolute6, relative as relative7, resolve as resolve10, sep as sep4 } from "path";
|
|
63340
63421
|
|
|
@@ -63957,8 +64038,8 @@ async function hashChangedPath(hash, cwd, path7, totalBytes) {
|
|
|
63957
64038
|
);
|
|
63958
64039
|
}
|
|
63959
64040
|
await assertCanonicalPathInside(cwd, absolute);
|
|
63960
|
-
const noFollow =
|
|
63961
|
-
const handle = await open(absolute,
|
|
64041
|
+
const noFollow = constants2.O_NOFOLLOW ?? 0;
|
|
64042
|
+
const handle = await open(absolute, constants2.O_RDONLY | noFollow);
|
|
63962
64043
|
try {
|
|
63963
64044
|
const opened = await handle.stat();
|
|
63964
64045
|
if (!opened.isFile()) {
|
|
@@ -67451,7 +67532,7 @@ function withTimeout(promise, ms, message3) {
|
|
|
67451
67532
|
// ../baro-orchestrator/src/harness/opencode/one-shot.ts
|
|
67452
67533
|
var import_cross_spawn4 = __toESM(require_cross_spawn(), 1);
|
|
67453
67534
|
import { writeFile } from "fs/promises";
|
|
67454
|
-
import { join as
|
|
67535
|
+
import { join as join16 } from "path";
|
|
67455
67536
|
async function runOpenCodeOneShot(opts) {
|
|
67456
67537
|
if (opts.signal?.aborted) throw abortError3();
|
|
67457
67538
|
const label = opts.label ?? "opencode";
|
|
@@ -67846,7 +67927,7 @@ async function installSafeEvaluatorAgent(cwd, systemPrompt) {
|
|
|
67846
67927
|
}
|
|
67847
67928
|
}
|
|
67848
67929
|
};
|
|
67849
|
-
const path7 =
|
|
67930
|
+
const path7 = join16(cwd, "opencode.json");
|
|
67850
67931
|
const content = `${JSON.stringify(config2)}
|
|
67851
67932
|
`;
|
|
67852
67933
|
await writeFile(
|
|
@@ -68506,7 +68587,7 @@ var CriticPi = class extends OneShotCritic {
|
|
|
68506
68587
|
};
|
|
68507
68588
|
|
|
68508
68589
|
// ../baro-orchestrator/src/conversation/session/conversation-context.ts
|
|
68509
|
-
import { readFileSync as readFileSync13, statSync as
|
|
68590
|
+
import { readFileSync as readFileSync13, statSync as statSync6 } from "fs";
|
|
68510
68591
|
var CONVERSATION_CONTEXT_SCHEMA_VERSION = 1;
|
|
68511
68592
|
var MAX_CONVERSATION_CONTEXT_BYTES = 128 * 1024;
|
|
68512
68593
|
var MAX_CONVERSATION_CONTEXT_HISTORY = 24;
|
|
@@ -68537,7 +68618,7 @@ function parseConversationContextSnapshot(raw) {
|
|
|
68537
68618
|
function loadConversationContextFile(path7) {
|
|
68538
68619
|
let metadata;
|
|
68539
68620
|
try {
|
|
68540
|
-
metadata =
|
|
68621
|
+
metadata = statSync6(path7);
|
|
68541
68622
|
} catch (error) {
|
|
68542
68623
|
throw new ConversationContextError(
|
|
68543
68624
|
`cannot inspect conversation context file: ${messageOf6(error)}`
|
|
@@ -69343,7 +69424,7 @@ import { spawn as spawnProcess } from "child_process";
|
|
|
69343
69424
|
import { createInterface as createInterface2 } from "readline";
|
|
69344
69425
|
import { mkdtemp as mkdtemp2, rm as rm2 } from "fs/promises";
|
|
69345
69426
|
import { tmpdir as tmpdir4 } from "os";
|
|
69346
|
-
import { join as
|
|
69427
|
+
import { join as join17 } from "path";
|
|
69347
69428
|
|
|
69348
69429
|
// ../baro-orchestrator/src/telemetry/claude-model-usage.ts
|
|
69349
69430
|
function primaryClaudeModel(modelUsage) {
|
|
@@ -70211,7 +70292,7 @@ function execClaude(binary, args, opts) {
|
|
|
70211
70292
|
}).then(({ stdout }) => stdout);
|
|
70212
70293
|
}
|
|
70213
70294
|
async function withIsolatedHarnessCwd(prefix, run) {
|
|
70214
|
-
const cwd = await mkdtemp2(
|
|
70295
|
+
const cwd = await mkdtemp2(join17(tmpdir4(), prefix));
|
|
70215
70296
|
try {
|
|
70216
70297
|
return await run(cwd);
|
|
70217
70298
|
} finally {
|
|
@@ -70244,7 +70325,7 @@ function providerCallSignal(callerSignal, timeoutMs) {
|
|
|
70244
70325
|
|
|
70245
70326
|
// ../baro-orchestrator/src/integration/finalizer.ts
|
|
70246
70327
|
import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
70247
|
-
import { join as
|
|
70328
|
+
import { join as join18 } from "path";
|
|
70248
70329
|
|
|
70249
70330
|
// ../baro-orchestrator/src/verification/prd-declared-tests.ts
|
|
70250
70331
|
import { readFileSync as readFileSync14 } from "fs";
|
|
@@ -70750,14 +70831,14 @@ var Finalizer = class extends BaseObserver {
|
|
|
70750
70831
|
const runtimeAmendments = renderRuntimeAmendments(prd);
|
|
70751
70832
|
if (adrs.length === 0 && !runtimeAmendments) return;
|
|
70752
70833
|
try {
|
|
70753
|
-
const dir =
|
|
70834
|
+
const dir = join18(this.opts.integrationRoot, "adr");
|
|
70754
70835
|
mkdirSync6(dir, { recursive: true });
|
|
70755
70836
|
const generatedPaths = [];
|
|
70756
70837
|
for (const a of adrs) {
|
|
70757
70838
|
const num = a.num.padStart(4, "0");
|
|
70758
70839
|
const fileName = `${num}-${slugify(a.title)}.md`;
|
|
70759
70840
|
writeFileSync5(
|
|
70760
|
-
|
|
70841
|
+
join18(dir, fileName),
|
|
70761
70842
|
`# ADR-${num}: ${a.title}
|
|
70762
70843
|
|
|
70763
70844
|
${a.body}
|
|
@@ -70767,7 +70848,7 @@ ${a.body}
|
|
|
70767
70848
|
}
|
|
70768
70849
|
if (runtimeAmendments) {
|
|
70769
70850
|
writeFileSync5(
|
|
70770
|
-
|
|
70851
|
+
join18(dir, "runtime-amendments.md"),
|
|
70771
70852
|
runtimeAmendments
|
|
70772
70853
|
);
|
|
70773
70854
|
generatedPaths.push("adr/runtime-amendments.md");
|
|
@@ -71666,7 +71747,7 @@ import { createHash as createHash19 } from "crypto";
|
|
|
71666
71747
|
|
|
71667
71748
|
// ../baro-orchestrator/src/goal/goal-invariant-review-evidence.ts
|
|
71668
71749
|
import { createHash as createHash18 } from "crypto";
|
|
71669
|
-
import { constants as
|
|
71750
|
+
import { constants as constants3 } from "fs";
|
|
71670
71751
|
import { lstat as lstat3, open as open2, readlink as readlink2, realpath as realpath2 } from "fs/promises";
|
|
71671
71752
|
import { isAbsolute as isAbsolute7, relative as relative8, resolve as resolve11, sep as sep5 } from "path";
|
|
71672
71753
|
var GIT_TIMEOUT_MS = 1e4;
|
|
@@ -71985,9 +72066,9 @@ async function captureUntrackedFiles(cwd, value, deadline) {
|
|
|
71985
72066
|
throw new Error("untracked file contents exceed the lossless total budget");
|
|
71986
72067
|
}
|
|
71987
72068
|
await assertCanonicalPathInside2(cwd, absolute, deadline);
|
|
71988
|
-
const noFollow =
|
|
72069
|
+
const noFollow = constants3.O_NOFOLLOW ?? 0;
|
|
71989
72070
|
const handle = await deadlineOperation(
|
|
71990
|
-
open2(absolute,
|
|
72071
|
+
open2(absolute, constants3.O_RDONLY | noFollow),
|
|
71991
72072
|
deadline,
|
|
71992
72073
|
async (opened) => {
|
|
71993
72074
|
await opened.close();
|
|
@@ -76077,10 +76158,10 @@ var LocalRepositoryAgent = class extends BaseObserver {
|
|
|
76077
76158
|
// ../baro-orchestrator/src/execution/memory-librarian.ts
|
|
76078
76159
|
import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync8 } from "fs";
|
|
76079
76160
|
import { homedir as homedir5 } from "os";
|
|
76080
|
-
import { join as
|
|
76161
|
+
import { join as join20 } from "path";
|
|
76081
76162
|
var DEBUG = process.env.BARO_DEBUG?.includes("memory") ?? false;
|
|
76082
|
-
var LOG_DIR =
|
|
76083
|
-
var LOG_FILE =
|
|
76163
|
+
var LOG_DIR = join20(homedir5(), ".baro", "runs");
|
|
76164
|
+
var LOG_FILE = join20(LOG_DIR, `memory-${Date.now()}.log`);
|
|
76084
76165
|
try {
|
|
76085
76166
|
mkdirSync8(LOG_DIR, { recursive: true });
|
|
76086
76167
|
} catch {
|
|
@@ -76962,7 +77043,7 @@ var PlanningFeed = class extends BaseObserver {
|
|
|
76962
77043
|
};
|
|
76963
77044
|
|
|
76964
77045
|
// ../baro-orchestrator/src/execution/prd-status-writer.ts
|
|
76965
|
-
import { existsSync as
|
|
77046
|
+
import { existsSync as existsSync14 } from "fs";
|
|
76966
77047
|
function createPrdStatusWriter({
|
|
76967
77048
|
prdPath,
|
|
76968
77049
|
load = loadPrd,
|
|
@@ -76972,7 +77053,7 @@ function createPrdStatusWriter({
|
|
|
76972
77053
|
const warnedUnknown = /* @__PURE__ */ new Set();
|
|
76973
77054
|
const warnedWriteFailure = /* @__PURE__ */ new Set();
|
|
76974
77055
|
const apply = (storyId, mutate) => {
|
|
76975
|
-
if (!
|
|
77056
|
+
if (!existsSync14(prdPath)) return;
|
|
76976
77057
|
try {
|
|
76977
77058
|
const prd = load(prdPath);
|
|
76978
77059
|
if (!prd.userStories.some((story) => story.id === storyId)) {
|
|
@@ -77865,14 +77946,14 @@ import * as path5 from "path";
|
|
|
77865
77946
|
|
|
77866
77947
|
// ../baro-orchestrator/src/execution/publish-guard.ts
|
|
77867
77948
|
import {
|
|
77868
|
-
accessSync,
|
|
77869
|
-
constants as
|
|
77949
|
+
accessSync as accessSync2,
|
|
77950
|
+
constants as constants4,
|
|
77870
77951
|
mkdirSync as mkdirSync9,
|
|
77871
77952
|
readFileSync as readFileSync16,
|
|
77872
77953
|
rmSync as rmSync4,
|
|
77873
77954
|
writeFileSync as writeFileSync7
|
|
77874
77955
|
} from "fs";
|
|
77875
|
-
import { delimiter, join as
|
|
77956
|
+
import { delimiter as delimiter2, join as join21, resolve as resolve12 } from "path";
|
|
77876
77957
|
function publishCommandRefusal(command) {
|
|
77877
77958
|
const segments = String(command).split(/&&|\|\||[;|\n]/u).map((segment) => segment.trim()).filter((segment) => segment.length > 0);
|
|
77878
77959
|
for (const segment of segments) {
|
|
@@ -77906,11 +77987,11 @@ function shQuote(value) {
|
|
|
77906
77987
|
return `'${value.replace(/'/gu, `'\\''`)}'`;
|
|
77907
77988
|
}
|
|
77908
77989
|
function findExecutable(name, pathValue, exclude) {
|
|
77909
|
-
for (const dir of pathValue.split(
|
|
77990
|
+
for (const dir of pathValue.split(delimiter2)) {
|
|
77910
77991
|
if (!dir || resolve12(dir) === resolve12(exclude)) continue;
|
|
77911
|
-
const candidate =
|
|
77992
|
+
const candidate = join21(dir, name);
|
|
77912
77993
|
try {
|
|
77913
|
-
|
|
77994
|
+
accessSync2(candidate, constants4.X_OK);
|
|
77914
77995
|
return candidate;
|
|
77915
77996
|
} catch {
|
|
77916
77997
|
}
|
|
@@ -77920,7 +78001,7 @@ function findExecutable(name, pathValue, exclude) {
|
|
|
77920
78001
|
function materializePublishGuardBin(dir, pathValue = process.env.PATH ?? "") {
|
|
77921
78002
|
mkdirSync9(dir, { recursive: true });
|
|
77922
78003
|
const realGit = findExecutable("git", pathValue, dir) ?? "/usr/bin/git";
|
|
77923
|
-
const refusalsPath = shQuote(
|
|
78004
|
+
const refusalsPath = shQuote(join21(dir, GUARD_REFUSALS_FILE));
|
|
77924
78005
|
const refuse = [
|
|
77925
78006
|
`esc=$(printf '%s' "$cmd" | sed 's/\\\\/\\\\\\\\/g; s/"/\\\\"/g' | tr '\\n\\t\\r' ' ')`,
|
|
77926
78007
|
`printf '{"command":"%s"}\\n' "$esc" >> ${refusalsPath}`,
|
|
@@ -77928,7 +78009,7 @@ function materializePublishGuardBin(dir, pathValue = process.env.PATH ?? "") {
|
|
|
77928
78009
|
`exit 1`
|
|
77929
78010
|
].join("\n");
|
|
77930
78011
|
writeFileSync7(
|
|
77931
|
-
|
|
78012
|
+
join21(dir, "gh"),
|
|
77932
78013
|
`#!/bin/sh
|
|
77933
78014
|
cmd="gh $*"
|
|
77934
78015
|
${refuse}
|
|
@@ -77936,7 +78017,7 @@ ${refuse}
|
|
|
77936
78017
|
{ mode: 493 }
|
|
77937
78018
|
);
|
|
77938
78019
|
writeFileSync7(
|
|
77939
|
-
|
|
78020
|
+
join21(dir, "git"),
|
|
77940
78021
|
[
|
|
77941
78022
|
"#!/bin/sh",
|
|
77942
78023
|
'sub=""',
|
|
@@ -77960,7 +78041,7 @@ ${refuse}
|
|
|
77960
78041
|
);
|
|
77961
78042
|
}
|
|
77962
78043
|
function drainGuardRefusals(dir) {
|
|
77963
|
-
const file =
|
|
78044
|
+
const file = join21(dir, GUARD_REFUSALS_FILE);
|
|
77964
78045
|
let text2;
|
|
77965
78046
|
try {
|
|
77966
78047
|
text2 = readFileSync16(file, "utf8");
|
|
@@ -82750,7 +82831,7 @@ var CodexCliParticipant = class _CodexCliParticipant extends CliParticipant {
|
|
|
82750
82831
|
|
|
82751
82832
|
// ../baro-orchestrator/src/harness/one-shot/story-agent.ts
|
|
82752
82833
|
import { tmpdir as tmpdir7 } from "os";
|
|
82753
|
-
import { join as
|
|
82834
|
+
import { join as join24 } from "path";
|
|
82754
82835
|
import { setTimeout as setTimeoutPromise } from "timers/promises";
|
|
82755
82836
|
|
|
82756
82837
|
// ../baro-orchestrator/src/harness/activity-monitor.ts
|
|
@@ -83772,7 +83853,7 @@ var OneShotStoryAgent = class extends BaseObserver {
|
|
|
83772
83853
|
const originalPath = process.env.PATH;
|
|
83773
83854
|
try {
|
|
83774
83855
|
if (!this.publishGuardDir) {
|
|
83775
|
-
const dir =
|
|
83856
|
+
const dir = join24(
|
|
83776
83857
|
tmpdir7(),
|
|
83777
83858
|
`baro-publish-guard-${this.spec.id}-${process.pid}`
|
|
83778
83859
|
);
|
|
@@ -85966,12 +86047,12 @@ var PiStoryAgent = class extends OneShotStoryAgent {
|
|
|
85966
86047
|
|
|
85967
86048
|
// ../baro-orchestrator/src/harness/claude/story-agent.ts
|
|
85968
86049
|
import { tmpdir as tmpdir8 } from "os";
|
|
85969
|
-
import { dirname as dirname9, join as
|
|
86050
|
+
import { dirname as dirname9, join as join26 } from "path";
|
|
85970
86051
|
import { setTimeout as setTimeoutPromise2 } from "timers/promises";
|
|
85971
86052
|
|
|
85972
86053
|
// ../baro-orchestrator/src/harness/claude/hook-bridge.ts
|
|
85973
86054
|
import { mkdirSync as mkdirSync11, writeFileSync as writeFileSync9 } from "fs";
|
|
85974
|
-
import { join as
|
|
86055
|
+
import { join as join25 } from "path";
|
|
85975
86056
|
var HOOK_SCRIPT = `#!/usr/bin/env node
|
|
85976
86057
|
// Materialized by baro (hook-bridge.ts). A hook must never break the agent:
|
|
85977
86058
|
// every path ends in exit 0, and a malformed input is treated as no input.
|
|
@@ -86116,7 +86197,7 @@ function materializeStoryHooks(dir, surface, collab, worktreeRoot) {
|
|
|
86116
86197
|
if (!surface || surface.writes.length === 0) return null;
|
|
86117
86198
|
mkdirSync11(dir, { recursive: true });
|
|
86118
86199
|
writeFileSync9(
|
|
86119
|
-
|
|
86200
|
+
join25(dir, "surface.json"),
|
|
86120
86201
|
JSON.stringify(
|
|
86121
86202
|
{
|
|
86122
86203
|
writes: surface.writes,
|
|
@@ -86142,10 +86223,10 @@ function materializePublishGuardHooks(dir, worktreeRoot) {
|
|
|
86142
86223
|
);
|
|
86143
86224
|
}
|
|
86144
86225
|
function writeHookSettings(dir, guardWrites, containment) {
|
|
86145
|
-
const hookPath =
|
|
86226
|
+
const hookPath = join25(dir, "hook.mjs");
|
|
86146
86227
|
writeFileSync9(hookPath, HOOK_SCRIPT, { mode: 493 });
|
|
86147
86228
|
writeFileSync9(
|
|
86148
|
-
|
|
86229
|
+
join25(dir, "containment.json"),
|
|
86149
86230
|
JSON.stringify(
|
|
86150
86231
|
{
|
|
86151
86232
|
worktreeRoot: containment.worktreeRoot ?? null,
|
|
@@ -86157,7 +86238,7 @@ function writeHookSettings(dir, guardWrites, containment) {
|
|
|
86157
86238
|
2
|
|
86158
86239
|
)
|
|
86159
86240
|
);
|
|
86160
|
-
const settingsPath =
|
|
86241
|
+
const settingsPath = join25(dir, "settings.json");
|
|
86161
86242
|
const hook = (mode) => ({
|
|
86162
86243
|
hooks: [
|
|
86163
86244
|
{
|
|
@@ -86470,7 +86551,7 @@ var StoryAgent = class extends BaseObserver {
|
|
|
86470
86551
|
this.transition("running", `attempt ${attempt}`);
|
|
86471
86552
|
this.currentProviderCapacitySignal = void 0;
|
|
86472
86553
|
this.settingsPath ??= this.spec.cliSettingsPath ?? materializePublishGuardHooks(
|
|
86473
|
-
|
|
86554
|
+
join26(tmpdir8(), `baro-hooks-${this.spec.id}-${process.pid}`)
|
|
86474
86555
|
);
|
|
86475
86556
|
const claude = new ClaudeCliParticipant(this.spec.id, {
|
|
86476
86557
|
cwd: this.spec.cwd,
|
|
@@ -86742,7 +86823,7 @@ function failureSummary2(failure) {
|
|
|
86742
86823
|
|
|
86743
86824
|
// ../baro-orchestrator/src/execution/story-executor.ts
|
|
86744
86825
|
import { tmpdir as tmpdir9 } from "os";
|
|
86745
|
-
import { join as
|
|
86826
|
+
import { join as join27 } from "path";
|
|
86746
86827
|
var LocalStoryExecutor = class {
|
|
86747
86828
|
supportsCooperativeSuspend(route) {
|
|
86748
86829
|
return laneQuiescenceWitness(route.backend) === "self" ? true : PROCESS_TREE_CAPABILITIES.cooperativeQuiescenceObservation;
|
|
@@ -86837,7 +86918,7 @@ var LocalStoryExecutor = class {
|
|
|
86837
86918
|
cwd,
|
|
86838
86919
|
...(() => {
|
|
86839
86920
|
const settings = materializeStoryHooks(
|
|
86840
|
-
|
|
86921
|
+
join27(
|
|
86841
86922
|
tmpdir9(),
|
|
86842
86923
|
`baro-hooks-${req.storyId}-${process.pid}`
|
|
86843
86924
|
),
|
|
@@ -91047,8 +91128,8 @@ async function orchestrate(config2) {
|
|
|
91047
91128
|
const useLibrarian = config2.withLibrarian ?? true;
|
|
91048
91129
|
const useSentry = config2.withSentry ?? true;
|
|
91049
91130
|
const useMemory = config2.withMemory ?? true;
|
|
91050
|
-
const sessionsDir =
|
|
91051
|
-
const memorySessionPath = useMemory && coordinationMode === "legacy" ?
|
|
91131
|
+
const sessionsDir = join28(homedir7(), ".baro", "sessions");
|
|
91132
|
+
const memorySessionPath = useMemory && coordinationMode === "legacy" ? join28(sessionsDir, runId, "memory") : void 0;
|
|
91052
91133
|
if (useMemory) {
|
|
91053
91134
|
try {
|
|
91054
91135
|
const { pruneOldSessions: pruneOldSessions2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
|
|
@@ -91073,15 +91154,15 @@ async function orchestrate(config2) {
|
|
|
91073
91154
|
new URL("../scripts/agent-collab.mjs", import.meta.url)
|
|
91074
91155
|
);
|
|
91075
91156
|
const collaborationEpoch = randomUUID8();
|
|
91076
|
-
const collectiveSessionRoot =
|
|
91157
|
+
const collectiveSessionRoot = join28(sessionsDir, runId, "collective");
|
|
91077
91158
|
const collaborationGoalInvariantIds = coordinationMode === "collective" ? deriveGoalContract(loadPrd(config2.prdPath).goalEnvelope)?.invariants.map((invariant) => invariant.id) ?? [] : [];
|
|
91078
91159
|
const collaborationConfig = coordinationMode === "collective" ? {
|
|
91079
|
-
commandPath:
|
|
91080
|
-
sessionDir:
|
|
91160
|
+
commandPath: existsSync18(bundledCollaborationCommand) ? bundledCollaborationCommand : developmentCollaborationCommand,
|
|
91161
|
+
sessionDir: join28(
|
|
91081
91162
|
collectiveSessionRoot,
|
|
91082
91163
|
collaborationEpoch
|
|
91083
91164
|
),
|
|
91084
|
-
challengeInflightDir:
|
|
91165
|
+
challengeInflightDir: join28(
|
|
91085
91166
|
collectiveSessionRoot,
|
|
91086
91167
|
"challenge-inflight"
|
|
91087
91168
|
)
|
|
@@ -91529,7 +91610,7 @@ async function orchestrate(config2) {
|
|
|
91529
91610
|
let responder = config2.goalReviewResponder;
|
|
91530
91611
|
if (!responder) {
|
|
91531
91612
|
goalReviewRuntimeCwd = mkdtempSync2(
|
|
91532
|
-
|
|
91613
|
+
join28(tmpdir10(), "baro-goal-review-runtime-")
|
|
91533
91614
|
);
|
|
91534
91615
|
responder = createDialogueResponder({
|
|
91535
91616
|
backend: criticLlm,
|
|
@@ -91725,7 +91806,7 @@ async function orchestrate(config2) {
|
|
|
91725
91806
|
const dialogueBackend = resolveDialogueBackend(config2.dialogueLlm, llm);
|
|
91726
91807
|
let responder = config2.dialogueResponder;
|
|
91727
91808
|
if (!responder) {
|
|
91728
|
-
dialogueRuntimeCwd = mkdtempSync2(
|
|
91809
|
+
dialogueRuntimeCwd = mkdtempSync2(join28(tmpdir10(), "baro-dialogue-runtime-"));
|
|
91729
91810
|
responder = createDialogueResponder({
|
|
91730
91811
|
backend: dialogueBackend,
|
|
91731
91812
|
cwd: dialogueRuntimeCwd,
|
|
@@ -92744,7 +92825,7 @@ async function main() {
|
|
|
92744
92825
|
}
|
|
92745
92826
|
const cwd = resolve16(args.cwd);
|
|
92746
92827
|
const prdPath = resolve16(cwd, args.prd);
|
|
92747
|
-
if (!
|
|
92828
|
+
if (!existsSync19(prdPath)) {
|
|
92748
92829
|
process.stderr.write(`[cli] PRD not found: ${prdPath}
|
|
92749
92830
|
`);
|
|
92750
92831
|
process.exit(2);
|