@agentv/core 2.7.1-next.5 → 2.8.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-6W5E3VR6.js → chunk-P2465XAH.js} +24 -49
- package/dist/chunk-P2465XAH.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +28 -58
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +21 -44
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +295 -220
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -42
- package/dist/index.d.ts +44 -42
- package/dist/index.js +273 -173
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6W5E3VR6.js.map +0 -1
|
@@ -548,29 +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
|
-
|
|
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.
|
|
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
|
|
572
|
-
|
|
573
|
-
commandTemplate: import_zod.z.string().optional(),
|
|
568
|
+
// Command - required
|
|
569
|
+
command: import_zod.z.string(),
|
|
574
570
|
// Files format - optional
|
|
575
571
|
files_format: import_zod.z.string().optional(),
|
|
576
572
|
filesFormat: import_zod.z.string().optional(),
|
|
@@ -600,26 +596,22 @@ var CliTargetInputSchema = import_zod.z.object({
|
|
|
600
596
|
workers: import_zod.z.number().int().min(1).optional(),
|
|
601
597
|
provider_batching: import_zod.z.boolean().optional(),
|
|
602
598
|
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
599
|
});
|
|
606
600
|
var CliHealthcheckHttpSchema = import_zod.z.object({
|
|
607
|
-
type: import_zod.z.literal("http"),
|
|
608
601
|
url: import_zod.z.string().min(1),
|
|
609
602
|
timeoutMs: import_zod.z.number().positive().optional()
|
|
610
603
|
}).strict();
|
|
611
604
|
var CliHealthcheckCommandSchema = import_zod.z.object({
|
|
612
|
-
|
|
613
|
-
commandTemplate: import_zod.z.string().min(1),
|
|
605
|
+
command: import_zod.z.string().min(1),
|
|
614
606
|
cwd: import_zod.z.string().optional(),
|
|
615
607
|
timeoutMs: import_zod.z.number().positive().optional()
|
|
616
608
|
}).strict();
|
|
617
|
-
var CliHealthcheckSchema = import_zod.z.
|
|
609
|
+
var CliHealthcheckSchema = import_zod.z.union([
|
|
618
610
|
CliHealthcheckHttpSchema,
|
|
619
611
|
CliHealthcheckCommandSchema
|
|
620
612
|
]);
|
|
621
613
|
var CliTargetConfigSchema = import_zod.z.object({
|
|
622
|
-
|
|
614
|
+
command: import_zod.z.string().min(1),
|
|
623
615
|
filesFormat: import_zod.z.string().optional(),
|
|
624
616
|
cwd: import_zod.z.string().optional(),
|
|
625
617
|
workspaceTemplate: import_zod.z.string().optional(),
|
|
@@ -630,6 +622,7 @@ var CliTargetConfigSchema = import_zod.z.object({
|
|
|
630
622
|
}).strict();
|
|
631
623
|
var CLI_PLACEHOLDERS = /* @__PURE__ */ new Set([
|
|
632
624
|
"PROMPT",
|
|
625
|
+
"PROMPT_FILE",
|
|
633
626
|
"GUIDELINES",
|
|
634
627
|
"EVAL_ID",
|
|
635
628
|
"ATTEMPT",
|
|
@@ -911,21 +904,16 @@ async function validateTargetsFile(filePath) {
|
|
|
911
904
|
};
|
|
912
905
|
}
|
|
913
906
|
function validateCliSettings(target, absolutePath2, location, errors2) {
|
|
914
|
-
const
|
|
915
|
-
if (typeof
|
|
907
|
+
const command = target.command;
|
|
908
|
+
if (typeof command !== "string" || command.trim().length === 0) {
|
|
916
909
|
errors2.push({
|
|
917
910
|
severity: "error",
|
|
918
911
|
filePath: absolutePath2,
|
|
919
|
-
location: `${location}.
|
|
920
|
-
message: "CLI provider requires '
|
|
912
|
+
location: `${location}.command`,
|
|
913
|
+
message: "CLI provider requires 'command' as a non-empty string"
|
|
921
914
|
});
|
|
922
915
|
} else {
|
|
923
|
-
recordUnknownPlaceholders(
|
|
924
|
-
commandTemplate,
|
|
925
|
-
absolutePath2,
|
|
926
|
-
`${location}.commandTemplate`,
|
|
927
|
-
errors2
|
|
928
|
-
);
|
|
916
|
+
recordUnknownPlaceholders(command, absolutePath2, `${location}.command`, errors2);
|
|
929
917
|
}
|
|
930
918
|
const healthcheck = target.healthcheck;
|
|
931
919
|
if (healthcheck !== void 0) {
|
|
@@ -942,16 +930,6 @@ async function validateTargetsFile(filePath) {
|
|
|
942
930
|
});
|
|
943
931
|
return;
|
|
944
932
|
}
|
|
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
933
|
const timeoutSeconds = healthcheck.timeout_seconds ?? healthcheck.timeoutSeconds;
|
|
956
934
|
if (timeoutSeconds !== void 0) {
|
|
957
935
|
const numericTimeout = Number(timeoutSeconds);
|
|
@@ -964,34 +942,26 @@ async function validateTargetsFile(filePath) {
|
|
|
964
942
|
});
|
|
965
943
|
}
|
|
966
944
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
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) {
|
|
945
|
+
const hasUrl = typeof healthcheck.url === "string" && healthcheck.url.trim().length > 0;
|
|
946
|
+
const hasCommand = typeof healthcheck.command === "string" && healthcheck.command.trim().length > 0;
|
|
947
|
+
if (!hasUrl && !hasCommand) {
|
|
981
948
|
errors2.push({
|
|
982
949
|
severity: "error",
|
|
983
950
|
filePath: absolutePath2,
|
|
984
|
-
location
|
|
985
|
-
message: "healthcheck
|
|
951
|
+
location,
|
|
952
|
+
message: "healthcheck must have either 'url' (HTTP) or 'command' (command)"
|
|
986
953
|
});
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
`${location}.commandTemplate`,
|
|
992
|
-
errors2
|
|
993
|
-
);
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
if (hasUrl) {
|
|
957
|
+
return;
|
|
994
958
|
}
|
|
959
|
+
recordUnknownPlaceholders(
|
|
960
|
+
healthcheck.command,
|
|
961
|
+
absolutePath2,
|
|
962
|
+
`${location}.command`,
|
|
963
|
+
errors2
|
|
964
|
+
);
|
|
995
965
|
const cwd = healthcheck.cwd;
|
|
996
966
|
if (cwd !== void 0 && typeof cwd !== "string") {
|
|
997
967
|
errors2.push({
|