@agentv/core 2.7.1-next.5 → 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.
@@ -548,27 +548,25 @@ var import_yaml3 = require("yaml");
548
548
  var import_node_path3 = __toESM(require("path"), 1);
549
549
  var import_zod = require("zod");
550
550
  var CliHealthcheckHttpInputSchema = import_zod.z.object({
551
- type: import_zod.z.literal("http"),
552
551
  url: import_zod.z.string().min(1, "healthcheck URL is required"),
553
552
  timeout_seconds: import_zod.z.number().positive().optional(),
554
553
  timeoutSeconds: import_zod.z.number().positive().optional()
555
554
  });
556
555
  var CliHealthcheckCommandInputSchema = import_zod.z.object({
557
- type: import_zod.z.literal("command"),
558
- command_template: import_zod.z.string().optional(),
559
- commandTemplate: import_zod.z.string().optional(),
556
+ command: import_zod.z.string().min(1, "healthcheck command is required"),
560
557
  cwd: import_zod.z.string().optional(),
561
558
  timeout_seconds: import_zod.z.number().positive().optional(),
562
559
  timeoutSeconds: import_zod.z.number().positive().optional()
563
560
  });
564
- var CliHealthcheckInputSchema = import_zod.z.discriminatedUnion("type", [
561
+ var CliHealthcheckInputSchema = import_zod.z.union([
565
562
  CliHealthcheckHttpInputSchema,
566
563
  CliHealthcheckCommandInputSchema
567
564
  ]);
568
565
  var CliTargetInputSchema = import_zod.z.object({
569
566
  name: import_zod.z.string().min(1, "target name is required"),
570
567
  provider: import_zod.z.string().refine((p) => p.toLowerCase() === "cli", { message: "provider must be 'cli'" }),
571
- // Command template - required (accept both naming conventions)
568
+ // Command - required (accept both naming conventions)
569
+ command: import_zod.z.string().optional(),
572
570
  command_template: import_zod.z.string().optional(),
573
571
  commandTemplate: import_zod.z.string().optional(),
574
572
  // Files format - optional
@@ -600,26 +598,27 @@ var CliTargetInputSchema = import_zod.z.object({
600
598
  workers: import_zod.z.number().int().min(1).optional(),
601
599
  provider_batching: import_zod.z.boolean().optional(),
602
600
  providerBatching: import_zod.z.boolean().optional()
603
- }).refine((data) => data.command_template !== void 0 || data.commandTemplate !== void 0, {
604
- message: "Either command_template or commandTemplate is required"
605
- });
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
+ );
606
607
  var CliHealthcheckHttpSchema = import_zod.z.object({
607
- type: import_zod.z.literal("http"),
608
608
  url: import_zod.z.string().min(1),
609
609
  timeoutMs: import_zod.z.number().positive().optional()
610
610
  }).strict();
611
611
  var CliHealthcheckCommandSchema = import_zod.z.object({
612
- type: import_zod.z.literal("command"),
613
- commandTemplate: import_zod.z.string().min(1),
612
+ command: import_zod.z.string().min(1),
614
613
  cwd: import_zod.z.string().optional(),
615
614
  timeoutMs: import_zod.z.number().positive().optional()
616
615
  }).strict();
617
- var CliHealthcheckSchema = import_zod.z.discriminatedUnion("type", [
616
+ var CliHealthcheckSchema = import_zod.z.union([
618
617
  CliHealthcheckHttpSchema,
619
618
  CliHealthcheckCommandSchema
620
619
  ]);
621
620
  var CliTargetConfigSchema = import_zod.z.object({
622
- commandTemplate: import_zod.z.string().min(1),
621
+ command: import_zod.z.string().min(1),
623
622
  filesFormat: import_zod.z.string().optional(),
624
623
  cwd: import_zod.z.string().optional(),
625
624
  workspaceTemplate: import_zod.z.string().optional(),
@@ -630,6 +629,7 @@ var CliTargetConfigSchema = import_zod.z.object({
630
629
  }).strict();
631
630
  var CLI_PLACEHOLDERS = /* @__PURE__ */ new Set([
632
631
  "PROMPT",
632
+ "PROMPT_FILE",
633
633
  "GUIDELINES",
634
634
  "EVAL_ID",
635
635
  "ATTEMPT",
@@ -911,21 +911,16 @@ async function validateTargetsFile(filePath) {
911
911
  };
912
912
  }
913
913
  function validateCliSettings(target, absolutePath2, location, errors2) {
914
- const commandTemplate = target.command_template ?? target.commandTemplate;
915
- 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) {
916
916
  errors2.push({
917
917
  severity: "error",
918
918
  filePath: absolutePath2,
919
- location: `${location}.commandTemplate`,
920
- 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"
921
921
  });
922
922
  } else {
923
- recordUnknownPlaceholders(
924
- commandTemplate,
925
- absolutePath2,
926
- `${location}.commandTemplate`,
927
- errors2
928
- );
923
+ recordUnknownPlaceholders(command, absolutePath2, `${location}.command`, errors2);
929
924
  }
930
925
  const healthcheck = target.healthcheck;
931
926
  if (healthcheck !== void 0) {
@@ -942,16 +937,6 @@ async function validateTargetsFile(filePath) {
942
937
  });
943
938
  return;
944
939
  }
945
- const type = healthcheck.type;
946
- if (type !== "http" && type !== "command") {
947
- errors2.push({
948
- severity: "error",
949
- filePath: absolutePath2,
950
- location: `${location}.type`,
951
- message: "healthcheck.type must be either 'http' or 'command'"
952
- });
953
- return;
954
- }
955
940
  const timeoutSeconds = healthcheck.timeout_seconds ?? healthcheck.timeoutSeconds;
956
941
  if (timeoutSeconds !== void 0) {
957
942
  const numericTimeout = Number(timeoutSeconds);
@@ -964,34 +949,26 @@ async function validateTargetsFile(filePath) {
964
949
  });
965
950
  }
966
951
  }
967
- if (type === "http") {
968
- const url = healthcheck.url;
969
- if (typeof url !== "string" || url.trim().length === 0) {
970
- errors2.push({
971
- severity: "error",
972
- filePath: absolutePath2,
973
- location: `${location}.url`,
974
- message: "healthcheck.url must be a non-empty string for http checks"
975
- });
976
- }
977
- return;
978
- }
979
- const commandTemplate = healthcheck.command_template ?? healthcheck.commandTemplate;
980
- 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) {
981
955
  errors2.push({
982
956
  severity: "error",
983
957
  filePath: absolutePath2,
984
- location: `${location}.commandTemplate`,
985
- 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)"
986
960
  });
987
- } else {
988
- recordUnknownPlaceholders(
989
- commandTemplate,
990
- absolutePath2,
991
- `${location}.commandTemplate`,
992
- errors2
993
- );
961
+ return;
962
+ }
963
+ if (hasUrl) {
964
+ return;
994
965
  }
966
+ recordUnknownPlaceholders(
967
+ healthcheck.command,
968
+ absolutePath2,
969
+ `${location}.command`,
970
+ errors2
971
+ );
995
972
  const cwd = healthcheck.cwd;
996
973
  if (cwd !== void 0 && typeof cwd !== "string") {
997
974
  errors2.push({