agentv 4.28.0 → 4.29.0-next.1
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/{artifact-writer-WTMNQKPV.js → artifact-writer-RQXU4LZV.js} +3 -3
- package/dist/{chunk-NL5H3TIC.js → chunk-FEDIWLKK.js} +7 -7
- package/dist/chunk-FEDIWLKK.js.map +1 -0
- package/dist/{chunk-2WS3BEPV.js → chunk-GLJVO5PK.js} +165 -126
- package/dist/chunk-GLJVO5PK.js.map +1 -0
- package/dist/{chunk-7T6AF75O.js → chunk-OS67VZUO.js} +2 -2
- package/dist/{chunk-WZVOY2W2.js → chunk-VZMGBDJD.js} +109 -52
- package/dist/chunk-VZMGBDJD.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/{dist-VYHXTFO3.js → dist-HLU6WIYL.js} +24 -24
- package/dist/index.js +4 -4
- package/dist/{interactive-7R2K3CBY.js → interactive-5LEM6ITD.js} +4 -4
- package/dist/studio/assets/index-CIpCCDKl.css +1 -0
- package/dist/studio/assets/{index-DLabAPXU.js → index-DWPeWzK5.js} +1 -1
- package/dist/studio/assets/{index-inPa17Qe.js → index-LnuhQgnU.js} +21 -21
- package/dist/studio/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-2WS3BEPV.js.map +0 -1
- package/dist/chunk-NL5H3TIC.js.map +0 -1
- package/dist/chunk-WZVOY2W2.js.map +0 -1
- package/dist/studio/assets/index-BGFW04Lj.css +0 -1
- /package/dist/{artifact-writer-WTMNQKPV.js.map → artifact-writer-RQXU4LZV.js.map} +0 -0
- /package/dist/{chunk-7T6AF75O.js.map → chunk-OS67VZUO.js.map} +0 -0
- /package/dist/{dist-VYHXTFO3.js.map → dist-HLU6WIYL.js.map} +0 -0
- /package/dist/{interactive-7R2K3CBY.js.map → interactive-5LEM6ITD.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
toTranscriptJsonLines
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VZMGBDJD.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_THRESHOLD
|
|
7
7
|
} from "./chunk-VTOY4SMC.js";
|
|
@@ -726,4 +726,4 @@ export {
|
|
|
726
726
|
writePerTestArtifacts,
|
|
727
727
|
writeArtifactsFromResults
|
|
728
728
|
};
|
|
729
|
-
//# sourceMappingURL=chunk-
|
|
729
|
+
//# sourceMappingURL=chunk-OS67VZUO.js.map
|
|
@@ -27,7 +27,16 @@ import { cp, mkdtemp, readdir, rm, stat } from "node:fs/promises";
|
|
|
27
27
|
import os from "node:os";
|
|
28
28
|
import path4 from "node:path";
|
|
29
29
|
import { promisify } from "node:util";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
existsSync as existsSync2,
|
|
32
|
+
mkdirSync as mkdirSync2,
|
|
33
|
+
readFileSync as readFileSync3,
|
|
34
|
+
readdirSync,
|
|
35
|
+
renameSync,
|
|
36
|
+
statSync,
|
|
37
|
+
unlinkSync,
|
|
38
|
+
writeFileSync as writeFileSync2
|
|
39
|
+
} from "node:fs";
|
|
31
40
|
import path5 from "node:path";
|
|
32
41
|
import { stringify as stringifyYaml } from "yaml";
|
|
33
42
|
import * as childProcess from "node:child_process";
|
|
@@ -890,9 +899,56 @@ async function directPushResults(params) {
|
|
|
890
899
|
}
|
|
891
900
|
return false;
|
|
892
901
|
}
|
|
893
|
-
function
|
|
902
|
+
function getProjectsRegistryPath() {
|
|
903
|
+
return path5.join(getAgentvConfigDir(), "projects.yaml");
|
|
904
|
+
}
|
|
905
|
+
function getLegacyBenchmarksRegistryPath() {
|
|
894
906
|
return path5.join(getAgentvConfigDir(), "benchmarks.yaml");
|
|
895
907
|
}
|
|
908
|
+
function migrateLegacyBenchmarksFile() {
|
|
909
|
+
const newPath = getProjectsRegistryPath();
|
|
910
|
+
const oldPath = getLegacyBenchmarksRegistryPath();
|
|
911
|
+
const newExists = existsSync2(newPath);
|
|
912
|
+
const oldExists = existsSync2(oldPath);
|
|
913
|
+
if (!oldExists) return;
|
|
914
|
+
if (newExists) {
|
|
915
|
+
console.warn(
|
|
916
|
+
`[agentv] Both ${oldPath} and ${newPath} exist. Using ${path5.basename(newPath)}; delete ${path5.basename(oldPath)} when you've confirmed the new file is correct.`
|
|
917
|
+
);
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
let parsed = null;
|
|
921
|
+
try {
|
|
922
|
+
const raw = readFileSync3(oldPath, "utf-8");
|
|
923
|
+
parsed = parseYamlValue(raw);
|
|
924
|
+
} catch (err) {
|
|
925
|
+
console.warn(
|
|
926
|
+
`[agentv] Failed to read legacy ${path5.basename(oldPath)} for migration: ${err.message}. Leaving the file in place; you may need to migrate it manually.`
|
|
927
|
+
);
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
const entries = parsed && typeof parsed === "object" && Array.isArray(parsed.benchmarks) ? parsed.benchmarks : [];
|
|
931
|
+
const newContent = stringifyYaml({ projects: entries });
|
|
932
|
+
const tempPath = `${newPath}.migrating`;
|
|
933
|
+
try {
|
|
934
|
+
mkdirSync2(path5.dirname(newPath), { recursive: true });
|
|
935
|
+
writeFileSync2(tempPath, newContent, "utf-8");
|
|
936
|
+
renameSync(tempPath, newPath);
|
|
937
|
+
unlinkSync(oldPath);
|
|
938
|
+
} catch (err) {
|
|
939
|
+
try {
|
|
940
|
+
if (existsSync2(tempPath)) unlinkSync(tempPath);
|
|
941
|
+
} catch {
|
|
942
|
+
}
|
|
943
|
+
console.warn(
|
|
944
|
+
`[agentv] Failed to migrate ${path5.basename(oldPath)} \u2192 ${path5.basename(newPath)}: ${err.message}. Legacy file left in place.`
|
|
945
|
+
);
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
console.log(
|
|
949
|
+
`[agentv] Migrated registry: ${path5.basename(oldPath)} \u2192 ${path5.basename(newPath)} (${entries.length} entr${entries.length === 1 ? "y" : "ies"})`
|
|
950
|
+
);
|
|
951
|
+
}
|
|
896
952
|
function fromYaml(raw) {
|
|
897
953
|
if (!raw || typeof raw !== "object") return null;
|
|
898
954
|
const e = raw;
|
|
@@ -927,36 +983,37 @@ function toYaml(entry) {
|
|
|
927
983
|
}
|
|
928
984
|
return yaml;
|
|
929
985
|
}
|
|
930
|
-
function
|
|
931
|
-
|
|
986
|
+
function loadProjectRegistry() {
|
|
987
|
+
migrateLegacyBenchmarksFile();
|
|
988
|
+
const registryPath = getProjectsRegistryPath();
|
|
932
989
|
if (!existsSync2(registryPath)) {
|
|
933
|
-
return {
|
|
990
|
+
return { projects: [] };
|
|
934
991
|
}
|
|
935
992
|
try {
|
|
936
993
|
const raw = readFileSync3(registryPath, "utf-8");
|
|
937
994
|
const parsed = parseYamlValue(raw);
|
|
938
995
|
if (!parsed || typeof parsed !== "object") {
|
|
939
|
-
return {
|
|
996
|
+
return { projects: [] };
|
|
940
997
|
}
|
|
941
998
|
const env = process.env;
|
|
942
|
-
const
|
|
943
|
-
return {
|
|
999
|
+
const projects = Array.isArray(parsed.projects) ? parsed.projects.map((e) => fromYaml(interpolateEnv(e, env))).filter((e) => e !== null) : [];
|
|
1000
|
+
return { projects };
|
|
944
1001
|
} catch {
|
|
945
|
-
return {
|
|
1002
|
+
return { projects: [] };
|
|
946
1003
|
}
|
|
947
1004
|
}
|
|
948
|
-
function
|
|
949
|
-
const registryPath =
|
|
1005
|
+
function saveProjectRegistry(registry) {
|
|
1006
|
+
const registryPath = getProjectsRegistryPath();
|
|
950
1007
|
const dir = path5.dirname(registryPath);
|
|
951
1008
|
if (!existsSync2(dir)) {
|
|
952
1009
|
mkdirSync2(dir, { recursive: true });
|
|
953
1010
|
}
|
|
954
|
-
const payload = {
|
|
1011
|
+
const payload = { projects: registry.projects.map(toYaml) };
|
|
955
1012
|
writeFileSync2(registryPath, stringifyYaml(payload), "utf-8");
|
|
956
1013
|
}
|
|
957
|
-
function
|
|
1014
|
+
function deriveProjectId(dirPath, existingIds) {
|
|
958
1015
|
const base = path5.basename(dirPath).toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
959
|
-
let candidate = base || "
|
|
1016
|
+
let candidate = base || "project";
|
|
960
1017
|
let suffix = 2;
|
|
961
1018
|
while (existingIds.includes(candidate)) {
|
|
962
1019
|
candidate = `${base}-${suffix}`;
|
|
@@ -964,54 +1021,54 @@ function deriveBenchmarkId(dirPath, existingIds) {
|
|
|
964
1021
|
}
|
|
965
1022
|
return candidate;
|
|
966
1023
|
}
|
|
967
|
-
function
|
|
968
|
-
const absPath = path5.resolve(
|
|
1024
|
+
function addProject(projectPath) {
|
|
1025
|
+
const absPath = path5.resolve(projectPath);
|
|
969
1026
|
if (!existsSync2(absPath)) {
|
|
970
1027
|
throw new Error(`Directory not found: ${absPath}`);
|
|
971
1028
|
}
|
|
972
1029
|
if (!existsSync2(path5.join(absPath, ".agentv"))) {
|
|
973
1030
|
throw new Error(`No .agentv/ directory found in ${absPath}. Run an evaluation first.`);
|
|
974
1031
|
}
|
|
975
|
-
const registry =
|
|
976
|
-
const existing = registry.
|
|
1032
|
+
const registry = loadProjectRegistry();
|
|
1033
|
+
const existing = registry.projects.find((p) => p.path === absPath);
|
|
977
1034
|
if (existing) {
|
|
978
1035
|
return existing;
|
|
979
1036
|
}
|
|
980
1037
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
981
1038
|
const entry = {
|
|
982
|
-
id:
|
|
1039
|
+
id: deriveProjectId(
|
|
983
1040
|
absPath,
|
|
984
|
-
registry.
|
|
1041
|
+
registry.projects.map((p) => p.id)
|
|
985
1042
|
),
|
|
986
1043
|
name: path5.basename(absPath),
|
|
987
1044
|
path: absPath,
|
|
988
1045
|
addedAt: now,
|
|
989
1046
|
lastOpenedAt: now
|
|
990
1047
|
};
|
|
991
|
-
registry.
|
|
992
|
-
|
|
1048
|
+
registry.projects.push(entry);
|
|
1049
|
+
saveProjectRegistry(registry);
|
|
993
1050
|
return entry;
|
|
994
1051
|
}
|
|
995
|
-
function
|
|
996
|
-
const registry =
|
|
997
|
-
const idx = registry.
|
|
1052
|
+
function removeProject(projectId) {
|
|
1053
|
+
const registry = loadProjectRegistry();
|
|
1054
|
+
const idx = registry.projects.findIndex((p) => p.id === projectId);
|
|
998
1055
|
if (idx < 0) return false;
|
|
999
|
-
registry.
|
|
1000
|
-
|
|
1056
|
+
registry.projects.splice(idx, 1);
|
|
1057
|
+
saveProjectRegistry(registry);
|
|
1001
1058
|
return true;
|
|
1002
1059
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return
|
|
1060
|
+
function getProject(projectId) {
|
|
1061
|
+
return loadProjectRegistry().projects.find((p) => p.id === projectId);
|
|
1005
1062
|
}
|
|
1006
|
-
function
|
|
1007
|
-
const registry =
|
|
1008
|
-
const entry = registry.
|
|
1063
|
+
function touchProject(projectId) {
|
|
1064
|
+
const registry = loadProjectRegistry();
|
|
1065
|
+
const entry = registry.projects.find((p) => p.id === projectId);
|
|
1009
1066
|
if (entry) {
|
|
1010
1067
|
entry.lastOpenedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1011
|
-
|
|
1068
|
+
saveProjectRegistry(registry);
|
|
1012
1069
|
}
|
|
1013
1070
|
}
|
|
1014
|
-
function
|
|
1071
|
+
function discoverProjects(rootDir, maxDepth = 2) {
|
|
1015
1072
|
const absRoot = path5.resolve(rootDir);
|
|
1016
1073
|
if (!existsSync2(absRoot) || !statSync(absRoot).isDirectory()) {
|
|
1017
1074
|
return [];
|
|
@@ -1037,9 +1094,9 @@ function discoverBenchmarks(rootDir, maxDepth = 2) {
|
|
|
1037
1094
|
scan(absRoot, 0);
|
|
1038
1095
|
return results.sort();
|
|
1039
1096
|
}
|
|
1040
|
-
async function
|
|
1097
|
+
async function syncProject(entry) {
|
|
1041
1098
|
if (!entry.source) {
|
|
1042
|
-
throw new Error(`
|
|
1099
|
+
throw new Error(`Project '${entry.id}' has no source defined`);
|
|
1043
1100
|
}
|
|
1044
1101
|
const { url, ref } = entry.source;
|
|
1045
1102
|
const dest = entry.path;
|
|
@@ -1053,12 +1110,12 @@ async function syncBenchmark(entry) {
|
|
|
1053
1110
|
);
|
|
1054
1111
|
}
|
|
1055
1112
|
}
|
|
1056
|
-
async function
|
|
1113
|
+
async function syncProjects(entries) {
|
|
1057
1114
|
for (const entry of entries) {
|
|
1058
1115
|
if (!entry.source) continue;
|
|
1059
|
-
console.log(`Syncing
|
|
1060
|
-
await
|
|
1061
|
-
console.log(`
|
|
1116
|
+
console.log(`Syncing project '${entry.id}' from ${entry.source.url}...`);
|
|
1117
|
+
await syncProject(entry);
|
|
1118
|
+
console.log(`Project '${entry.id}' synced.`);
|
|
1062
1119
|
}
|
|
1063
1120
|
}
|
|
1064
1121
|
var STRIPPED_TOP_LEVEL_FIELDS = /* @__PURE__ */ new Set([
|
|
@@ -2313,17 +2370,17 @@ export {
|
|
|
2313
2370
|
pushResultsRepoBranch,
|
|
2314
2371
|
createDraftResultsPr,
|
|
2315
2372
|
directPushResults,
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2373
|
+
getProjectsRegistryPath,
|
|
2374
|
+
loadProjectRegistry,
|
|
2375
|
+
saveProjectRegistry,
|
|
2376
|
+
deriveProjectId,
|
|
2377
|
+
addProject,
|
|
2378
|
+
removeProject,
|
|
2379
|
+
getProject,
|
|
2380
|
+
touchProject,
|
|
2381
|
+
discoverProjects,
|
|
2382
|
+
syncProject,
|
|
2383
|
+
syncProjects,
|
|
2327
2384
|
trimBaselineResult,
|
|
2328
2385
|
DEFAULT_CATEGORY,
|
|
2329
2386
|
deriveCategory,
|
|
@@ -2344,4 +2401,4 @@ export {
|
|
|
2344
2401
|
TranscriptProvider,
|
|
2345
2402
|
createAgentKernel
|
|
2346
2403
|
};
|
|
2347
|
-
//# sourceMappingURL=chunk-
|
|
2404
|
+
//# sourceMappingURL=chunk-VZMGBDJD.js.map
|