baro-ai 0.109.0 → 0.110.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/cli.mjs +85 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/operator.mjs +42851 -0
- package/dist/operator.mjs.map +1 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -22744,7 +22744,7 @@ 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 readFileSync11, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync7, renameSync as renameSync4, rmSync as rmSync2, readdirSync as readdirSync5, statSync as
|
|
22747
|
+
import { readFileSync as readFileSync11, writeFileSync as writeFileSync5, mkdirSync as mkdirSync5, existsSync as existsSync7, renameSync as renameSync4, rmSync as rmSync2, readdirSync as readdirSync5, statSync as statSync5, lstatSync as lstatSync3 } from "fs";
|
|
22748
22748
|
import { join as join11 } from "path";
|
|
22749
22749
|
import { tmpdir as tmpdir4, homedir } from "os";
|
|
22750
22750
|
async function createMemoryStore(config2) {
|
|
@@ -22872,7 +22872,7 @@ var init_vectra_store = __esm({
|
|
|
22872
22872
|
try {
|
|
22873
22873
|
if (!existsSync7(this.indexFilePath))
|
|
22874
22874
|
return;
|
|
22875
|
-
const mtimeMs =
|
|
22875
|
+
const mtimeMs = statSync5(this.indexFilePath).mtimeMs;
|
|
22876
22876
|
if (mtimeMs === this.lastIndexMtimeMs)
|
|
22877
22877
|
return;
|
|
22878
22878
|
const newIndex = new LocalIndex(this.indexPath);
|
|
@@ -66566,7 +66566,7 @@ function safeEvidenceText(value, limit2) {
|
|
|
66566
66566
|
}
|
|
66567
66567
|
|
|
66568
66568
|
// ../baro-orchestrator/src/verification/verify.ts
|
|
66569
|
-
import { existsSync as existsSync6, readdirSync as readdirSync4, readFileSync as readFileSync10 } from "fs";
|
|
66569
|
+
import { existsSync as existsSync6, readdirSync as readdirSync4, readFileSync as readFileSync10, statSync as statSync4 } from "fs";
|
|
66570
66570
|
import { isAbsolute as isAbsolute5, join as join9, relative as relative4, resolve as resolve5, sep as sep3 } from "path";
|
|
66571
66571
|
|
|
66572
66572
|
// ../baro-orchestrator/src/verification/declared-verification.ts
|
|
@@ -67641,6 +67641,65 @@ function detectCommands(cwd) {
|
|
|
67641
67641
|
}
|
|
67642
67642
|
return { commands: cmds, javascriptPackageManagers };
|
|
67643
67643
|
}
|
|
67644
|
+
function staleDependencyReasons(cwd) {
|
|
67645
|
+
const pkgPath = join9(cwd, "package.json");
|
|
67646
|
+
if (!existsSync6(pkgPath)) return [];
|
|
67647
|
+
const manifest = readPackageManifest(pkgPath);
|
|
67648
|
+
if (!manifest) return [];
|
|
67649
|
+
const reasons = [];
|
|
67650
|
+
const nodeModules = join9(cwd, "node_modules");
|
|
67651
|
+
const declaresDependencies = hasEntries(manifest.dependencies) || hasEntries(manifest.devDependencies);
|
|
67652
|
+
const workspaceDirs = workspacePackageDirs(cwd, [
|
|
67653
|
+
...workspacePatterns(manifest.workspaces),
|
|
67654
|
+
...pnpmWorkspacePatterns(cwd)
|
|
67655
|
+
]);
|
|
67656
|
+
if (!existsSync6(nodeModules)) {
|
|
67657
|
+
if (declaresDependencies || workspaceDirs.length > 0) {
|
|
67658
|
+
reasons.push("node_modules is missing");
|
|
67659
|
+
}
|
|
67660
|
+
return reasons;
|
|
67661
|
+
}
|
|
67662
|
+
for (const dir of workspaceDirs) {
|
|
67663
|
+
const name = readPackageManifest(join9(dir, "package.json"))?.name;
|
|
67664
|
+
if (typeof name !== "string" || !name) continue;
|
|
67665
|
+
if (!existsSync6(join9(nodeModules, name))) {
|
|
67666
|
+
reasons.push(`workspace ${name} is not linked in node_modules`);
|
|
67667
|
+
}
|
|
67668
|
+
}
|
|
67669
|
+
const marker = [
|
|
67670
|
+
"node_modules/.package-lock.json",
|
|
67671
|
+
"node_modules/.modules.yaml",
|
|
67672
|
+
"node_modules/.yarn-integrity"
|
|
67673
|
+
].map((relativePath) => join9(cwd, relativePath)).find((path6) => existsSync6(path6));
|
|
67674
|
+
if (marker) {
|
|
67675
|
+
const installedAt = statSync4(marker).mtimeMs;
|
|
67676
|
+
for (const file of ["package.json", "package-lock.json", "pnpm-lock.yaml", "yarn.lock"]) {
|
|
67677
|
+
const path6 = join9(cwd, file);
|
|
67678
|
+
if (existsSync6(path6) && statSync4(path6).mtimeMs > installedAt + 1e3) {
|
|
67679
|
+
reasons.push(`${file} changed after the last install`);
|
|
67680
|
+
}
|
|
67681
|
+
}
|
|
67682
|
+
}
|
|
67683
|
+
return reasons;
|
|
67684
|
+
}
|
|
67685
|
+
function hasEntries(value) {
|
|
67686
|
+
return typeof value === "object" && value !== null && Object.keys(value).length > 0;
|
|
67687
|
+
}
|
|
67688
|
+
function dependencyRefreshCommand(cwd, reasons) {
|
|
67689
|
+
const manifest = readPackageManifest(join9(cwd, "package.json"));
|
|
67690
|
+
const declared = declaredPackageManager(manifest?.packageManager);
|
|
67691
|
+
const pm = detectPackageManager(cwd, manifest, existsSync6(join9(cwd, "pnpm-workspace.yaml")));
|
|
67692
|
+
const yarnMajor = declared?.manager === "yarn" ? Number.parseInt(declared.version.match(/^\d+/)?.[0] ?? "", 10) : Number.NaN;
|
|
67693
|
+
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"] };
|
|
67694
|
+
return {
|
|
67695
|
+
label: `${pm} install (dependencies stale: ${reasons.join("; ")})`,
|
|
67696
|
+
...command
|
|
67697
|
+
};
|
|
67698
|
+
}
|
|
67699
|
+
function dependencyRefreshEnabled(options) {
|
|
67700
|
+
if (options.refreshDependencies === false) return false;
|
|
67701
|
+
return process.env.BARO_DEPS_REFRESH !== "0";
|
|
67702
|
+
}
|
|
67644
67703
|
function dedupeVerifyCommands(commands) {
|
|
67645
67704
|
const deduped = [];
|
|
67646
67705
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -68049,6 +68108,29 @@ async function verifyBuild(cwd, options = {}) {
|
|
|
68049
68108
|
let ran = false;
|
|
68050
68109
|
const plan = options.plan ?? createVerifyPlan(cwd);
|
|
68051
68110
|
const emitActivity = options.emitActivity ?? emit;
|
|
68111
|
+
const stale = dependencyRefreshEnabled(options) && plan.commands.length > 0 ? staleDependencyReasons(cwd) : [];
|
|
68112
|
+
if (stale.length > 0) {
|
|
68113
|
+
throwIfAborted(options.signal);
|
|
68114
|
+
const install = dependencyRefreshCommand(cwd, stale);
|
|
68115
|
+
emitActivity({
|
|
68116
|
+
type: "activity",
|
|
68117
|
+
id: "_verify",
|
|
68118
|
+
kind: "warn",
|
|
68119
|
+
text: `refreshing dependencies before verification: ${stale.join("; ")}`
|
|
68120
|
+
});
|
|
68121
|
+
const outcome = await runCmd(cwd, install, options.signal);
|
|
68122
|
+
commands.push({
|
|
68123
|
+
command: install.label,
|
|
68124
|
+
status: outcome.status,
|
|
68125
|
+
durationMs: outcome.durationMs,
|
|
68126
|
+
..."tail" in outcome && outcome.tail ? { tail: outcome.tail } : {},
|
|
68127
|
+
..."output" in outcome && outcome.output ? { output: outcome.output } : {}
|
|
68128
|
+
});
|
|
68129
|
+
if (outcome.status === "failed") {
|
|
68130
|
+
ran = true;
|
|
68131
|
+
failures.push({ cmd: install.label, tail: outcome.tail });
|
|
68132
|
+
}
|
|
68133
|
+
}
|
|
68052
68134
|
for (const c of plan.commands) {
|
|
68053
68135
|
throwIfAborted(options.signal);
|
|
68054
68136
|
let outcome = await runCmd(cwd, c, options.signal);
|