agent-valley 4.14.3 → 4.15.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/assets/plugin.json +1 -1
- package/dist/index.js +79 -7
- package/package.json +1 -1
package/dist/assets/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "av",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.15.0",
|
|
5
5
|
"description": "Delegate repository goals to Agent Valley and inspect mission progress and verification evidence.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Agent Valley"
|
package/dist/index.js
CHANGED
|
@@ -78183,7 +78183,7 @@ class ContinuousOperationStore {
|
|
|
78183
78183
|
}
|
|
78184
78184
|
|
|
78185
78185
|
// src/chief-continuous.ts
|
|
78186
|
-
import { execFile as
|
|
78186
|
+
import { execFile as execFile8 } from "node:child_process";
|
|
78187
78187
|
import { randomUUID as randomUUID23 } from "node:crypto";
|
|
78188
78188
|
import { realpath as realpath31 } from "node:fs/promises";
|
|
78189
78189
|
import { join as join58, resolve as resolve33 } from "node:path";
|
|
@@ -82371,6 +82371,63 @@ function unattendedVerificationGuidance(stage) {
|
|
|
82371
82371
|
`);
|
|
82372
82372
|
}
|
|
82373
82373
|
|
|
82374
|
+
// ../../packages/core/src/chief/workspace-growth.ts
|
|
82375
|
+
import { execFile as execFile7 } from "node:child_process";
|
|
82376
|
+
var GIB2 = 1024 ** 3;
|
|
82377
|
+
var INTEGRATION_CHECK_GROWTH_ENV = "AV_INTEGRATION_CHECK_GROWTH_GIB";
|
|
82378
|
+
var DEFAULT_INTEGRATION_CHECK_GROWTH_GIB = 1;
|
|
82379
|
+
var STORAGE_NOTE_PREFIX = "Storage:";
|
|
82380
|
+
function growthThresholdBytes(env = process.env) {
|
|
82381
|
+
const raw = env[INTEGRATION_CHECK_GROWTH_ENV]?.trim();
|
|
82382
|
+
if (!raw)
|
|
82383
|
+
return DEFAULT_INTEGRATION_CHECK_GROWTH_GIB * GIB2;
|
|
82384
|
+
const value = Number(raw);
|
|
82385
|
+
if (!Number.isFinite(value) || value < 0)
|
|
82386
|
+
throw new Error(`${INTEGRATION_CHECK_GROWTH_ENV}=${raw} is invalid. Set it to a non-negative number of GiB (for example ${DEFAULT_INTEGRATION_CHECK_GROWTH_GIB}), or 0 to disable the storage report.`);
|
|
82387
|
+
return value * GIB2;
|
|
82388
|
+
}
|
|
82389
|
+
function directorySizes(path, timeoutMs = 60000) {
|
|
82390
|
+
return new Promise((resolve) => {
|
|
82391
|
+
execFile7("du", ["-k", "-d", "3", path], { timeout: timeoutMs, maxBuffer: 64 * 1024 * 1024 }, (error, stdout) => {
|
|
82392
|
+
if (error && !stdout)
|
|
82393
|
+
return resolve(undefined);
|
|
82394
|
+
const sizes = new Map;
|
|
82395
|
+
for (const line of stdout.split(`
|
|
82396
|
+
`)) {
|
|
82397
|
+
const tab = line.indexOf("\t");
|
|
82398
|
+
const kib = Number(line.slice(0, tab));
|
|
82399
|
+
if (tab < 1 || !Number.isFinite(kib))
|
|
82400
|
+
continue;
|
|
82401
|
+
const entry = line.slice(tab + 1);
|
|
82402
|
+
if (entry !== path && !entry.startsWith(`${path}/`))
|
|
82403
|
+
continue;
|
|
82404
|
+
sizes.set(entry.slice(path.length + 1), kib * 1024);
|
|
82405
|
+
}
|
|
82406
|
+
resolve(sizes.has("") ? sizes : undefined);
|
|
82407
|
+
});
|
|
82408
|
+
});
|
|
82409
|
+
}
|
|
82410
|
+
var owned = (entry) => [".git", ".agent-valley"].some((root) => entry === root || entry.startsWith(`${root}/`));
|
|
82411
|
+
function growthReport(before, after, thresholdBytes) {
|
|
82412
|
+
if (!before || !after || thresholdBytes <= 0)
|
|
82413
|
+
return;
|
|
82414
|
+
const delta = (entry) => (after.get(entry) ?? 0) - (before.get(entry) ?? 0);
|
|
82415
|
+
const total = delta("") - [".git", ".agent-valley"].reduce((sum, root) => sum + delta(root), 0);
|
|
82416
|
+
if (total < thresholdBytes)
|
|
82417
|
+
return;
|
|
82418
|
+
const floor = Math.max(total / 10, 64 * 1024 ** 2);
|
|
82419
|
+
const depth = (entry) => entry.split("/").length;
|
|
82420
|
+
const grown = [...after.keys()].filter((entry) => entry && !owned(entry) && delta(entry) >= floor).sort((a, b) => depth(b) - depth(a) || delta(b) - delta(a));
|
|
82421
|
+
const picked = [];
|
|
82422
|
+
for (const entry of grown)
|
|
82423
|
+
if (!picked.some((child) => child.startsWith(`${entry}/`)))
|
|
82424
|
+
picked.push(entry);
|
|
82425
|
+
const gib = (bytes) => `${(bytes / GIB2).toFixed(1)} GiB`;
|
|
82426
|
+
const where = picked.sort((a, b) => delta(b) - delta(a)).slice(0, 3).map((entry) => `${entry} (+${gib(delta(entry))})`);
|
|
82427
|
+
const size = (after.get("") ?? 0) - (after.get(".git") ?? 0) - (after.get(".agent-valley") ?? 0);
|
|
82428
|
+
return `${STORAGE_NOTE_PREFIX} this check left ${gib(total)} of new files in the workspace (${gib(size)} in total)${where.length ? `, mostly under ${where.join(", ")}` : ""}. Nothing removes them, so repeated checks fill the disk; the tests or scripts that create these files have to remove them.`;
|
|
82429
|
+
}
|
|
82430
|
+
|
|
82374
82431
|
// ../../packages/core/src/chief/runtime-integration-check.ts
|
|
82375
82432
|
var INTEGRATION_CHECK_ENV = "AV_INTEGRATION_CHECK";
|
|
82376
82433
|
var INTEGRATION_CHECK_COMMAND_ENV = "AV_INTEGRATION_CHECK_COMMAND";
|
|
@@ -82417,6 +82474,16 @@ async function runIntegrationCheck(mission, active, signal, source = process.env
|
|
|
82417
82474
|
if (!command && !mission.verificationContract)
|
|
82418
82475
|
return;
|
|
82419
82476
|
await assertMissionWorkspace(mission);
|
|
82477
|
+
const threshold = growthThresholdBytes(source);
|
|
82478
|
+
const before = threshold > 0 ? await directorySizes(mission.workspace.path) : undefined;
|
|
82479
|
+
const result = await checkIntegratedTree(mission, active, command, signal, source);
|
|
82480
|
+
if (!result || !before)
|
|
82481
|
+
return result;
|
|
82482
|
+
const storage = growthReport(before, await directorySizes(mission.workspace.path), threshold);
|
|
82483
|
+
return storage ? { ok: result.ok, output: `${storage}
|
|
82484
|
+
${result.output}`.slice(0, 8000) } : result;
|
|
82485
|
+
}
|
|
82486
|
+
async function checkIntegratedTree(mission, active, command, signal, source) {
|
|
82420
82487
|
active.begin("verify");
|
|
82421
82488
|
try {
|
|
82422
82489
|
const operator = async () => operatorIntegrationResult(command ?? "", await runVerificationGate(mission.workspace, command ?? "", {
|
|
@@ -86120,7 +86187,7 @@ async function resumeSourceIntegration(operation, mode, storageRoot, signal, sav
|
|
|
86120
86187
|
}
|
|
86121
86188
|
|
|
86122
86189
|
// src/chief-continuous.ts
|
|
86123
|
-
var execute3 = promisify5(
|
|
86190
|
+
var execute3 = promisify5(execFile8);
|
|
86124
86191
|
var orderKeys = [
|
|
86125
86192
|
"workspace",
|
|
86126
86193
|
"verify",
|
|
@@ -138996,6 +139063,11 @@ async function planMission(context) {
|
|
|
138996
139063
|
|
|
138997
139064
|
// ../../packages/core/src/chief/coordinator-integration.ts
|
|
138998
139065
|
init_execution();
|
|
139066
|
+
var storageNote = (output) => {
|
|
139067
|
+
const first = output.split(`
|
|
139068
|
+
`, 1)[0] ?? "";
|
|
139069
|
+
return first.startsWith(STORAGE_NOTE_PREFIX) ? ` ${first}` : "";
|
|
139070
|
+
};
|
|
138999
139071
|
async function recordIntegrationCheck(mission, ports, states, save) {
|
|
139000
139072
|
if (!ports.integrationCheck)
|
|
139001
139073
|
return;
|
|
@@ -139022,7 +139094,7 @@ async function recordIntegrationCheck(mission, ports, states, save) {
|
|
|
139022
139094
|
const observed = { at: new Date().toISOString(), ok: result.ok, output: result.output.slice(0, 8000) };
|
|
139023
139095
|
for (const state of targets)
|
|
139024
139096
|
state.integrationCheck = observed;
|
|
139025
|
-
await save("integration-check", `${result.ok ? "Contract command checks pass" : "Contract command checks fail"} on the integrated tree before review of ${targets.map((state) => state.id).join(", ")}.${result.ok ?
|
|
139097
|
+
await save("integration-check", `${result.ok ? "Contract command checks pass" : "Contract command checks fail"} on the integrated tree before review of ${targets.map((state) => state.id).join(", ")}.${result.ok ? storageNote(result.output) : ` ${result.output.slice(0, 1500)}`}`, first.id);
|
|
139026
139098
|
}
|
|
139027
139099
|
|
|
139028
139100
|
// ../../packages/core/src/chief/coordinator-parallel.ts
|
|
@@ -142472,12 +142544,12 @@ async function readStatus(port) {
|
|
|
142472
142544
|
}
|
|
142473
142545
|
|
|
142474
142546
|
// src/storage-gc-command.ts
|
|
142475
|
-
import { execFile as
|
|
142547
|
+
import { execFile as execFile9 } from "node:child_process";
|
|
142476
142548
|
import { promisify as promisify6 } from "node:util";
|
|
142477
142549
|
init_disk_budget();
|
|
142478
|
-
var exec5 = promisify6(
|
|
142479
|
-
var
|
|
142480
|
-
var gib = (bytes) => `${(bytes /
|
|
142550
|
+
var exec5 = promisify6(execFile9);
|
|
142551
|
+
var GIB3 = 1024 ** 3;
|
|
142552
|
+
var gib = (bytes) => `${(bytes / GIB3).toFixed(1)} GiB`;
|
|
142481
142553
|
async function diskUsage(path) {
|
|
142482
142554
|
try {
|
|
142483
142555
|
const { stdout } = await exec5("du", ["-sk", path]);
|