agentv 3.2.5 → 3.4.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/README.md +1 -1
- package/dist/{chunk-BPK64EWF.js → chunk-A7ZDUB46.js} +238 -116
- package/dist/chunk-A7ZDUB46.js.map +1 -0
- package/dist/{chunk-6XTYVCMN.js → chunk-GOZV2HN2.js} +236 -94
- package/dist/chunk-GOZV2HN2.js.map +1 -0
- package/dist/{chunk-WQGBWX5Y.js → chunk-RE5I3U2S.js} +156 -46
- package/dist/chunk-RE5I3U2S.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/{dist-JXD6WHHI.js → dist-AFDYFH6Y.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{interactive-B72SWNWB.js → interactive-WXXTZ7PD.js} +44 -4
- package/dist/interactive-WXXTZ7PD.js.map +1 -0
- package/dist/templates/.agentv/.env.example +11 -9
- package/dist/templates/.agentv/config.yaml +5 -0
- package/dist/templates/.agentv/targets.yaml +0 -16
- package/package.json +2 -2
- package/dist/chunk-6XTYVCMN.js.map +0 -1
- package/dist/chunk-BPK64EWF.js.map +0 -1
- package/dist/chunk-WQGBWX5Y.js.map +0 -1
- package/dist/interactive-B72SWNWB.js.map +0 -1
- /package/dist/{dist-JXD6WHHI.js.map → dist-AFDYFH6Y.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
HtmlWriter,
|
|
4
|
+
buildBenchmarkArtifact,
|
|
5
|
+
buildGradingArtifact,
|
|
6
|
+
buildTimingArtifact,
|
|
4
7
|
detectFileType,
|
|
5
8
|
findRepoRoot,
|
|
6
9
|
package_default,
|
|
10
|
+
parseJsonlResults,
|
|
7
11
|
resolveEvalPaths,
|
|
8
12
|
runEvalCommand,
|
|
9
13
|
selectTarget,
|
|
@@ -12,7 +16,7 @@ import {
|
|
|
12
16
|
validateEvalFile,
|
|
13
17
|
validateFileReferences,
|
|
14
18
|
validateTargetsFile
|
|
15
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RE5I3U2S.js";
|
|
16
20
|
import {
|
|
17
21
|
createBuiltinRegistry,
|
|
18
22
|
createProvider,
|
|
@@ -30,7 +34,7 @@ import {
|
|
|
30
34
|
toSnakeCaseDeep as toSnakeCaseDeep2,
|
|
31
35
|
transpileEvalYamlFile,
|
|
32
36
|
trimBaselineResult
|
|
33
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-GOZV2HN2.js";
|
|
34
38
|
import {
|
|
35
39
|
__commonJS,
|
|
36
40
|
__esm,
|
|
@@ -3981,7 +3985,11 @@ var evalAssertCommand = command({
|
|
|
3981
3985
|
file_changes: null,
|
|
3982
3986
|
workspace_path: null,
|
|
3983
3987
|
config: null,
|
|
3984
|
-
metadata: {}
|
|
3988
|
+
metadata: {},
|
|
3989
|
+
// Text convenience accessors (new names)
|
|
3990
|
+
input_text: resolvedInput,
|
|
3991
|
+
output_text: resolvedOutput,
|
|
3992
|
+
expected_output_text: ""
|
|
3985
3993
|
},
|
|
3986
3994
|
null,
|
|
3987
3995
|
2
|
|
@@ -4177,7 +4185,7 @@ var evalRunCommand = command({
|
|
|
4177
4185
|
},
|
|
4178
4186
|
handler: async (args) => {
|
|
4179
4187
|
if (args.evalPaths.length === 0 && process.stdin.isTTY) {
|
|
4180
|
-
const { launchInteractiveWizard } = await import("./interactive-
|
|
4188
|
+
const { launchInteractiveWizard } = await import("./interactive-WXXTZ7PD.js");
|
|
4181
4189
|
await launchInteractiveWizard();
|
|
4182
4190
|
return;
|
|
4183
4191
|
}
|
|
@@ -4561,93 +4569,9 @@ var initCmdTsCommand = command({
|
|
|
4561
4569
|
}
|
|
4562
4570
|
});
|
|
4563
4571
|
|
|
4564
|
-
// src/commands/
|
|
4565
|
-
import {
|
|
4566
|
-
|
|
4567
|
-
if (scriptPath.includes(".bun")) {
|
|
4568
|
-
return "bun";
|
|
4569
|
-
}
|
|
4570
|
-
return "npm";
|
|
4571
|
-
}
|
|
4572
|
-
function detectPackageManager() {
|
|
4573
|
-
return detectPackageManagerFromPath(process.argv[1] ?? "");
|
|
4574
|
-
}
|
|
4575
|
-
function runCommand(cmd, args) {
|
|
4576
|
-
return new Promise((resolve, reject) => {
|
|
4577
|
-
const child = spawn(cmd, args, { stdio: ["inherit", "pipe", "inherit"], shell: true });
|
|
4578
|
-
let stdout = "";
|
|
4579
|
-
child.stdout?.on("data", (data) => {
|
|
4580
|
-
process.stdout.write(data);
|
|
4581
|
-
stdout += data.toString();
|
|
4582
|
-
});
|
|
4583
|
-
child.on("error", reject);
|
|
4584
|
-
child.on("close", (code) => resolve({ exitCode: code ?? 1, stdout }));
|
|
4585
|
-
});
|
|
4586
|
-
}
|
|
4587
|
-
var updateCommand = command({
|
|
4588
|
-
name: "update",
|
|
4589
|
-
description: "Update agentv to the latest version",
|
|
4590
|
-
args: {
|
|
4591
|
-
npm: flag({ long: "npm", description: "Force update using npm" }),
|
|
4592
|
-
bun: flag({ long: "bun", description: "Force update using bun" })
|
|
4593
|
-
},
|
|
4594
|
-
handler: async ({ npm, bun }) => {
|
|
4595
|
-
if (npm && bun) {
|
|
4596
|
-
console.error("Error: Cannot specify both --npm and --bun");
|
|
4597
|
-
process.exit(1);
|
|
4598
|
-
}
|
|
4599
|
-
let pm;
|
|
4600
|
-
if (npm) {
|
|
4601
|
-
pm = "npm";
|
|
4602
|
-
} else if (bun) {
|
|
4603
|
-
pm = "bun";
|
|
4604
|
-
} else {
|
|
4605
|
-
pm = detectPackageManager();
|
|
4606
|
-
}
|
|
4607
|
-
const currentVersion = package_default.version;
|
|
4608
|
-
console.log(`Current version: ${currentVersion}`);
|
|
4609
|
-
console.log(`Updating agentv using ${pm}...
|
|
4610
|
-
`);
|
|
4611
|
-
const args = pm === "npm" ? ["install", "-g", "agentv@latest"] : ["add", "-g", "agentv@latest"];
|
|
4612
|
-
try {
|
|
4613
|
-
const result = await runCommand(pm, args);
|
|
4614
|
-
if (result.exitCode !== 0) {
|
|
4615
|
-
console.error("\nUpdate failed.");
|
|
4616
|
-
process.exit(1);
|
|
4617
|
-
}
|
|
4618
|
-
let newVersion;
|
|
4619
|
-
try {
|
|
4620
|
-
const versionResult = await runCommand("agentv", ["--version"]);
|
|
4621
|
-
newVersion = versionResult.stdout.trim();
|
|
4622
|
-
} catch {
|
|
4623
|
-
}
|
|
4624
|
-
if (newVersion) {
|
|
4625
|
-
console.log(`
|
|
4626
|
-
Update complete: ${currentVersion} \u2192 ${newVersion}`);
|
|
4627
|
-
} else {
|
|
4628
|
-
console.log("\nUpdate complete.");
|
|
4629
|
-
}
|
|
4630
|
-
} catch (error) {
|
|
4631
|
-
if (error instanceof Error) {
|
|
4632
|
-
if (error.message.includes("ENOENT") || error.message.includes("not found")) {
|
|
4633
|
-
const alternative = pm === "npm" ? "bun" : "npm";
|
|
4634
|
-
console.error(`Error: ${pm} not found. Try using --${alternative} flag.`);
|
|
4635
|
-
} else {
|
|
4636
|
-
console.error(`Error: ${error.message}`);
|
|
4637
|
-
}
|
|
4638
|
-
process.exit(1);
|
|
4639
|
-
}
|
|
4640
|
-
throw error;
|
|
4641
|
-
}
|
|
4642
|
-
}
|
|
4643
|
-
});
|
|
4644
|
-
var selfCommand = subcommands({
|
|
4645
|
-
name: "self",
|
|
4646
|
-
description: "Manage the agentv installation",
|
|
4647
|
-
cmds: {
|
|
4648
|
-
update: updateCommand
|
|
4649
|
-
}
|
|
4650
|
-
});
|
|
4572
|
+
// src/commands/results/export.ts
|
|
4573
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "node:fs";
|
|
4574
|
+
import path8 from "node:path";
|
|
4651
4575
|
|
|
4652
4576
|
// src/commands/trace/utils.ts
|
|
4653
4577
|
import { readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync2 } from "node:fs";
|
|
@@ -4753,6 +4677,202 @@ function formatScore(score) {
|
|
|
4753
4677
|
return `${(score * 100).toFixed(0)}%`;
|
|
4754
4678
|
}
|
|
4755
4679
|
|
|
4680
|
+
// src/commands/results/export.ts
|
|
4681
|
+
function exportResults(sourceFile, content, outputDir) {
|
|
4682
|
+
const results = parseJsonlResults(content);
|
|
4683
|
+
if (results.length === 0) {
|
|
4684
|
+
throw new Error(`No results found in ${sourceFile}`);
|
|
4685
|
+
}
|
|
4686
|
+
const patched = results.map((r) => {
|
|
4687
|
+
if (!r.testId && r.evalId) {
|
|
4688
|
+
return { ...r, testId: String(r.evalId) };
|
|
4689
|
+
}
|
|
4690
|
+
return r;
|
|
4691
|
+
});
|
|
4692
|
+
mkdirSync2(outputDir, { recursive: true });
|
|
4693
|
+
const benchmark = buildBenchmarkArtifact(patched, sourceFile);
|
|
4694
|
+
writeFileSync3(path8.join(outputDir, "benchmark.json"), `${JSON.stringify(benchmark, null, 2)}
|
|
4695
|
+
`);
|
|
4696
|
+
const timing = buildTimingArtifact(patched);
|
|
4697
|
+
writeFileSync3(path8.join(outputDir, "timing.json"), `${JSON.stringify(timing, null, 2)}
|
|
4698
|
+
`);
|
|
4699
|
+
const gradingDir = path8.join(outputDir, "grading");
|
|
4700
|
+
mkdirSync2(gradingDir, { recursive: true });
|
|
4701
|
+
for (const result of patched) {
|
|
4702
|
+
const id = safeTestId(result);
|
|
4703
|
+
const grading = buildGradingArtifact(result);
|
|
4704
|
+
writeFileSync3(path8.join(gradingDir, `${id}.json`), `${JSON.stringify(grading, null, 2)}
|
|
4705
|
+
`);
|
|
4706
|
+
}
|
|
4707
|
+
const outputsDir = path8.join(outputDir, "outputs");
|
|
4708
|
+
mkdirSync2(outputsDir, { recursive: true });
|
|
4709
|
+
for (const result of patched) {
|
|
4710
|
+
const answer = result.answer;
|
|
4711
|
+
if (answer) {
|
|
4712
|
+
const id = safeTestId(result);
|
|
4713
|
+
writeFileSync3(path8.join(outputsDir, `${id}.txt`), answer);
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
function safeTestId(result) {
|
|
4718
|
+
const raw = result.testId ?? result.evalId ?? "unknown";
|
|
4719
|
+
return String(raw).replace(/[/\\:*?"<>|]/g, "_");
|
|
4720
|
+
}
|
|
4721
|
+
function deriveOutputDir(cwd, sourceFile) {
|
|
4722
|
+
const basename = path8.basename(sourceFile, ".jsonl");
|
|
4723
|
+
const dirName = basename.startsWith("eval_") ? basename.slice(5) : basename;
|
|
4724
|
+
return path8.join(cwd, ".agentv", "results", dirName);
|
|
4725
|
+
}
|
|
4726
|
+
var resultsExportCommand = command({
|
|
4727
|
+
name: "export",
|
|
4728
|
+
description: "Export JSONL eval results into a per-test directory structure",
|
|
4729
|
+
args: {
|
|
4730
|
+
source: positional({
|
|
4731
|
+
type: optional(string),
|
|
4732
|
+
displayName: "source",
|
|
4733
|
+
description: "JSONL result file to export (defaults to most recent in .agentv/results/)"
|
|
4734
|
+
}),
|
|
4735
|
+
out: option({
|
|
4736
|
+
type: optional(string),
|
|
4737
|
+
long: "out",
|
|
4738
|
+
short: "o",
|
|
4739
|
+
description: "Output directory (defaults to .agentv/results/<run-timestamp>/)"
|
|
4740
|
+
}),
|
|
4741
|
+
dir: option({
|
|
4742
|
+
type: optional(string),
|
|
4743
|
+
long: "dir",
|
|
4744
|
+
short: "d",
|
|
4745
|
+
description: "Working directory (default: current directory)"
|
|
4746
|
+
})
|
|
4747
|
+
},
|
|
4748
|
+
handler: async ({ source, out, dir }) => {
|
|
4749
|
+
const cwd = dir ?? process.cwd();
|
|
4750
|
+
try {
|
|
4751
|
+
let sourceFile;
|
|
4752
|
+
if (source) {
|
|
4753
|
+
sourceFile = path8.isAbsolute(source) ? source : path8.resolve(cwd, source);
|
|
4754
|
+
} else {
|
|
4755
|
+
const metas = listResultFiles(cwd, 1);
|
|
4756
|
+
if (metas.length === 0) {
|
|
4757
|
+
console.error("Error: No result files found in .agentv/results/");
|
|
4758
|
+
console.error("Run an evaluation first: agentv eval <eval-file>");
|
|
4759
|
+
process.exit(1);
|
|
4760
|
+
}
|
|
4761
|
+
sourceFile = metas[0].path;
|
|
4762
|
+
}
|
|
4763
|
+
const content = readFileSync6(sourceFile, "utf8");
|
|
4764
|
+
const outputDir = out ? path8.isAbsolute(out) ? out : path8.resolve(cwd, out) : deriveOutputDir(cwd, sourceFile);
|
|
4765
|
+
exportResults(sourceFile, content, outputDir);
|
|
4766
|
+
const results = parseJsonlResults(content);
|
|
4767
|
+
console.log(`Exported ${results.length} test(s) to ${outputDir}`);
|
|
4768
|
+
for (const result of results) {
|
|
4769
|
+
const id = result.testId ?? result.evalId ?? "unknown";
|
|
4770
|
+
console.log(` ${id}`);
|
|
4771
|
+
}
|
|
4772
|
+
} catch (error) {
|
|
4773
|
+
console.error(`Error: ${error.message}`);
|
|
4774
|
+
process.exit(1);
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
});
|
|
4778
|
+
|
|
4779
|
+
// src/commands/results/index.ts
|
|
4780
|
+
var resultsCommand = subcommands({
|
|
4781
|
+
name: "results",
|
|
4782
|
+
description: "Inspect, export, and manage evaluation results",
|
|
4783
|
+
cmds: {
|
|
4784
|
+
export: resultsExportCommand
|
|
4785
|
+
}
|
|
4786
|
+
});
|
|
4787
|
+
|
|
4788
|
+
// src/commands/self/index.ts
|
|
4789
|
+
import { spawn } from "node:child_process";
|
|
4790
|
+
function detectPackageManagerFromPath(scriptPath) {
|
|
4791
|
+
if (scriptPath.includes(".bun")) {
|
|
4792
|
+
return "bun";
|
|
4793
|
+
}
|
|
4794
|
+
return "npm";
|
|
4795
|
+
}
|
|
4796
|
+
function detectPackageManager() {
|
|
4797
|
+
return detectPackageManagerFromPath(process.argv[1] ?? "");
|
|
4798
|
+
}
|
|
4799
|
+
function runCommand(cmd, args) {
|
|
4800
|
+
return new Promise((resolve, reject) => {
|
|
4801
|
+
const child = spawn(cmd, args, { stdio: ["inherit", "pipe", "inherit"], shell: true });
|
|
4802
|
+
let stdout = "";
|
|
4803
|
+
child.stdout?.on("data", (data) => {
|
|
4804
|
+
process.stdout.write(data);
|
|
4805
|
+
stdout += data.toString();
|
|
4806
|
+
});
|
|
4807
|
+
child.on("error", reject);
|
|
4808
|
+
child.on("close", (code) => resolve({ exitCode: code ?? 1, stdout }));
|
|
4809
|
+
});
|
|
4810
|
+
}
|
|
4811
|
+
var updateCommand = command({
|
|
4812
|
+
name: "update",
|
|
4813
|
+
description: "Update agentv to the latest version",
|
|
4814
|
+
args: {
|
|
4815
|
+
npm: flag({ long: "npm", description: "Force update using npm" }),
|
|
4816
|
+
bun: flag({ long: "bun", description: "Force update using bun" })
|
|
4817
|
+
},
|
|
4818
|
+
handler: async ({ npm, bun }) => {
|
|
4819
|
+
if (npm && bun) {
|
|
4820
|
+
console.error("Error: Cannot specify both --npm and --bun");
|
|
4821
|
+
process.exit(1);
|
|
4822
|
+
}
|
|
4823
|
+
let pm;
|
|
4824
|
+
if (npm) {
|
|
4825
|
+
pm = "npm";
|
|
4826
|
+
} else if (bun) {
|
|
4827
|
+
pm = "bun";
|
|
4828
|
+
} else {
|
|
4829
|
+
pm = detectPackageManager();
|
|
4830
|
+
}
|
|
4831
|
+
const currentVersion = package_default.version;
|
|
4832
|
+
console.log(`Current version: ${currentVersion}`);
|
|
4833
|
+
console.log(`Updating agentv using ${pm}...
|
|
4834
|
+
`);
|
|
4835
|
+
const args = pm === "npm" ? ["install", "-g", "agentv@latest"] : ["add", "-g", "agentv@latest"];
|
|
4836
|
+
try {
|
|
4837
|
+
const result = await runCommand(pm, args);
|
|
4838
|
+
if (result.exitCode !== 0) {
|
|
4839
|
+
console.error("\nUpdate failed.");
|
|
4840
|
+
process.exit(1);
|
|
4841
|
+
}
|
|
4842
|
+
let newVersion;
|
|
4843
|
+
try {
|
|
4844
|
+
const versionResult = await runCommand("agentv", ["--version"]);
|
|
4845
|
+
newVersion = versionResult.stdout.trim();
|
|
4846
|
+
} catch {
|
|
4847
|
+
}
|
|
4848
|
+
if (newVersion) {
|
|
4849
|
+
console.log(`
|
|
4850
|
+
Update complete: ${currentVersion} \u2192 ${newVersion}`);
|
|
4851
|
+
} else {
|
|
4852
|
+
console.log("\nUpdate complete.");
|
|
4853
|
+
}
|
|
4854
|
+
} catch (error) {
|
|
4855
|
+
if (error instanceof Error) {
|
|
4856
|
+
if (error.message.includes("ENOENT") || error.message.includes("not found")) {
|
|
4857
|
+
const alternative = pm === "npm" ? "bun" : "npm";
|
|
4858
|
+
console.error(`Error: ${pm} not found. Try using --${alternative} flag.`);
|
|
4859
|
+
} else {
|
|
4860
|
+
console.error(`Error: ${error.message}`);
|
|
4861
|
+
}
|
|
4862
|
+
process.exit(1);
|
|
4863
|
+
}
|
|
4864
|
+
throw error;
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
});
|
|
4868
|
+
var selfCommand = subcommands({
|
|
4869
|
+
name: "self",
|
|
4870
|
+
description: "Manage the agentv installation",
|
|
4871
|
+
cmds: {
|
|
4872
|
+
update: updateCommand
|
|
4873
|
+
}
|
|
4874
|
+
});
|
|
4875
|
+
|
|
4756
4876
|
// src/commands/trace/list.ts
|
|
4757
4877
|
function formatListTable(metas) {
|
|
4758
4878
|
const lines = [];
|
|
@@ -5501,8 +5621,8 @@ var traceCommand = subcommands({
|
|
|
5501
5621
|
});
|
|
5502
5622
|
|
|
5503
5623
|
// src/commands/transpile/index.ts
|
|
5504
|
-
import { writeFileSync as
|
|
5505
|
-
import
|
|
5624
|
+
import { writeFileSync as writeFileSync4 } from "node:fs";
|
|
5625
|
+
import path9 from "node:path";
|
|
5506
5626
|
var transpileCommand = command({
|
|
5507
5627
|
name: "transpile",
|
|
5508
5628
|
description: "Convert an EVAL.yaml file to Agent Skills evals.json format",
|
|
@@ -5526,7 +5646,7 @@ var transpileCommand = command({
|
|
|
5526
5646
|
handler: async ({ input, outDir, stdout }) => {
|
|
5527
5647
|
let result;
|
|
5528
5648
|
try {
|
|
5529
|
-
result = transpileEvalYamlFile(
|
|
5649
|
+
result = transpileEvalYamlFile(path9.resolve(input));
|
|
5530
5650
|
} catch (error) {
|
|
5531
5651
|
console.error(`Error: ${error.message}`);
|
|
5532
5652
|
process.exit(1);
|
|
@@ -5550,12 +5670,12 @@ var transpileCommand = command({
|
|
|
5550
5670
|
process.stdout.write("\n");
|
|
5551
5671
|
return;
|
|
5552
5672
|
}
|
|
5553
|
-
const outputDir = outDir ?
|
|
5673
|
+
const outputDir = outDir ? path9.resolve(outDir) : path9.dirname(path9.resolve(input));
|
|
5554
5674
|
const fileNames = getOutputFilenames(result);
|
|
5555
5675
|
for (const [skill, evalsJson] of result.files) {
|
|
5556
5676
|
const fileName = fileNames.get(skill) ?? "evals.json";
|
|
5557
|
-
const outputPath =
|
|
5558
|
-
|
|
5677
|
+
const outputPath = path9.join(outputDir, fileName);
|
|
5678
|
+
writeFileSync4(outputPath, `${JSON.stringify(evalsJson, null, 2)}
|
|
5559
5679
|
`);
|
|
5560
5680
|
console.log(`Transpiled to ${outputPath}`);
|
|
5561
5681
|
}
|
|
@@ -5563,7 +5683,7 @@ var transpileCommand = command({
|
|
|
5563
5683
|
});
|
|
5564
5684
|
|
|
5565
5685
|
// src/commands/trim/index.ts
|
|
5566
|
-
import { readFileSync as
|
|
5686
|
+
import { readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "node:fs";
|
|
5567
5687
|
var trimCommand = command({
|
|
5568
5688
|
name: "trim",
|
|
5569
5689
|
description: "Trim evaluation results for baseline storage (strips debug/audit fields)",
|
|
@@ -5582,7 +5702,7 @@ var trimCommand = command({
|
|
|
5582
5702
|
},
|
|
5583
5703
|
handler: async ({ input, out }) => {
|
|
5584
5704
|
try {
|
|
5585
|
-
const content =
|
|
5705
|
+
const content = readFileSync7(input, "utf8");
|
|
5586
5706
|
const lines = content.trim().split("\n").filter((line) => line.trim());
|
|
5587
5707
|
const trimmedLines = lines.map((line) => {
|
|
5588
5708
|
const record = JSON.parse(line);
|
|
@@ -5594,7 +5714,7 @@ var trimCommand = command({
|
|
|
5594
5714
|
const output = `${trimmedLines.join("\n")}
|
|
5595
5715
|
`;
|
|
5596
5716
|
if (out) {
|
|
5597
|
-
|
|
5717
|
+
writeFileSync5(out, output, "utf8");
|
|
5598
5718
|
console.error(`Trimmed ${lines.length} record(s) \u2192 ${out}`);
|
|
5599
5719
|
} else {
|
|
5600
5720
|
process.stdout.write(output);
|
|
@@ -5689,7 +5809,7 @@ function isTTY() {
|
|
|
5689
5809
|
// src/commands/validate/validate-files.ts
|
|
5690
5810
|
import { constants } from "node:fs";
|
|
5691
5811
|
import { access, readdir, stat } from "node:fs/promises";
|
|
5692
|
-
import
|
|
5812
|
+
import path10 from "node:path";
|
|
5693
5813
|
async function validateFiles(paths) {
|
|
5694
5814
|
const filePaths = await expandPaths(paths);
|
|
5695
5815
|
const results = [];
|
|
@@ -5707,7 +5827,7 @@ async function validateFiles(paths) {
|
|
|
5707
5827
|
};
|
|
5708
5828
|
}
|
|
5709
5829
|
async function validateSingleFile(filePath) {
|
|
5710
|
-
const absolutePath =
|
|
5830
|
+
const absolutePath = path10.resolve(filePath);
|
|
5711
5831
|
const fileType = await detectFileType(absolutePath);
|
|
5712
5832
|
let result;
|
|
5713
5833
|
if (fileType === "eval") {
|
|
@@ -5732,7 +5852,7 @@ async function validateSingleFile(filePath) {
|
|
|
5732
5852
|
async function expandPaths(paths) {
|
|
5733
5853
|
const expanded = [];
|
|
5734
5854
|
for (const inputPath of paths) {
|
|
5735
|
-
const absolutePath =
|
|
5855
|
+
const absolutePath = path10.resolve(inputPath);
|
|
5736
5856
|
try {
|
|
5737
5857
|
await access(absolutePath, constants.F_OK);
|
|
5738
5858
|
} catch {
|
|
@@ -5756,7 +5876,7 @@ async function findYamlFiles(dirPath) {
|
|
|
5756
5876
|
try {
|
|
5757
5877
|
const entries2 = await readdir(dirPath, { withFileTypes: true });
|
|
5758
5878
|
for (const entry of entries2) {
|
|
5759
|
-
const fullPath =
|
|
5879
|
+
const fullPath = path10.join(dirPath, entry.name);
|
|
5760
5880
|
if (entry.isDirectory()) {
|
|
5761
5881
|
if (entry.name === "node_modules" || entry.name.startsWith(".")) {
|
|
5762
5882
|
continue;
|
|
@@ -5773,7 +5893,7 @@ async function findYamlFiles(dirPath) {
|
|
|
5773
5893
|
return results;
|
|
5774
5894
|
}
|
|
5775
5895
|
function isYamlFile(filePath) {
|
|
5776
|
-
const ext =
|
|
5896
|
+
const ext = path10.extname(filePath).toLowerCase();
|
|
5777
5897
|
return ext === ".yaml" || ext === ".yml";
|
|
5778
5898
|
}
|
|
5779
5899
|
|
|
@@ -5813,7 +5933,7 @@ var validateCommand = command({
|
|
|
5813
5933
|
// src/commands/workspace/clean.ts
|
|
5814
5934
|
import { existsSync as existsSync2 } from "node:fs";
|
|
5815
5935
|
import { readFile as readFile2, readdir as readdir2, rm } from "node:fs/promises";
|
|
5816
|
-
import
|
|
5936
|
+
import path11 from "node:path";
|
|
5817
5937
|
async function confirm(message) {
|
|
5818
5938
|
const readline2 = await import("node:readline");
|
|
5819
5939
|
const rl = readline2.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -5849,8 +5969,8 @@ var cleanCommand = command({
|
|
|
5849
5969
|
const poolDirs = entries2.filter((e) => e.isDirectory());
|
|
5850
5970
|
const matchingDirs = [];
|
|
5851
5971
|
for (const dir of poolDirs) {
|
|
5852
|
-
const poolDir =
|
|
5853
|
-
const metadataPath =
|
|
5972
|
+
const poolDir = path11.join(poolRoot, dir.name);
|
|
5973
|
+
const metadataPath = path11.join(poolDir, "metadata.json");
|
|
5854
5974
|
try {
|
|
5855
5975
|
const raw = await readFile2(metadataPath, "utf-8");
|
|
5856
5976
|
const metadata = JSON.parse(raw);
|
|
@@ -5881,7 +6001,7 @@ var cleanCommand = command({
|
|
|
5881
6001
|
}
|
|
5882
6002
|
for (const dir of matchingDirs) {
|
|
5883
6003
|
await rm(dir, { recursive: true, force: true });
|
|
5884
|
-
console.log(`Removed: ${
|
|
6004
|
+
console.log(`Removed: ${path11.basename(dir).slice(0, 12)}...`);
|
|
5885
6005
|
}
|
|
5886
6006
|
console.log("Done.");
|
|
5887
6007
|
} else {
|
|
@@ -5901,13 +6021,13 @@ var cleanCommand = command({
|
|
|
5901
6021
|
// src/commands/workspace/list.ts
|
|
5902
6022
|
import { existsSync as existsSync3 } from "node:fs";
|
|
5903
6023
|
import { readFile as readFile3, readdir as readdir3, stat as stat2 } from "node:fs/promises";
|
|
5904
|
-
import
|
|
6024
|
+
import path12 from "node:path";
|
|
5905
6025
|
async function getDirectorySize(dirPath) {
|
|
5906
6026
|
let totalSize = 0;
|
|
5907
6027
|
try {
|
|
5908
6028
|
const entries2 = await readdir3(dirPath, { withFileTypes: true });
|
|
5909
6029
|
for (const entry of entries2) {
|
|
5910
|
-
const fullPath =
|
|
6030
|
+
const fullPath = path12.join(dirPath, entry.name);
|
|
5911
6031
|
if (entry.isDirectory()) {
|
|
5912
6032
|
totalSize += await getDirectorySize(fullPath);
|
|
5913
6033
|
} else {
|
|
@@ -5942,11 +6062,11 @@ var listCommand = command({
|
|
|
5942
6062
|
return;
|
|
5943
6063
|
}
|
|
5944
6064
|
for (const dir of poolDirs) {
|
|
5945
|
-
const poolDir =
|
|
6065
|
+
const poolDir = path12.join(poolRoot, dir.name);
|
|
5946
6066
|
const fingerprint = dir.name;
|
|
5947
6067
|
const poolEntries = await readdir3(poolDir, { withFileTypes: true });
|
|
5948
6068
|
const slots = poolEntries.filter((e) => e.isDirectory() && e.name.startsWith("slot-"));
|
|
5949
|
-
const metadataPath =
|
|
6069
|
+
const metadataPath = path12.join(poolDir, "metadata.json");
|
|
5950
6070
|
let metadata = null;
|
|
5951
6071
|
try {
|
|
5952
6072
|
const raw = await readFile3(metadataPath, "utf-8");
|
|
@@ -5992,8 +6112,8 @@ var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
|
5992
6112
|
var AGENTV_DIR = getAgentvHome();
|
|
5993
6113
|
var CACHE_FILE = "version-check.json";
|
|
5994
6114
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/agentv/latest";
|
|
5995
|
-
async function getCachedUpdateInfo(
|
|
5996
|
-
const filePath =
|
|
6115
|
+
async function getCachedUpdateInfo(path13) {
|
|
6116
|
+
const filePath = path13 ?? join(AGENTV_DIR, CACHE_FILE);
|
|
5997
6117
|
try {
|
|
5998
6118
|
const raw = await readFile4(filePath, "utf-8");
|
|
5999
6119
|
const data = JSON.parse(raw);
|
|
@@ -6083,6 +6203,7 @@ var app = subcommands({
|
|
|
6083
6203
|
create: createCommand,
|
|
6084
6204
|
generate: generateCommand,
|
|
6085
6205
|
init: initCmdTsCommand,
|
|
6206
|
+
results: resultsCommand,
|
|
6086
6207
|
self: selfCommand,
|
|
6087
6208
|
trace: traceCommand,
|
|
6088
6209
|
transpile: transpileCommand,
|
|
@@ -6099,6 +6220,7 @@ var TOP_LEVEL_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
6099
6220
|
"create",
|
|
6100
6221
|
"generate",
|
|
6101
6222
|
"init",
|
|
6223
|
+
"results",
|
|
6102
6224
|
"self",
|
|
6103
6225
|
"trace",
|
|
6104
6226
|
"transpile",
|
|
@@ -6146,4 +6268,4 @@ export {
|
|
|
6146
6268
|
preprocessArgv,
|
|
6147
6269
|
runCli
|
|
6148
6270
|
};
|
|
6149
|
-
//# sourceMappingURL=chunk-
|
|
6271
|
+
//# sourceMappingURL=chunk-A7ZDUB46.js.map
|