@agentv/core 2.7.1-next.4 → 2.7.1-next.6

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.
@@ -174,6 +174,20 @@ async function validateEvalFile(filePath) {
174
174
  };
175
175
  }
176
176
  validateMetadata(parsed, absolutePath, errors);
177
+ const suiteInput = parsed.input;
178
+ if (suiteInput !== void 0) {
179
+ if (typeof suiteInput === "string") {
180
+ } else if (Array.isArray(suiteInput)) {
181
+ validateMessages(suiteInput, "input", absolutePath, errors);
182
+ } else {
183
+ errors.push({
184
+ severity: "error",
185
+ filePath: absolutePath,
186
+ location: "input",
187
+ message: "Invalid suite-level 'input' field (must be a string or array of messages)"
188
+ });
189
+ }
190
+ }
177
191
  let cases = parsed.tests;
178
192
  if (cases === void 0 && "eval_cases" in parsed) {
179
193
  cases = parsed.eval_cases;
@@ -534,27 +548,25 @@ var import_yaml3 = require("yaml");
534
548
  var import_node_path3 = __toESM(require("path"), 1);
535
549
  var import_zod = require("zod");
536
550
  var CliHealthcheckHttpInputSchema = import_zod.z.object({
537
- type: import_zod.z.literal("http"),
538
551
  url: import_zod.z.string().min(1, "healthcheck URL is required"),
539
552
  timeout_seconds: import_zod.z.number().positive().optional(),
540
553
  timeoutSeconds: import_zod.z.number().positive().optional()
541
554
  });
542
555
  var CliHealthcheckCommandInputSchema = import_zod.z.object({
543
- type: import_zod.z.literal("command"),
544
- command_template: import_zod.z.string().optional(),
545
- commandTemplate: import_zod.z.string().optional(),
556
+ command: import_zod.z.string().min(1, "healthcheck command is required"),
546
557
  cwd: import_zod.z.string().optional(),
547
558
  timeout_seconds: import_zod.z.number().positive().optional(),
548
559
  timeoutSeconds: import_zod.z.number().positive().optional()
549
560
  });
550
- var CliHealthcheckInputSchema = import_zod.z.discriminatedUnion("type", [
561
+ var CliHealthcheckInputSchema = import_zod.z.union([
551
562
  CliHealthcheckHttpInputSchema,
552
563
  CliHealthcheckCommandInputSchema
553
564
  ]);
554
565
  var CliTargetInputSchema = import_zod.z.object({
555
566
  name: import_zod.z.string().min(1, "target name is required"),
556
567
  provider: import_zod.z.string().refine((p) => p.toLowerCase() === "cli", { message: "provider must be 'cli'" }),
557
- // Command template - required (accept both naming conventions)
568
+ // Command - required (accept both naming conventions)
569
+ command: import_zod.z.string().optional(),
558
570
  command_template: import_zod.z.string().optional(),
559
571
  commandTemplate: import_zod.z.string().optional(),
560
572
  // Files format - optional
@@ -586,26 +598,27 @@ var CliTargetInputSchema = import_zod.z.object({
586
598
  workers: import_zod.z.number().int().min(1).optional(),
587
599
  provider_batching: import_zod.z.boolean().optional(),
588
600
  providerBatching: import_zod.z.boolean().optional()
589
- }).refine((data) => data.command_template !== void 0 || data.commandTemplate !== void 0, {
590
- message: "Either command_template or commandTemplate is required"
591
- });
601
+ }).refine(
602
+ (data) => data.command !== void 0 || data.command_template !== void 0 || data.commandTemplate !== void 0,
603
+ {
604
+ message: "'command' is required"
605
+ }
606
+ );
592
607
  var CliHealthcheckHttpSchema = import_zod.z.object({
593
- type: import_zod.z.literal("http"),
594
608
  url: import_zod.z.string().min(1),
595
609
  timeoutMs: import_zod.z.number().positive().optional()
596
610
  }).strict();
597
611
  var CliHealthcheckCommandSchema = import_zod.z.object({
598
- type: import_zod.z.literal("command"),
599
- commandTemplate: import_zod.z.string().min(1),
612
+ command: import_zod.z.string().min(1),
600
613
  cwd: import_zod.z.string().optional(),
601
614
  timeoutMs: import_zod.z.number().positive().optional()
602
615
  }).strict();
603
- var CliHealthcheckSchema = import_zod.z.discriminatedUnion("type", [
616
+ var CliHealthcheckSchema = import_zod.z.union([
604
617
  CliHealthcheckHttpSchema,
605
618
  CliHealthcheckCommandSchema
606
619
  ]);
607
620
  var CliTargetConfigSchema = import_zod.z.object({
608
- commandTemplate: import_zod.z.string().min(1),
621
+ command: import_zod.z.string().min(1),
609
622
  filesFormat: import_zod.z.string().optional(),
610
623
  cwd: import_zod.z.string().optional(),
611
624
  workspaceTemplate: import_zod.z.string().optional(),
@@ -616,6 +629,7 @@ var CliTargetConfigSchema = import_zod.z.object({
616
629
  }).strict();
617
630
  var CLI_PLACEHOLDERS = /* @__PURE__ */ new Set([
618
631
  "PROMPT",
632
+ "PROMPT_FILE",
619
633
  "GUIDELINES",
620
634
  "EVAL_ID",
621
635
  "ATTEMPT",
@@ -897,21 +911,16 @@ async function validateTargetsFile(filePath) {
897
911
  };
898
912
  }
899
913
  function validateCliSettings(target, absolutePath2, location, errors2) {
900
- const commandTemplate = target.command_template ?? target.commandTemplate;
901
- if (typeof commandTemplate !== "string" || commandTemplate.trim().length === 0) {
914
+ const command = target.command ?? target.command_template ?? target.commandTemplate;
915
+ if (typeof command !== "string" || command.trim().length === 0) {
902
916
  errors2.push({
903
917
  severity: "error",
904
918
  filePath: absolutePath2,
905
- location: `${location}.commandTemplate`,
906
- message: "CLI provider requires 'command_template' or 'commandTemplate' as a non-empty string"
919
+ location: `${location}.command`,
920
+ message: "CLI provider requires 'command' as a non-empty string"
907
921
  });
908
922
  } else {
909
- recordUnknownPlaceholders(
910
- commandTemplate,
911
- absolutePath2,
912
- `${location}.commandTemplate`,
913
- errors2
914
- );
923
+ recordUnknownPlaceholders(command, absolutePath2, `${location}.command`, errors2);
915
924
  }
916
925
  const healthcheck = target.healthcheck;
917
926
  if (healthcheck !== void 0) {
@@ -928,16 +937,6 @@ async function validateTargetsFile(filePath) {
928
937
  });
929
938
  return;
930
939
  }
931
- const type = healthcheck.type;
932
- if (type !== "http" && type !== "command") {
933
- errors2.push({
934
- severity: "error",
935
- filePath: absolutePath2,
936
- location: `${location}.type`,
937
- message: "healthcheck.type must be either 'http' or 'command'"
938
- });
939
- return;
940
- }
941
940
  const timeoutSeconds = healthcheck.timeout_seconds ?? healthcheck.timeoutSeconds;
942
941
  if (timeoutSeconds !== void 0) {
943
942
  const numericTimeout = Number(timeoutSeconds);
@@ -950,34 +949,26 @@ async function validateTargetsFile(filePath) {
950
949
  });
951
950
  }
952
951
  }
953
- if (type === "http") {
954
- const url = healthcheck.url;
955
- if (typeof url !== "string" || url.trim().length === 0) {
956
- errors2.push({
957
- severity: "error",
958
- filePath: absolutePath2,
959
- location: `${location}.url`,
960
- message: "healthcheck.url must be a non-empty string for http checks"
961
- });
962
- }
963
- return;
964
- }
965
- const commandTemplate = healthcheck.command_template ?? healthcheck.commandTemplate;
966
- if (typeof commandTemplate !== "string" || commandTemplate.trim().length === 0) {
952
+ const hasUrl = typeof healthcheck.url === "string" && healthcheck.url.trim().length > 0;
953
+ const hasCommand = typeof healthcheck.command === "string" && healthcheck.command.trim().length > 0;
954
+ if (!hasUrl && !hasCommand) {
967
955
  errors2.push({
968
956
  severity: "error",
969
957
  filePath: absolutePath2,
970
- location: `${location}.commandTemplate`,
971
- message: "healthcheck.commandTemplate must be a non-empty string for command checks"
958
+ location,
959
+ message: "healthcheck must have either 'url' (HTTP) or 'command' (command)"
972
960
  });
973
- } else {
974
- recordUnknownPlaceholders(
975
- commandTemplate,
976
- absolutePath2,
977
- `${location}.commandTemplate`,
978
- errors2
979
- );
961
+ return;
962
+ }
963
+ if (hasUrl) {
964
+ return;
980
965
  }
966
+ recordUnknownPlaceholders(
967
+ healthcheck.command,
968
+ absolutePath2,
969
+ `${location}.command`,
970
+ errors2
971
+ );
981
972
  const cwd = healthcheck.cwd;
982
973
  if (cwd !== void 0 && typeof cwd !== "string") {
983
974
  errors2.push({