@agentv/core 4.22.0 → 4.24.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-LKX4QW3G.js → chunk-4VLOUBFL.js} +11 -4
- package/dist/chunk-4VLOUBFL.js.map +1 -0
- package/dist/{chunk-B3BLJRYI.js → chunk-CUVG5O5P.js} +71 -26
- package/dist/chunk-CUVG5O5P.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +22 -19
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +14 -18
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +108 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -4
- package/dist/index.d.ts +22 -4
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/{ts-eval-loader-PA4YFM5D.js → ts-eval-loader-SYQYQPMC.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-B3BLJRYI.js.map +0 -1
- package/dist/chunk-LKX4QW3G.js.map +0 -1
- /package/dist/{ts-eval-loader-PA4YFM5D.js.map → ts-eval-loader-SYQYQPMC.js.map} +0 -0
|
@@ -10,20 +10,20 @@ import {
|
|
|
10
10
|
isGraderKind,
|
|
11
11
|
loadCasesFromDirectory,
|
|
12
12
|
loadCasesFromFile,
|
|
13
|
+
parseYamlValue,
|
|
13
14
|
resolveFileReference
|
|
14
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-4VLOUBFL.js";
|
|
15
16
|
|
|
16
17
|
// src/evaluation/validation/file-type.ts
|
|
17
18
|
import { readFile } from "node:fs/promises";
|
|
18
19
|
import path from "node:path";
|
|
19
|
-
import { parse } from "yaml";
|
|
20
20
|
var SCHEMA_EVAL_V2 = "agentv-eval-v2";
|
|
21
21
|
var SCHEMA_TARGETS_V2 = "agentv-targets-v2.2";
|
|
22
22
|
var SCHEMA_CONFIG_V2 = "agentv-config-v2";
|
|
23
23
|
async function detectFileType(filePath) {
|
|
24
24
|
try {
|
|
25
25
|
const content = await readFile(filePath, "utf8");
|
|
26
|
-
const parsed =
|
|
26
|
+
const parsed = parseYamlValue(content);
|
|
27
27
|
if (Array.isArray(parsed)) {
|
|
28
28
|
return "cases";
|
|
29
29
|
}
|
|
@@ -85,7 +85,6 @@ function getExpectedSchema(fileType) {
|
|
|
85
85
|
// src/evaluation/validation/eval-validator.ts
|
|
86
86
|
import { readFile as readFile2, readdir, stat } from "node:fs/promises";
|
|
87
87
|
import path2 from "node:path";
|
|
88
|
-
import { parse as parse2 } from "yaml";
|
|
89
88
|
var ASSERTION_TYPES_WITH_STRING_VALUE = /* @__PURE__ */ new Set([
|
|
90
89
|
"contains",
|
|
91
90
|
"icontains",
|
|
@@ -119,7 +118,9 @@ var KNOWN_TOP_LEVEL_FIELDS = /* @__PURE__ */ new Set([
|
|
|
119
118
|
"assertions",
|
|
120
119
|
"evaluators",
|
|
121
120
|
"preprocessors",
|
|
122
|
-
"workspace"
|
|
121
|
+
"workspace",
|
|
122
|
+
"metadata",
|
|
123
|
+
"governance"
|
|
123
124
|
]);
|
|
124
125
|
var DEPRECATED_TOP_LEVEL_FIELDS = /* @__PURE__ */ new Map([
|
|
125
126
|
["eval_cases", "'eval_cases' is deprecated. Use 'tests' instead."],
|
|
@@ -194,7 +195,7 @@ async function validateEvalFile(filePath) {
|
|
|
194
195
|
let parsed;
|
|
195
196
|
try {
|
|
196
197
|
const content = await readFile2(absolutePath, "utf8");
|
|
197
|
-
parsed = interpolateEnv(
|
|
198
|
+
parsed = interpolateEnv(parseYamlValue(content), process.env);
|
|
198
199
|
} catch (error) {
|
|
199
200
|
errors.push({
|
|
200
201
|
severity: "error",
|
|
@@ -470,7 +471,7 @@ async function validateWorkspaceConfig(workspace, evalFilePath, errors, location
|
|
|
470
471
|
const workspacePath = path2.resolve(path2.dirname(evalFilePath), workspace);
|
|
471
472
|
try {
|
|
472
473
|
const workspaceContent = await readFile2(workspacePath, "utf8");
|
|
473
|
-
const parsedWorkspace = interpolateEnv(
|
|
474
|
+
const parsedWorkspace = interpolateEnv(parseYamlValue(workspaceContent), process.env);
|
|
474
475
|
if (!isObject(parsedWorkspace)) {
|
|
475
476
|
errors.push({
|
|
476
477
|
severity: "error",
|
|
@@ -867,7 +868,6 @@ function validateConversationMode(evalCase, location, filePath, errors) {
|
|
|
867
868
|
// src/evaluation/validation/cases-validator.ts
|
|
868
869
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
869
870
|
import path3 from "node:path";
|
|
870
|
-
import { parse as parse3 } from "yaml";
|
|
871
871
|
function isObject2(value) {
|
|
872
872
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
873
873
|
}
|
|
@@ -877,7 +877,7 @@ async function validateCasesFile(filePath) {
|
|
|
877
877
|
let parsed;
|
|
878
878
|
try {
|
|
879
879
|
const content = await readFile3(absolutePath, "utf8");
|
|
880
|
-
parsed =
|
|
880
|
+
parsed = parseYamlValue(content);
|
|
881
881
|
} catch (error) {
|
|
882
882
|
errors.push({
|
|
883
883
|
severity: "error",
|
|
@@ -943,7 +943,6 @@ async function validateCasesFile(filePath) {
|
|
|
943
943
|
// src/evaluation/validation/targets-validator.ts
|
|
944
944
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
945
945
|
import path4 from "node:path";
|
|
946
|
-
import { parse as parse4 } from "yaml";
|
|
947
946
|
function isObject3(value) {
|
|
948
947
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
949
948
|
}
|
|
@@ -1171,7 +1170,7 @@ async function validateTargetsFile(filePath) {
|
|
|
1171
1170
|
let parsed;
|
|
1172
1171
|
try {
|
|
1173
1172
|
const content = await readFile4(absolutePath, "utf8");
|
|
1174
|
-
parsed =
|
|
1173
|
+
parsed = parseYamlValue(content);
|
|
1175
1174
|
} catch (error) {
|
|
1176
1175
|
errors.push({
|
|
1177
1176
|
severity: "error",
|
|
@@ -1385,12 +1384,11 @@ async function validateTargetsFile(filePath) {
|
|
|
1385
1384
|
|
|
1386
1385
|
// src/evaluation/validation/config-validator.ts
|
|
1387
1386
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
1388
|
-
import { parse as parse5 } from "yaml";
|
|
1389
1387
|
async function validateConfigFile(filePath) {
|
|
1390
1388
|
const errors = [];
|
|
1391
1389
|
try {
|
|
1392
1390
|
const content = await readFile5(filePath, "utf8");
|
|
1393
|
-
const parsed =
|
|
1391
|
+
const parsed = parseYamlValue(content);
|
|
1394
1392
|
if (typeof parsed !== "object" || parsed === null) {
|
|
1395
1393
|
errors.push({
|
|
1396
1394
|
severity: "error",
|
|
@@ -1528,7 +1526,6 @@ async function validateConfigFile(filePath) {
|
|
|
1528
1526
|
// src/evaluation/validation/file-reference-validator.ts
|
|
1529
1527
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
1530
1528
|
import path5 from "node:path";
|
|
1531
|
-
import { parse as parse6 } from "yaml";
|
|
1532
1529
|
function isObject4(value) {
|
|
1533
1530
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1534
1531
|
}
|
|
@@ -1548,7 +1545,7 @@ async function validateFileReferences(evalFilePath) {
|
|
|
1548
1545
|
let parsed;
|
|
1549
1546
|
try {
|
|
1550
1547
|
const content = await readFile6(absolutePath, "utf8");
|
|
1551
|
-
parsed =
|
|
1548
|
+
parsed = parseYamlValue(content);
|
|
1552
1549
|
} catch {
|
|
1553
1550
|
return errors;
|
|
1554
1551
|
}
|
|
@@ -1660,7 +1657,6 @@ async function validateMessagesFileRefs(messages, location, searchRoots, filePat
|
|
|
1660
1657
|
// src/evaluation/validation/workspace-path-validator.ts
|
|
1661
1658
|
import { access, readFile as readFile7 } from "node:fs/promises";
|
|
1662
1659
|
import path6 from "node:path";
|
|
1663
|
-
import { parse as parse7 } from "yaml";
|
|
1664
1660
|
function isObject5(value) {
|
|
1665
1661
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1666
1662
|
}
|
|
@@ -1671,7 +1667,7 @@ async function validateWorkspacePaths(evalFilePath) {
|
|
|
1671
1667
|
let parsed;
|
|
1672
1668
|
try {
|
|
1673
1669
|
const content = await readFile7(absolutePath, "utf8");
|
|
1674
|
-
parsed =
|
|
1670
|
+
parsed = parseYamlValue(content);
|
|
1675
1671
|
} catch {
|
|
1676
1672
|
return errors;
|
|
1677
1673
|
}
|
|
@@ -1682,7 +1678,7 @@ async function validateWorkspacePaths(evalFilePath) {
|
|
|
1682
1678
|
const workspaceFilePath = path6.resolve(evalDir, workspaceRaw);
|
|
1683
1679
|
try {
|
|
1684
1680
|
const wsContent = await readFile7(workspaceFilePath, "utf8");
|
|
1685
|
-
const wsParsed =
|
|
1681
|
+
const wsParsed = parseYamlValue(wsContent);
|
|
1686
1682
|
if (isObject5(wsParsed)) {
|
|
1687
1683
|
const wsDir = path6.dirname(workspaceFilePath);
|
|
1688
1684
|
await validateWorkspaceObject(wsParsed, wsDir, absolutePath, "workspace", errors);
|