@agentv/core 4.3.3 → 4.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.
@@ -268,6 +268,40 @@ var ASSERTION_TYPES_WITH_ARRAY_VALUE = /* @__PURE__ */ new Set([
268
268
  "icontains-all"
269
269
  ]);
270
270
  var VALID_TEST_FILE_EXTENSIONS = /* @__PURE__ */ new Set([".yaml", ".yml", ".jsonl"]);
271
+ var KNOWN_TOP_LEVEL_FIELDS = /* @__PURE__ */ new Set([
272
+ "$schema",
273
+ "name",
274
+ "description",
275
+ "version",
276
+ "author",
277
+ "tags",
278
+ "license",
279
+ "requires",
280
+ "input",
281
+ "input_files",
282
+ "tests",
283
+ "eval_cases",
284
+ "target",
285
+ "execution",
286
+ "assertions",
287
+ "evaluators",
288
+ "workspace"
289
+ ]);
290
+ var KNOWN_TEST_FIELDS = /* @__PURE__ */ new Set([
291
+ "id",
292
+ "criteria",
293
+ "input",
294
+ "input_files",
295
+ "expected_output",
296
+ "assertions",
297
+ "evaluators",
298
+ "execution",
299
+ "workspace",
300
+ "metadata",
301
+ "conversation_id",
302
+ "dataset",
303
+ "note"
304
+ ]);
271
305
  var NAME_PATTERN = /^[a-z0-9-]+$/;
272
306
  function isObject(value) {
273
307
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -306,6 +340,16 @@ async function validateEvalFile(filePath) {
306
340
  };
307
341
  }
308
342
  validateMetadata(parsed, absolutePath, errors);
343
+ for (const key of Object.keys(parsed)) {
344
+ if (!KNOWN_TOP_LEVEL_FIELDS.has(key)) {
345
+ errors.push({
346
+ severity: "warning",
347
+ filePath: absolutePath,
348
+ location: key,
349
+ message: `Unknown field '${key}'. This field will be ignored.`
350
+ });
351
+ }
352
+ }
309
353
  const suiteInput = parsed.input;
310
354
  if (suiteInput !== void 0) {
311
355
  if (typeof suiteInput === "string") {
@@ -394,6 +438,16 @@ async function validateEvalFile(filePath) {
394
438
  });
395
439
  continue;
396
440
  }
441
+ for (const key of Object.keys(evalCase)) {
442
+ if (!KNOWN_TEST_FIELDS.has(key)) {
443
+ errors.push({
444
+ severity: "warning",
445
+ filePath: absolutePath,
446
+ location: `${location}.${key}`,
447
+ message: `Unknown field '${key}'. This field will be ignored.`
448
+ });
449
+ }
450
+ }
397
451
  const id = evalCase.id;
398
452
  if (typeof id !== "string" || id.trim().length === 0) {
399
453
  errors.push({
@@ -403,16 +457,7 @@ async function validateEvalFile(filePath) {
403
457
  message: "Missing or invalid 'id' field (must be a non-empty string)"
404
458
  });
405
459
  }
406
- let criteria = evalCase.criteria;
407
- if (criteria === void 0 && "expected_outcome" in evalCase) {
408
- criteria = evalCase.expected_outcome;
409
- errors.push({
410
- severity: "warning",
411
- filePath: absolutePath,
412
- location: `${location}.expected_outcome`,
413
- message: "'expected_outcome' is deprecated. Use 'criteria' instead."
414
- });
415
- }
460
+ const criteria = evalCase.criteria;
416
461
  if (criteria !== void 0 && (typeof criteria !== "string" || criteria.trim().length === 0)) {
417
462
  errors.push({
418
463
  severity: "error",
@@ -464,7 +509,7 @@ async function validateEvalFile(filePath) {
464
509
  });
465
510
  }
466
511
  }
467
- const assertField = evalCase.assertions ?? evalCase.assert;
512
+ const assertField = evalCase.assertions;
468
513
  if (assertField !== void 0) {
469
514
  validateAssertArray(assertField, location, absolutePath, errors);
470
515
  }
@@ -1497,7 +1542,13 @@ async function validateConfigFile(filePath) {
1497
1542
  });
1498
1543
  }
1499
1544
  }
1500
- const allowedFields = /* @__PURE__ */ new Set(["$schema", "eval_patterns", "required_version", "execution"]);
1545
+ const allowedFields = /* @__PURE__ */ new Set([
1546
+ "$schema",
1547
+ "eval_patterns",
1548
+ "required_version",
1549
+ "execution",
1550
+ "studio"
1551
+ ]);
1501
1552
  const unexpectedFields = Object.keys(config).filter((key) => !allowedFields.has(key));
1502
1553
  if (unexpectedFields.length > 0) {
1503
1554
  errors.push({