@agentv/core 4.20.0-next.1 → 4.21.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/{chunk-24ND5HZC.js → chunk-LKX4QW3G.js} +60 -2
- package/dist/{chunk-24ND5HZC.js.map → chunk-LKX4QW3G.js.map} +1 -1
- package/dist/{chunk-ELF6SQAK.js → chunk-WCW3V6QJ.js} +28 -17
- package/dist/chunk-WCW3V6QJ.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +94 -8
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +40 -10
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +104 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -8
- package/dist/index.d.ts +23 -8
- package/dist/index.js +32 -27
- package/dist/index.js.map +1 -1
- package/dist/{ts-eval-loader-32COE32J.js → ts-eval-loader-HPIPE72C.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-ELF6SQAK.js.map +0 -1
- /package/dist/{ts-eval-loader-32COE32J.js.map → ts-eval-loader-HPIPE72C.js.map} +0 -0
|
@@ -11,11 +11,12 @@ import {
|
|
|
11
11
|
isGraderKind,
|
|
12
12
|
isJsonObject,
|
|
13
13
|
isTestMessage,
|
|
14
|
+
loadCasesFromDirectory,
|
|
14
15
|
loadCasesFromFile,
|
|
15
16
|
readTextFile,
|
|
16
17
|
resolveDelegatedTargetDefinition,
|
|
17
18
|
resolveTargetDefinition
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LKX4QW3G.js";
|
|
19
20
|
import {
|
|
20
21
|
execFileWithStdin,
|
|
21
22
|
execShellWithStdin
|
|
@@ -125,7 +126,7 @@ function negateScore(score) {
|
|
|
125
126
|
import { execFile as execFile3 } from "node:child_process";
|
|
126
127
|
import { createHash as createHash2, randomUUID as randomUUID9 } from "node:crypto";
|
|
127
128
|
import { existsSync as existsSync5 } from "node:fs";
|
|
128
|
-
import { copyFile as copyFile2, mkdir as mkdir14, readdir as readdir8, stat as
|
|
129
|
+
import { copyFile as copyFile2, mkdir as mkdir14, readdir as readdir8, stat as stat9 } from "node:fs/promises";
|
|
129
130
|
import path44 from "node:path";
|
|
130
131
|
import { promisify as promisify7 } from "node:util";
|
|
131
132
|
import micromatch3 from "micromatch";
|
|
@@ -2123,11 +2124,11 @@ function createFilesystemTools(workspacePath) {
|
|
|
2123
2124
|
execute: async (input) => {
|
|
2124
2125
|
try {
|
|
2125
2126
|
const resolved = resolveSandboxed(workspacePath, input.path);
|
|
2126
|
-
const
|
|
2127
|
-
if (
|
|
2127
|
+
const stat10 = await fs.stat(resolved);
|
|
2128
|
+
if (stat10.isDirectory()) {
|
|
2128
2129
|
return { error: `'${input.path}' is a directory, not a file` };
|
|
2129
2130
|
}
|
|
2130
|
-
const buffer = Buffer.alloc(Math.min(
|
|
2131
|
+
const buffer = Buffer.alloc(Math.min(stat10.size, MAX_FILE_SIZE));
|
|
2131
2132
|
const fd = await fs.open(resolved, "r");
|
|
2132
2133
|
try {
|
|
2133
2134
|
await fd.read(buffer, 0, buffer.length, 0);
|
|
@@ -2135,8 +2136,8 @@ function createFilesystemTools(workspacePath) {
|
|
|
2135
2136
|
await fd.close();
|
|
2136
2137
|
}
|
|
2137
2138
|
const content = buffer.toString("utf-8");
|
|
2138
|
-
const truncated =
|
|
2139
|
-
return { content, truncated, size:
|
|
2139
|
+
const truncated = stat10.size > MAX_FILE_SIZE;
|
|
2140
|
+
return { content, truncated, size: stat10.size };
|
|
2140
2141
|
} catch (error) {
|
|
2141
2142
|
return { error: error instanceof Error ? error.message : String(error) };
|
|
2142
2143
|
}
|
|
@@ -2187,8 +2188,8 @@ async function searchDirectory(dirPath, workspacePath, regex, matches) {
|
|
|
2187
2188
|
const ext = path3.extname(entry.name).toLowerCase();
|
|
2188
2189
|
if (BINARY_EXTENSIONS.has(ext)) continue;
|
|
2189
2190
|
try {
|
|
2190
|
-
const
|
|
2191
|
-
if (
|
|
2191
|
+
const stat10 = await fs.stat(fullPath);
|
|
2192
|
+
if (stat10.size > MAX_FILE_SIZE) continue;
|
|
2192
2193
|
const content = await fs.readFile(fullPath, "utf-8");
|
|
2193
2194
|
const lines = content.split("\n");
|
|
2194
2195
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -12799,7 +12800,7 @@ async function executeWorkspaceScript(config, context, failureMode = "fatal") {
|
|
|
12799
12800
|
}
|
|
12800
12801
|
|
|
12801
12802
|
// src/evaluation/yaml-parser.ts
|
|
12802
|
-
import { readFile as readFile15 } from "node:fs/promises";
|
|
12803
|
+
import { readFile as readFile15, stat as stat8 } from "node:fs/promises";
|
|
12803
12804
|
import path43 from "node:path";
|
|
12804
12805
|
import micromatch2 from "micromatch";
|
|
12805
12806
|
import { parse as parse4 } from "yaml";
|
|
@@ -16090,7 +16091,7 @@ async function loadTestSuite(evalFilePath, repoRoot, options) {
|
|
|
16090
16091
|
return { tests: await loadTestsFromAgentSkills(evalFilePath) };
|
|
16091
16092
|
}
|
|
16092
16093
|
if (format === "typescript") {
|
|
16093
|
-
const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-
|
|
16094
|
+
const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-HPIPE72C.js");
|
|
16094
16095
|
return loadTsEvalSuite2(evalFilePath, resolveToAbsolutePath(repoRoot), options);
|
|
16095
16096
|
}
|
|
16096
16097
|
const { tests, parsed, suiteWorkspacePath } = await loadTestsFromYaml(
|
|
@@ -16125,7 +16126,7 @@ async function loadTests(evalFilePath, repoRoot, options) {
|
|
|
16125
16126
|
return loadTestsFromAgentSkills(evalFilePath);
|
|
16126
16127
|
}
|
|
16127
16128
|
if (format === "typescript") {
|
|
16128
|
-
const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-
|
|
16129
|
+
const { loadTsEvalSuite: loadTsEvalSuite2 } = await import("./ts-eval-loader-HPIPE72C.js");
|
|
16129
16130
|
const suite = await loadTsEvalSuite2(evalFilePath, resolveToAbsolutePath(repoRoot), options);
|
|
16130
16131
|
return suite.tests;
|
|
16131
16132
|
}
|
|
@@ -16161,7 +16162,17 @@ async function loadTestsFromYaml(evalFilePath, repoRoot, options) {
|
|
|
16161
16162
|
let expandedTestCases;
|
|
16162
16163
|
if (typeof rawTestCases === "string") {
|
|
16163
16164
|
const externalPath = path43.resolve(evalFileDir, rawTestCases);
|
|
16164
|
-
|
|
16165
|
+
let isDir = false;
|
|
16166
|
+
try {
|
|
16167
|
+
const pathStat = await stat8(externalPath);
|
|
16168
|
+
isDir = pathStat.isDirectory();
|
|
16169
|
+
} catch {
|
|
16170
|
+
}
|
|
16171
|
+
if (isDir) {
|
|
16172
|
+
expandedTestCases = await loadCasesFromDirectory(externalPath);
|
|
16173
|
+
} else {
|
|
16174
|
+
expandedTestCases = await loadCasesFromFile(externalPath);
|
|
16175
|
+
}
|
|
16165
16176
|
} else if (Array.isArray(rawTestCases)) {
|
|
16166
16177
|
expandedTestCases = await expandFileReferences(rawTestCases, evalFileDir);
|
|
16167
16178
|
} else {
|
|
@@ -16980,7 +16991,7 @@ async function runEvaluation(options) {
|
|
|
16980
16991
|
let staticMaterialised = false;
|
|
16981
16992
|
const isYamlConfiguredPath = !cliWorkspacePath && !!yamlWorkspacePath;
|
|
16982
16993
|
if (useStaticWorkspace && configuredStaticPath) {
|
|
16983
|
-
const dirExists = await
|
|
16994
|
+
const dirExists = await stat9(configuredStaticPath).then(
|
|
16984
16995
|
(s) => s.isDirectory(),
|
|
16985
16996
|
() => false
|
|
16986
16997
|
);
|
|
@@ -17076,7 +17087,7 @@ async function runEvaluation(options) {
|
|
|
17076
17087
|
if (suiteWorkspaceFile && sharedWorkspacePath) {
|
|
17077
17088
|
const copiedWorkspaceFile = path44.join(sharedWorkspacePath, path44.basename(suiteWorkspaceFile));
|
|
17078
17089
|
try {
|
|
17079
|
-
await
|
|
17090
|
+
await stat9(copiedWorkspaceFile);
|
|
17080
17091
|
suiteWorkspaceFile = copiedWorkspaceFile;
|
|
17081
17092
|
} catch {
|
|
17082
17093
|
}
|
|
@@ -17853,7 +17864,7 @@ async function runEvalCase(options) {
|
|
|
17853
17864
|
if (caseWorkspaceFile && workspacePath) {
|
|
17854
17865
|
const copiedFile = path44.join(workspacePath, path44.basename(caseWorkspaceFile));
|
|
17855
17866
|
try {
|
|
17856
|
-
await
|
|
17867
|
+
await stat9(copiedFile);
|
|
17857
17868
|
caseWorkspaceFile = copiedFile;
|
|
17858
17869
|
} catch {
|
|
17859
17870
|
}
|
|
@@ -19876,4 +19887,4 @@ export {
|
|
|
19876
19887
|
loadTestById,
|
|
19877
19888
|
loadEvalCaseById
|
|
19878
19889
|
};
|
|
19879
|
-
//# sourceMappingURL=chunk-
|
|
19890
|
+
//# sourceMappingURL=chunk-WCW3V6QJ.js.map
|