@agentv/core 1.4.0 → 1.5.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.
- package/dist/{chunk-KPHTMTZ3.js → chunk-E2VSU4WZ.js} +265 -83
- package/dist/chunk-E2VSU4WZ.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +82 -71
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +3 -72
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +1475 -393
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +227 -33
- package/dist/index.d.ts +227 -33
- package/dist/index.js +1142 -244
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KPHTMTZ3.js.map +0 -1
|
@@ -313,6 +313,83 @@ var import_yaml3 = require("yaml");
|
|
|
313
313
|
// src/evaluation/providers/targets.ts
|
|
314
314
|
var import_node_path3 = __toESM(require("path"), 1);
|
|
315
315
|
var import_zod = require("zod");
|
|
316
|
+
var CliHealthcheckHttpInputSchema = import_zod.z.object({
|
|
317
|
+
type: import_zod.z.literal("http"),
|
|
318
|
+
url: import_zod.z.string().min(1, "healthcheck URL is required"),
|
|
319
|
+
timeout_seconds: import_zod.z.number().positive().optional(),
|
|
320
|
+
timeoutSeconds: import_zod.z.number().positive().optional()
|
|
321
|
+
});
|
|
322
|
+
var CliHealthcheckCommandInputSchema = import_zod.z.object({
|
|
323
|
+
type: import_zod.z.literal("command"),
|
|
324
|
+
command_template: import_zod.z.string().optional(),
|
|
325
|
+
commandTemplate: import_zod.z.string().optional(),
|
|
326
|
+
cwd: import_zod.z.string().optional(),
|
|
327
|
+
timeout_seconds: import_zod.z.number().positive().optional(),
|
|
328
|
+
timeoutSeconds: import_zod.z.number().positive().optional()
|
|
329
|
+
});
|
|
330
|
+
var CliHealthcheckInputSchema = import_zod.z.discriminatedUnion("type", [
|
|
331
|
+
CliHealthcheckHttpInputSchema,
|
|
332
|
+
CliHealthcheckCommandInputSchema
|
|
333
|
+
]);
|
|
334
|
+
var CliTargetInputSchema = import_zod.z.object({
|
|
335
|
+
name: import_zod.z.string().min(1, "target name is required"),
|
|
336
|
+
provider: import_zod.z.string().refine((p) => p.toLowerCase() === "cli", { message: "provider must be 'cli'" }),
|
|
337
|
+
// Command template - required (accept both naming conventions)
|
|
338
|
+
command_template: import_zod.z.string().optional(),
|
|
339
|
+
commandTemplate: import_zod.z.string().optional(),
|
|
340
|
+
// Files format - optional
|
|
341
|
+
files_format: import_zod.z.string().optional(),
|
|
342
|
+
filesFormat: import_zod.z.string().optional(),
|
|
343
|
+
attachments_format: import_zod.z.string().optional(),
|
|
344
|
+
attachmentsFormat: import_zod.z.string().optional(),
|
|
345
|
+
// Working directory - optional
|
|
346
|
+
cwd: import_zod.z.string().optional(),
|
|
347
|
+
// Timeout in seconds - optional
|
|
348
|
+
timeout_seconds: import_zod.z.number().positive().optional(),
|
|
349
|
+
timeoutSeconds: import_zod.z.number().positive().optional(),
|
|
350
|
+
// Healthcheck configuration - optional
|
|
351
|
+
healthcheck: CliHealthcheckInputSchema.optional(),
|
|
352
|
+
// Verbose mode - optional
|
|
353
|
+
verbose: import_zod.z.boolean().optional(),
|
|
354
|
+
cli_verbose: import_zod.z.boolean().optional(),
|
|
355
|
+
cliVerbose: import_zod.z.boolean().optional(),
|
|
356
|
+
// Keep temp files - optional
|
|
357
|
+
keep_temp_files: import_zod.z.boolean().optional(),
|
|
358
|
+
keepTempFiles: import_zod.z.boolean().optional(),
|
|
359
|
+
keep_output_files: import_zod.z.boolean().optional(),
|
|
360
|
+
keepOutputFiles: import_zod.z.boolean().optional(),
|
|
361
|
+
// Common target fields
|
|
362
|
+
judge_target: import_zod.z.string().optional(),
|
|
363
|
+
workers: import_zod.z.number().int().min(1).optional(),
|
|
364
|
+
provider_batching: import_zod.z.boolean().optional(),
|
|
365
|
+
providerBatching: import_zod.z.boolean().optional()
|
|
366
|
+
}).refine((data) => data.command_template !== void 0 || data.commandTemplate !== void 0, {
|
|
367
|
+
message: "Either command_template or commandTemplate is required"
|
|
368
|
+
});
|
|
369
|
+
var CliHealthcheckHttpSchema = import_zod.z.object({
|
|
370
|
+
type: import_zod.z.literal("http"),
|
|
371
|
+
url: import_zod.z.string().min(1),
|
|
372
|
+
timeoutMs: import_zod.z.number().positive().optional()
|
|
373
|
+
}).strict();
|
|
374
|
+
var CliHealthcheckCommandSchema = import_zod.z.object({
|
|
375
|
+
type: import_zod.z.literal("command"),
|
|
376
|
+
commandTemplate: import_zod.z.string().min(1),
|
|
377
|
+
cwd: import_zod.z.string().optional(),
|
|
378
|
+
timeoutMs: import_zod.z.number().positive().optional()
|
|
379
|
+
}).strict();
|
|
380
|
+
var CliHealthcheckSchema = import_zod.z.discriminatedUnion("type", [
|
|
381
|
+
CliHealthcheckHttpSchema,
|
|
382
|
+
CliHealthcheckCommandSchema
|
|
383
|
+
]);
|
|
384
|
+
var CliTargetConfigSchema = import_zod.z.object({
|
|
385
|
+
commandTemplate: import_zod.z.string().min(1),
|
|
386
|
+
filesFormat: import_zod.z.string().optional(),
|
|
387
|
+
cwd: import_zod.z.string().optional(),
|
|
388
|
+
timeoutMs: import_zod.z.number().positive().optional(),
|
|
389
|
+
healthcheck: CliHealthcheckSchema.optional(),
|
|
390
|
+
verbose: import_zod.z.boolean().optional(),
|
|
391
|
+
keepTempFiles: import_zod.z.boolean().optional()
|
|
392
|
+
}).strict();
|
|
316
393
|
var CLI_PLACEHOLDERS = /* @__PURE__ */ new Set([
|
|
317
394
|
"PROMPT",
|
|
318
395
|
"GUIDELINES",
|
|
@@ -334,6 +411,7 @@ var KNOWN_PROVIDERS = [
|
|
|
334
411
|
"anthropic",
|
|
335
412
|
"gemini",
|
|
336
413
|
"codex",
|
|
414
|
+
"pi-coding-agent",
|
|
337
415
|
"cli",
|
|
338
416
|
"mock",
|
|
339
417
|
"vscode",
|
|
@@ -348,6 +426,8 @@ var PROVIDER_ALIASES = [
|
|
|
348
426
|
// alias for "gemini"
|
|
349
427
|
"codex-cli",
|
|
350
428
|
// alias for "codex"
|
|
429
|
+
"pi",
|
|
430
|
+
// alias for "pi-coding-agent"
|
|
351
431
|
"openai",
|
|
352
432
|
// legacy/future support
|
|
353
433
|
"bedrock",
|
|
@@ -456,27 +536,6 @@ var MOCK_SETTINGS = /* @__PURE__ */ new Set([
|
|
|
456
536
|
"trace"
|
|
457
537
|
// For testing tool_trajectory evaluator
|
|
458
538
|
]);
|
|
459
|
-
var CLI_SETTINGS = /* @__PURE__ */ new Set([
|
|
460
|
-
...COMMON_SETTINGS,
|
|
461
|
-
"command_template",
|
|
462
|
-
"commandTemplate",
|
|
463
|
-
"verbose",
|
|
464
|
-
"cli_verbose",
|
|
465
|
-
"cliVerbose",
|
|
466
|
-
"files_format",
|
|
467
|
-
"filesFormat",
|
|
468
|
-
"attachments_format",
|
|
469
|
-
"attachmentsFormat",
|
|
470
|
-
"cwd",
|
|
471
|
-
"env",
|
|
472
|
-
"timeout_seconds",
|
|
473
|
-
"timeoutSeconds",
|
|
474
|
-
"healthcheck",
|
|
475
|
-
"keep_temp_files",
|
|
476
|
-
"keepTempFiles",
|
|
477
|
-
"keep_output_files",
|
|
478
|
-
"keepOutputFiles"
|
|
479
|
-
]);
|
|
480
539
|
function getKnownSettings(provider) {
|
|
481
540
|
const normalizedProvider = provider.toLowerCase();
|
|
482
541
|
switch (normalizedProvider) {
|
|
@@ -498,7 +557,7 @@ function getKnownSettings(provider) {
|
|
|
498
557
|
case "mock":
|
|
499
558
|
return MOCK_SETTINGS;
|
|
500
559
|
case "cli":
|
|
501
|
-
return
|
|
560
|
+
return null;
|
|
502
561
|
default:
|
|
503
562
|
return null;
|
|
504
563
|
}
|
|
@@ -547,7 +606,7 @@ async function validateTargetsFile(filePath) {
|
|
|
547
606
|
severity: "error",
|
|
548
607
|
filePath: absolutePath2,
|
|
549
608
|
location: `${location}.commandTemplate`,
|
|
550
|
-
message: "CLI provider requires 'commandTemplate' as a non-empty string"
|
|
609
|
+
message: "CLI provider requires 'command_template' or 'commandTemplate' as a non-empty string"
|
|
551
610
|
});
|
|
552
611
|
} else {
|
|
553
612
|
recordUnknownPlaceholders(
|
|
@@ -557,58 +616,10 @@ async function validateTargetsFile(filePath) {
|
|
|
557
616
|
errors2
|
|
558
617
|
);
|
|
559
618
|
}
|
|
560
|
-
const attachmentsFormat = target.attachments_format ?? target.attachmentsFormat;
|
|
561
|
-
if (attachmentsFormat !== void 0 && typeof attachmentsFormat !== "string") {
|
|
562
|
-
errors2.push({
|
|
563
|
-
severity: "error",
|
|
564
|
-
filePath: absolutePath2,
|
|
565
|
-
location: `${location}.attachmentsFormat`,
|
|
566
|
-
message: "'attachmentsFormat' must be a string when provided"
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
const filesFormat = target.files_format ?? target.filesFormat;
|
|
570
|
-
if (filesFormat !== void 0 && typeof filesFormat !== "string") {
|
|
571
|
-
errors2.push({
|
|
572
|
-
severity: "error",
|
|
573
|
-
filePath: absolutePath2,
|
|
574
|
-
location: `${location}.filesFormat`,
|
|
575
|
-
message: "'filesFormat' must be a string when provided"
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
const cwd = target.cwd;
|
|
579
|
-
if (cwd !== void 0 && typeof cwd !== "string") {
|
|
580
|
-
errors2.push({
|
|
581
|
-
severity: "error",
|
|
582
|
-
filePath: absolutePath2,
|
|
583
|
-
location: `${location}.cwd`,
|
|
584
|
-
message: "'cwd' must be a string when provided"
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
const timeoutSeconds = target.timeout_seconds ?? target.timeoutSeconds;
|
|
588
|
-
if (timeoutSeconds !== void 0) {
|
|
589
|
-
const numericTimeout = Number(timeoutSeconds);
|
|
590
|
-
if (!Number.isFinite(numericTimeout) || numericTimeout <= 0) {
|
|
591
|
-
errors2.push({
|
|
592
|
-
severity: "error",
|
|
593
|
-
filePath: absolutePath2,
|
|
594
|
-
location: `${location}.timeoutSeconds`,
|
|
595
|
-
message: "'timeoutSeconds' must be a positive number when provided"
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
619
|
const healthcheck = target.healthcheck;
|
|
600
620
|
if (healthcheck !== void 0) {
|
|
601
621
|
validateCliHealthcheck(healthcheck, absolutePath2, `${location}.healthcheck`, errors2);
|
|
602
622
|
}
|
|
603
|
-
const verbose = target.verbose ?? target.cli_verbose ?? target.cliVerbose;
|
|
604
|
-
if (verbose !== void 0 && typeof verbose !== "boolean") {
|
|
605
|
-
errors2.push({
|
|
606
|
-
severity: "error",
|
|
607
|
-
filePath: absolutePath2,
|
|
608
|
-
location: `${location}.verbose`,
|
|
609
|
-
message: "'verbose' must be a boolean when provided"
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
623
|
}
|
|
613
624
|
function validateCliHealthcheck(healthcheck, absolutePath2, location, errors2) {
|
|
614
625
|
if (!isObject2(healthcheck)) {
|