@agentv/core 4.6.0 → 4.7.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-AIQ5FO4G.js → chunk-75RFVESM.js} +273 -125
- package/dist/chunk-75RFVESM.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +110 -95
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +30 -72
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +1488 -517
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +291 -74
- package/dist/index.d.ts +291 -74
- package/dist/index.js +1187 -369
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-AIQ5FO4G.js.map +0 -1
|
@@ -219,15 +219,13 @@ import path2 from "node:path";
|
|
|
219
219
|
import { z } from "zod";
|
|
220
220
|
var CliHealthcheckHttpInputSchema = z.object({
|
|
221
221
|
url: z.string().min(1, "healthcheck URL is required"),
|
|
222
|
-
timeout_seconds: z.number().positive().optional()
|
|
223
|
-
|
|
224
|
-
});
|
|
222
|
+
timeout_seconds: z.number().positive().optional()
|
|
223
|
+
}).passthrough();
|
|
225
224
|
var CliHealthcheckCommandInputSchema = z.object({
|
|
226
225
|
command: z.string().min(1, "healthcheck command is required"),
|
|
227
226
|
cwd: z.string().optional(),
|
|
228
|
-
timeout_seconds: z.number().positive().optional()
|
|
229
|
-
|
|
230
|
-
});
|
|
227
|
+
timeout_seconds: z.number().positive().optional()
|
|
228
|
+
}).passthrough();
|
|
231
229
|
var CliHealthcheckInputSchema = z.union([
|
|
232
230
|
CliHealthcheckHttpInputSchema,
|
|
233
231
|
CliHealthcheckCommandInputSchema
|
|
@@ -239,36 +237,28 @@ var CliTargetInputSchema = z.object({
|
|
|
239
237
|
command: z.string(),
|
|
240
238
|
// Files format - optional
|
|
241
239
|
files_format: z.string().optional(),
|
|
242
|
-
filesFormat: z.string().optional(),
|
|
243
240
|
attachments_format: z.string().optional(),
|
|
244
|
-
attachmentsFormat: z.string().optional(),
|
|
245
241
|
// Working directory - optional
|
|
246
242
|
cwd: z.string().optional(),
|
|
247
243
|
// Workspace template directory - optional (mutually exclusive with cwd)
|
|
248
244
|
workspace_template: z.string().optional(),
|
|
249
|
-
workspaceTemplate: z.string().optional(),
|
|
250
245
|
// Timeout in seconds - optional
|
|
251
246
|
timeout_seconds: z.number().positive().optional(),
|
|
252
|
-
timeoutSeconds: z.number().positive().optional(),
|
|
253
247
|
// Healthcheck configuration - optional
|
|
254
248
|
healthcheck: CliHealthcheckInputSchema.optional(),
|
|
255
249
|
// Verbose mode - optional
|
|
256
250
|
verbose: z.boolean().optional(),
|
|
257
251
|
cli_verbose: z.boolean().optional(),
|
|
258
|
-
cliVerbose: z.boolean().optional(),
|
|
259
252
|
// Keep temp files - optional
|
|
260
253
|
keep_temp_files: z.boolean().optional(),
|
|
261
|
-
keepTempFiles: z.boolean().optional(),
|
|
262
254
|
keep_output_files: z.boolean().optional(),
|
|
263
|
-
keepOutputFiles: z.boolean().optional(),
|
|
264
255
|
// Common target fields
|
|
265
256
|
grader_target: z.string().optional(),
|
|
266
257
|
judge_target: z.string().optional(),
|
|
267
258
|
// backward compat
|
|
268
259
|
workers: z.number().int().min(1).optional(),
|
|
269
|
-
provider_batching: z.boolean().optional()
|
|
270
|
-
|
|
271
|
-
});
|
|
260
|
+
provider_batching: z.boolean().optional()
|
|
261
|
+
}).passthrough();
|
|
272
262
|
var CliHealthcheckHttpSchema = z.object({
|
|
273
263
|
url: z.string().min(1),
|
|
274
264
|
timeoutMs: z.number().positive().optional()
|
|
@@ -293,7 +283,7 @@ var CliTargetConfigSchema = z.object({
|
|
|
293
283
|
keepTempFiles: z.boolean().optional()
|
|
294
284
|
}).strict();
|
|
295
285
|
function normalizeCliHealthcheck(input, env, targetName, evalFilePath) {
|
|
296
|
-
const timeoutSeconds = input.timeout_seconds
|
|
286
|
+
const timeoutSeconds = input.timeout_seconds;
|
|
297
287
|
const timeoutMs = timeoutSeconds !== void 0 ? Math.floor(timeoutSeconds * 1e3) : void 0;
|
|
298
288
|
if ("url" in input && input.url) {
|
|
299
289
|
const url = resolveString(input.url, env, `${targetName} healthcheck URL`);
|
|
@@ -327,9 +317,9 @@ function normalizeCliHealthcheck(input, env, targetName, evalFilePath) {
|
|
|
327
317
|
function normalizeCliTargetInput(input, env, evalFilePath) {
|
|
328
318
|
const targetName = input.name;
|
|
329
319
|
const command = resolveString(input.command, env, `${targetName} CLI command`, true);
|
|
330
|
-
const filesFormatSource = input.files_format ?? input.
|
|
320
|
+
const filesFormatSource = input.files_format ?? input.attachments_format;
|
|
331
321
|
const filesFormat = resolveOptionalLiteralString(filesFormatSource);
|
|
332
|
-
const workspaceTemplateSource = input.workspace_template
|
|
322
|
+
const workspaceTemplateSource = input.workspace_template;
|
|
333
323
|
let workspaceTemplate = resolveOptionalString(
|
|
334
324
|
workspaceTemplateSource,
|
|
335
325
|
env,
|
|
@@ -357,12 +347,10 @@ function normalizeCliTargetInput(input, env, evalFilePath) {
|
|
|
357
347
|
if (!cwd && !workspaceTemplate && evalFilePath) {
|
|
358
348
|
cwd = path2.dirname(path2.resolve(evalFilePath));
|
|
359
349
|
}
|
|
360
|
-
const timeoutSeconds = input.timeout_seconds
|
|
350
|
+
const timeoutSeconds = input.timeout_seconds;
|
|
361
351
|
const timeoutMs = timeoutSeconds !== void 0 ? Math.floor(timeoutSeconds * 1e3) : void 0;
|
|
362
|
-
const verbose = resolveOptionalBoolean(input.verbose ?? input.cli_verbose
|
|
363
|
-
const keepTempFiles = resolveOptionalBoolean(
|
|
364
|
-
input.keep_temp_files ?? input.keepTempFiles ?? input.keep_output_files ?? input.keepOutputFiles
|
|
365
|
-
);
|
|
352
|
+
const verbose = resolveOptionalBoolean(input.verbose ?? input.cli_verbose);
|
|
353
|
+
const keepTempFiles = resolveOptionalBoolean(input.keep_temp_files ?? input.keep_output_files);
|
|
366
354
|
const healthcheck = input.healthcheck ? normalizeCliHealthcheck(input.healthcheck, env, targetName, evalFilePath) : void 0;
|
|
367
355
|
return {
|
|
368
356
|
command,
|
|
@@ -383,15 +371,106 @@ var CLI_PLACEHOLDERS = /* @__PURE__ */ new Set([
|
|
|
383
371
|
"FILES",
|
|
384
372
|
"OUTPUT_FILE"
|
|
385
373
|
]);
|
|
374
|
+
var DEPRECATED_TARGET_CAMEL_CASE_FIELDS = /* @__PURE__ */ new Map([
|
|
375
|
+
["providerBatching", "provider_batching"],
|
|
376
|
+
["subagentModeAllowed", "subagent_mode_allowed"],
|
|
377
|
+
["fallbackTargets", "fallback_targets"],
|
|
378
|
+
["resourceName", "endpoint"],
|
|
379
|
+
["baseUrl", "base_url"],
|
|
380
|
+
["apiKey", "api_key"],
|
|
381
|
+
["deploymentName", "model"],
|
|
382
|
+
["thinkingBudget", "thinking_budget"],
|
|
383
|
+
["maxTokens", "max_output_tokens"],
|
|
384
|
+
["apiFormat", "api_format"],
|
|
385
|
+
["timeoutSeconds", "timeout_seconds"],
|
|
386
|
+
["logDir", "log_dir"],
|
|
387
|
+
["logDirectory", "log_directory"],
|
|
388
|
+
["logFormat", "log_format"],
|
|
389
|
+
["logOutputFormat", "log_output_format"],
|
|
390
|
+
["systemPrompt", "system_prompt"],
|
|
391
|
+
["maxTurns", "max_turns"],
|
|
392
|
+
["maxBudgetUsd", "max_budget_usd"],
|
|
393
|
+
["dryRun", "dry_run"],
|
|
394
|
+
["subagentRoot", "subagent_root"],
|
|
395
|
+
["filesFormat", "files_format"],
|
|
396
|
+
["attachmentsFormat", "attachments_format"],
|
|
397
|
+
["cliUrl", "cli_url"],
|
|
398
|
+
["cliPath", "cli_path"],
|
|
399
|
+
["githubToken", "github_token"],
|
|
400
|
+
["sessionDir", "session_dir"],
|
|
401
|
+
["sessionId", "session_id"],
|
|
402
|
+
["sessionStateDir", "session_state_dir"],
|
|
403
|
+
["maxRetries", "max_retries"],
|
|
404
|
+
["retryInitialDelayMs", "retry_initial_delay_ms"],
|
|
405
|
+
["retryMaxDelayMs", "retry_max_delay_ms"],
|
|
406
|
+
["retryBackoffFactor", "retry_backoff_factor"],
|
|
407
|
+
["retryStatusCodes", "retry_status_codes"]
|
|
408
|
+
]);
|
|
409
|
+
var DEPRECATED_HEALTHCHECK_CAMEL_CASE_FIELDS = /* @__PURE__ */ new Map([
|
|
410
|
+
["timeoutSeconds", "timeout_seconds"]
|
|
411
|
+
]);
|
|
412
|
+
function collectDeprecatedCamelCaseWarnings(value, location, aliases) {
|
|
413
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
414
|
+
return [];
|
|
415
|
+
}
|
|
416
|
+
const warnings = [];
|
|
417
|
+
for (const [camelCaseField, snakeCaseField] of aliases) {
|
|
418
|
+
if (Object.prototype.hasOwnProperty.call(value, camelCaseField)) {
|
|
419
|
+
warnings.push({
|
|
420
|
+
location: `${location}.${camelCaseField}`,
|
|
421
|
+
message: `camelCase field '${camelCaseField}' is no longer supported in targets.yaml. Use '${snakeCaseField}' instead.`
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return warnings;
|
|
426
|
+
}
|
|
427
|
+
function assertNoDeprecatedCamelCaseTargetFields(definition) {
|
|
428
|
+
if (Object.prototype.hasOwnProperty.call(definition, "workspaceTemplate")) {
|
|
429
|
+
throw new Error(
|
|
430
|
+
`${definition.name}: target-level workspace_template has been removed. Use eval-level workspace.template.`
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
const warning = findDeprecatedCamelCaseTargetWarnings(
|
|
434
|
+
definition,
|
|
435
|
+
`target "${definition.name}"`
|
|
436
|
+
)[0];
|
|
437
|
+
if (!warning) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
const fieldMatch = warning.message.match(/field '([^']+)'/);
|
|
441
|
+
const replacementMatch = warning.message.match(/Use '([^']+)' instead/);
|
|
442
|
+
const field = fieldMatch?.[1] ?? "unknown";
|
|
443
|
+
const replacement = replacementMatch?.[1] ?? "snake_case";
|
|
444
|
+
throw new Error(
|
|
445
|
+
`${warning.location}: camelCase field '${field}' is no longer supported in targets.yaml. Use '${replacement}' instead.`
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function findDeprecatedCamelCaseTargetWarnings(target, location) {
|
|
449
|
+
const warnings = collectDeprecatedCamelCaseWarnings(
|
|
450
|
+
target,
|
|
451
|
+
location,
|
|
452
|
+
DEPRECATED_TARGET_CAMEL_CASE_FIELDS
|
|
453
|
+
);
|
|
454
|
+
if (typeof target !== "object" || target === null || Array.isArray(target)) {
|
|
455
|
+
return warnings;
|
|
456
|
+
}
|
|
457
|
+
const healthcheck = target.healthcheck;
|
|
458
|
+
warnings.push(
|
|
459
|
+
...collectDeprecatedCamelCaseWarnings(
|
|
460
|
+
healthcheck,
|
|
461
|
+
`${location}.healthcheck`,
|
|
462
|
+
DEPRECATED_HEALTHCHECK_CAMEL_CASE_FIELDS
|
|
463
|
+
)
|
|
464
|
+
);
|
|
465
|
+
return warnings;
|
|
466
|
+
}
|
|
386
467
|
var COMMON_TARGET_SETTINGS = [
|
|
387
468
|
"use_target",
|
|
388
469
|
"provider_batching",
|
|
389
|
-
"providerBatching",
|
|
390
470
|
"subagent_mode_allowed",
|
|
391
|
-
"
|
|
392
|
-
"fallback_targets",
|
|
393
|
-
"fallbackTargets"
|
|
471
|
+
"fallback_targets"
|
|
394
472
|
];
|
|
473
|
+
var USE_TARGET_ENV_PATTERN = /^\$\{\{\s*([A-Z0-9_]+)\s*\}\}$/i;
|
|
395
474
|
var BASE_TARGET_SCHEMA = z.object({
|
|
396
475
|
name: z.string().min(1, "target name is required"),
|
|
397
476
|
provider: z.string().optional(),
|
|
@@ -401,43 +480,40 @@ var BASE_TARGET_SCHEMA = z.object({
|
|
|
401
480
|
// backward compat
|
|
402
481
|
workers: z.number().int().min(1).optional(),
|
|
403
482
|
workspace_template: z.string().optional(),
|
|
404
|
-
workspaceTemplate: z.string().optional(),
|
|
405
483
|
subagent_mode_allowed: z.boolean().optional(),
|
|
406
|
-
fallback_targets: z.array(z.string().min(1)).optional()
|
|
407
|
-
fallbackTargets: z.array(z.string().min(1)).optional()
|
|
484
|
+
fallback_targets: z.array(z.string().min(1)).optional()
|
|
408
485
|
}).passthrough();
|
|
409
486
|
var DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
|
|
487
|
+
var DEFAULT_AZURE_RESPONSES_API_VERSION = "v1";
|
|
410
488
|
var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
411
|
-
function normalizeAzureApiVersion(value) {
|
|
489
|
+
function normalizeAzureApiVersion(value, apiFormat) {
|
|
490
|
+
const defaultVersion = apiFormat === "responses" ? DEFAULT_AZURE_RESPONSES_API_VERSION : DEFAULT_AZURE_API_VERSION;
|
|
412
491
|
if (!value) {
|
|
413
|
-
return
|
|
492
|
+
return defaultVersion;
|
|
414
493
|
}
|
|
415
494
|
const trimmed = value.trim();
|
|
416
495
|
if (trimmed.length === 0) {
|
|
417
|
-
return
|
|
496
|
+
return defaultVersion;
|
|
418
497
|
}
|
|
419
498
|
const withoutPrefix = trimmed.replace(/^api[-_]?version\s*=\s*/i, "").trim();
|
|
420
|
-
return withoutPrefix.length > 0 ? withoutPrefix :
|
|
499
|
+
return withoutPrefix.length > 0 ? withoutPrefix : defaultVersion;
|
|
421
500
|
}
|
|
422
501
|
function resolveRetryConfig(target) {
|
|
423
|
-
const maxRetries = resolveOptionalNumber(
|
|
424
|
-
target.max_retries ?? target.maxRetries,
|
|
425
|
-
`${target.name} max retries`
|
|
426
|
-
);
|
|
502
|
+
const maxRetries = resolveOptionalNumber(target.max_retries, `${target.name} max retries`);
|
|
427
503
|
const initialDelayMs = resolveOptionalNumber(
|
|
428
|
-
target.retry_initial_delay_ms
|
|
504
|
+
target.retry_initial_delay_ms,
|
|
429
505
|
`${target.name} retry initial delay`
|
|
430
506
|
);
|
|
431
507
|
const maxDelayMs = resolveOptionalNumber(
|
|
432
|
-
target.retry_max_delay_ms
|
|
508
|
+
target.retry_max_delay_ms,
|
|
433
509
|
`${target.name} retry max delay`
|
|
434
510
|
);
|
|
435
511
|
const backoffFactor = resolveOptionalNumber(
|
|
436
|
-
target.retry_backoff_factor
|
|
512
|
+
target.retry_backoff_factor,
|
|
437
513
|
`${target.name} retry backoff factor`
|
|
438
514
|
);
|
|
439
515
|
const retryableStatusCodes = resolveOptionalNumberArray(
|
|
440
|
-
target.retry_status_codes
|
|
516
|
+
target.retry_status_codes,
|
|
441
517
|
`${target.name} retry status codes`
|
|
442
518
|
);
|
|
443
519
|
if (maxRetries === void 0 && initialDelayMs === void 0 && maxDelayMs === void 0 && backoffFactor === void 0 && retryableStatusCodes === void 0) {
|
|
@@ -451,9 +527,56 @@ function resolveRetryConfig(target) {
|
|
|
451
527
|
retryableStatusCodes
|
|
452
528
|
};
|
|
453
529
|
}
|
|
454
|
-
function
|
|
530
|
+
function resolveDelegatedTargetDefinition(name, definitions, env = process.env) {
|
|
531
|
+
let definition = definitions.get(name);
|
|
532
|
+
if (!definition) {
|
|
533
|
+
return void 0;
|
|
534
|
+
}
|
|
535
|
+
const visited = [definition.name];
|
|
536
|
+
for (let depth = 0; depth < 10; depth++) {
|
|
537
|
+
const rawUseTarget = typeof definition.use_target === "string" ? definition.use_target.trim() : void 0;
|
|
538
|
+
if (!rawUseTarget) {
|
|
539
|
+
return definition;
|
|
540
|
+
}
|
|
541
|
+
const envMatch = rawUseTarget.match(USE_TARGET_ENV_PATTERN);
|
|
542
|
+
const envVarName = envMatch?.[1];
|
|
543
|
+
const resolvedName = envVarName ? env[envVarName]?.trim() ?? "" : rawUseTarget;
|
|
544
|
+
if (resolvedName.length === 0) {
|
|
545
|
+
if (envVarName) {
|
|
546
|
+
throw new Error(
|
|
547
|
+
`Target "${definition.name}" uses use_target: \${{ ${envVarName} }}, but ${envVarName} is not set. Set ${envVarName} to the name of a concrete target (for example, "azure") before running the eval.`
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
throw new Error(
|
|
551
|
+
`Target "${definition.name}" has an empty use_target value. Point it at a concrete target name before running the eval.`
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
const next = definitions.get(resolvedName);
|
|
555
|
+
if (!next) {
|
|
556
|
+
if (envVarName) {
|
|
557
|
+
throw new Error(
|
|
558
|
+
`Target "${definition.name}" uses use_target: \${{ ${envVarName} }}, which resolved to "${resolvedName}", but no target named "${resolvedName}" exists.`
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
throw new Error(
|
|
562
|
+
`Target "${definition.name}" uses use_target: "${resolvedName}", but no target named "${resolvedName}" exists.`
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
if (visited.includes(next.name)) {
|
|
566
|
+
const chain = [...visited, next.name].join(" -> ");
|
|
567
|
+
throw new Error(`Circular use_target reference detected: ${chain}`);
|
|
568
|
+
}
|
|
569
|
+
definition = next;
|
|
570
|
+
visited.push(definition.name);
|
|
571
|
+
}
|
|
572
|
+
throw new Error(
|
|
573
|
+
`Target "${name}" exceeded the maximum use_target resolution depth (10). Check for a delegation loop or overly deep alias chain.`
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
function resolveTargetDefinition(definition, env = process.env, evalFilePath, options) {
|
|
577
|
+
assertNoDeprecatedCamelCaseTargetFields(definition);
|
|
455
578
|
const parsed = BASE_TARGET_SCHEMA.parse(definition);
|
|
456
|
-
if (parsed.workspace_template !== void 0
|
|
579
|
+
if (parsed.workspace_template !== void 0) {
|
|
457
580
|
throw new Error(
|
|
458
581
|
`${parsed.name}: target-level workspace_template has been removed. Use eval-level workspace.template.`
|
|
459
582
|
);
|
|
@@ -469,13 +592,9 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
|
|
|
469
592
|
`${parsed.name} provider`,
|
|
470
593
|
true
|
|
471
594
|
).toLowerCase();
|
|
472
|
-
const providerBatching = resolveOptionalBoolean(
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
const subagentModeAllowed = resolveOptionalBoolean(
|
|
476
|
-
parsed.subagent_mode_allowed ?? parsed.subagentModeAllowed
|
|
477
|
-
);
|
|
478
|
-
const fallbackTargets = parsed.fallback_targets ?? parsed.fallbackTargets;
|
|
595
|
+
const providerBatching = resolveOptionalBoolean(parsed.provider_batching);
|
|
596
|
+
const subagentModeAllowed = resolveOptionalBoolean(parsed.subagent_mode_allowed);
|
|
597
|
+
const fallbackTargets = parsed.fallback_targets;
|
|
479
598
|
const base = {
|
|
480
599
|
name: parsed.name,
|
|
481
600
|
graderTarget: parsed.grader_target ?? parsed.judge_target,
|
|
@@ -625,20 +744,22 @@ function normalizeOpenAIBaseUrl(value) {
|
|
|
625
744
|
return trimmed.endsWith("/v1") ? trimmed : `${trimmed}/v1`;
|
|
626
745
|
}
|
|
627
746
|
function resolveAzureConfig(target, env) {
|
|
628
|
-
const endpointSource = target.endpoint ?? target.resource
|
|
629
|
-
const apiKeySource = target.api_key
|
|
630
|
-
const deploymentSource = target.deployment ?? target.
|
|
747
|
+
const endpointSource = target.endpoint ?? target.resource;
|
|
748
|
+
const apiKeySource = target.api_key;
|
|
749
|
+
const deploymentSource = target.deployment ?? target.model;
|
|
631
750
|
const versionSource = target.version ?? target.api_version;
|
|
632
751
|
const temperatureSource = target.temperature;
|
|
633
|
-
const maxTokensSource = target.max_output_tokens
|
|
752
|
+
const maxTokensSource = target.max_output_tokens;
|
|
634
753
|
const resourceName = resolveString(endpointSource, env, `${target.name} endpoint`);
|
|
635
754
|
const apiKey = resolveString(apiKeySource, env, `${target.name} api key`);
|
|
636
755
|
const deploymentName = resolveString(deploymentSource, env, `${target.name} deployment`);
|
|
756
|
+
const apiFormat = resolveApiFormat(target, env, target.name);
|
|
637
757
|
const version = normalizeAzureApiVersion(
|
|
638
758
|
resolveOptionalString(versionSource, env, `${target.name} api version`, {
|
|
639
759
|
allowLiteral: true,
|
|
640
760
|
optionalEnv: true
|
|
641
|
-
})
|
|
761
|
+
}),
|
|
762
|
+
apiFormat
|
|
642
763
|
);
|
|
643
764
|
const temperature = resolveOptionalNumber(temperatureSource, `${target.name} temperature`);
|
|
644
765
|
const maxOutputTokens = resolveOptionalNumber(
|
|
@@ -651,13 +772,17 @@ function resolveAzureConfig(target, env) {
|
|
|
651
772
|
deploymentName,
|
|
652
773
|
apiKey,
|
|
653
774
|
version,
|
|
775
|
+
apiFormat,
|
|
654
776
|
temperature,
|
|
655
777
|
maxOutputTokens,
|
|
656
778
|
retry
|
|
657
779
|
};
|
|
658
780
|
}
|
|
659
|
-
function resolveApiFormat(target, targetName) {
|
|
660
|
-
const raw = target.api_format
|
|
781
|
+
function resolveApiFormat(target, env, targetName) {
|
|
782
|
+
const raw = resolveOptionalString(target.api_format, env, `${targetName} api format`, {
|
|
783
|
+
allowLiteral: true,
|
|
784
|
+
optionalEnv: true
|
|
785
|
+
});
|
|
661
786
|
if (raw === void 0) return void 0;
|
|
662
787
|
if (raw === "chat" || raw === "responses") return raw;
|
|
663
788
|
throw new Error(
|
|
@@ -665,11 +790,11 @@ function resolveApiFormat(target, targetName) {
|
|
|
665
790
|
);
|
|
666
791
|
}
|
|
667
792
|
function resolveOpenAIConfig(target, env) {
|
|
668
|
-
const endpointSource = target.endpoint ?? target.base_url
|
|
669
|
-
const apiKeySource = target.api_key
|
|
793
|
+
const endpointSource = target.endpoint ?? target.base_url;
|
|
794
|
+
const apiKeySource = target.api_key;
|
|
670
795
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
671
796
|
const temperatureSource = target.temperature;
|
|
672
|
-
const maxTokensSource = target.max_output_tokens
|
|
797
|
+
const maxTokensSource = target.max_output_tokens;
|
|
673
798
|
const baseURL = normalizeOpenAIBaseUrl(
|
|
674
799
|
resolveOptionalString(endpointSource, env, `${target.name} endpoint`, {
|
|
675
800
|
allowLiteral: true,
|
|
@@ -683,17 +808,17 @@ function resolveOpenAIConfig(target, env) {
|
|
|
683
808
|
baseURL,
|
|
684
809
|
apiKey,
|
|
685
810
|
model,
|
|
686
|
-
apiFormat: resolveApiFormat(target, target.name),
|
|
811
|
+
apiFormat: resolveApiFormat(target, env, target.name),
|
|
687
812
|
temperature: resolveOptionalNumber(temperatureSource, `${target.name} temperature`),
|
|
688
813
|
maxOutputTokens: resolveOptionalNumber(maxTokensSource, `${target.name} max output tokens`),
|
|
689
814
|
retry
|
|
690
815
|
};
|
|
691
816
|
}
|
|
692
817
|
function resolveOpenRouterConfig(target, env) {
|
|
693
|
-
const apiKeySource = target.api_key
|
|
818
|
+
const apiKeySource = target.api_key;
|
|
694
819
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
695
820
|
const temperatureSource = target.temperature;
|
|
696
|
-
const maxTokensSource = target.max_output_tokens
|
|
821
|
+
const maxTokensSource = target.max_output_tokens;
|
|
697
822
|
const retry = resolveRetryConfig(target);
|
|
698
823
|
return {
|
|
699
824
|
apiKey: resolveString(apiKeySource, env, `${target.name} OpenRouter api key`),
|
|
@@ -704,11 +829,11 @@ function resolveOpenRouterConfig(target, env) {
|
|
|
704
829
|
};
|
|
705
830
|
}
|
|
706
831
|
function resolveAnthropicConfig(target, env) {
|
|
707
|
-
const apiKeySource = target.api_key
|
|
832
|
+
const apiKeySource = target.api_key;
|
|
708
833
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
709
834
|
const temperatureSource = target.temperature;
|
|
710
|
-
const maxTokensSource = target.max_output_tokens
|
|
711
|
-
const thinkingBudgetSource = target.thinking_budget
|
|
835
|
+
const maxTokensSource = target.max_output_tokens;
|
|
836
|
+
const thinkingBudgetSource = target.thinking_budget;
|
|
712
837
|
const apiKey = resolveString(apiKeySource, env, `${target.name} Anthropic api key`);
|
|
713
838
|
const model = resolveString(modelSource, env, `${target.name} Anthropic model`);
|
|
714
839
|
const retry = resolveRetryConfig(target);
|
|
@@ -722,10 +847,10 @@ function resolveAnthropicConfig(target, env) {
|
|
|
722
847
|
};
|
|
723
848
|
}
|
|
724
849
|
function resolveGeminiConfig(target, env) {
|
|
725
|
-
const apiKeySource = target.api_key
|
|
850
|
+
const apiKeySource = target.api_key;
|
|
726
851
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
727
852
|
const temperatureSource = target.temperature;
|
|
728
|
-
const maxTokensSource = target.max_output_tokens
|
|
853
|
+
const maxTokensSource = target.max_output_tokens;
|
|
729
854
|
const apiKey = resolveString(apiKeySource, env, `${target.name} Google API key`);
|
|
730
855
|
const model = resolveOptionalString(modelSource, env, `${target.name} Gemini model`, {
|
|
731
856
|
allowLiteral: true,
|
|
@@ -745,11 +870,11 @@ function resolveCodexConfig(target, env, evalFilePath) {
|
|
|
745
870
|
const executableSource = target.executable ?? target.command ?? target.binary;
|
|
746
871
|
const argsSource = target.args ?? target.arguments;
|
|
747
872
|
const cwdSource = target.cwd;
|
|
748
|
-
const workspaceTemplateSource = target.workspace_template
|
|
749
|
-
const timeoutSource = target.timeout_seconds
|
|
750
|
-
const logDirSource = target.log_dir ?? target.
|
|
751
|
-
const logFormatSource = target.log_format ?? target.
|
|
752
|
-
const systemPromptSource = target.system_prompt
|
|
873
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
874
|
+
const timeoutSource = target.timeout_seconds;
|
|
875
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
876
|
+
const logFormatSource = target.log_format ?? target.log_output_format ?? env.AGENTV_CODEX_LOG_FORMAT;
|
|
877
|
+
const systemPromptSource = target.system_prompt;
|
|
753
878
|
const model = resolveOptionalString(modelSource, env, `${target.name} codex model`, {
|
|
754
879
|
allowLiteral: true,
|
|
755
880
|
optionalEnv: true
|
|
@@ -813,16 +938,16 @@ function normalizeCodexLogFormat(value) {
|
|
|
813
938
|
throw new Error("codex log format must be 'summary' or 'json'");
|
|
814
939
|
}
|
|
815
940
|
function resolveCopilotSdkConfig(target, env, evalFilePath) {
|
|
816
|
-
const cliUrlSource = target.cli_url
|
|
817
|
-
const cliPathSource = target.cli_path
|
|
818
|
-
const githubTokenSource = target.github_token
|
|
941
|
+
const cliUrlSource = target.cli_url;
|
|
942
|
+
const cliPathSource = target.cli_path;
|
|
943
|
+
const githubTokenSource = target.github_token;
|
|
819
944
|
const modelSource = target.model;
|
|
820
945
|
const cwdSource = target.cwd;
|
|
821
|
-
const workspaceTemplateSource = target.workspace_template
|
|
822
|
-
const timeoutSource = target.timeout_seconds
|
|
823
|
-
const logDirSource = target.log_dir ?? target.
|
|
824
|
-
const logFormatSource = target.log_format
|
|
825
|
-
const systemPromptSource = target.system_prompt
|
|
946
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
947
|
+
const timeoutSource = target.timeout_seconds;
|
|
948
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
949
|
+
const logFormatSource = target.log_format;
|
|
950
|
+
const systemPromptSource = target.system_prompt;
|
|
826
951
|
const cliUrl = resolveOptionalString(cliUrlSource, env, `${target.name} copilot-sdk cli URL`, {
|
|
827
952
|
allowLiteral: true,
|
|
828
953
|
optionalEnv: true
|
|
@@ -895,11 +1020,11 @@ function resolveCopilotCliConfig(target, env, evalFilePath) {
|
|
|
895
1020
|
const modelSource = target.model;
|
|
896
1021
|
const argsSource = target.args ?? target.arguments;
|
|
897
1022
|
const cwdSource = target.cwd;
|
|
898
|
-
const workspaceTemplateSource = target.workspace_template
|
|
899
|
-
const timeoutSource = target.timeout_seconds
|
|
900
|
-
const logDirSource = target.log_dir ?? target.
|
|
901
|
-
const logFormatSource = target.log_format
|
|
902
|
-
const systemPromptSource = target.system_prompt
|
|
1023
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1024
|
+
const timeoutSource = target.timeout_seconds;
|
|
1025
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1026
|
+
const logFormatSource = target.log_format;
|
|
1027
|
+
const systemPromptSource = target.system_prompt;
|
|
903
1028
|
const executable = resolveOptionalString(executableSource, env, `${target.name} copilot-cli executable`, {
|
|
904
1029
|
allowLiteral: true,
|
|
905
1030
|
optionalEnv: true
|
|
@@ -963,16 +1088,16 @@ function normalizeCopilotLogFormat(value) {
|
|
|
963
1088
|
}
|
|
964
1089
|
function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
965
1090
|
const subproviderSource = target.subprovider;
|
|
966
|
-
const modelSource = target.model ?? target.pi_model
|
|
967
|
-
const apiKeySource = target.api_key
|
|
968
|
-
const toolsSource = target.tools ?? target.pi_tools
|
|
969
|
-
const thinkingSource = target.thinking ?? target.pi_thinking
|
|
1091
|
+
const modelSource = target.model ?? target.pi_model;
|
|
1092
|
+
const apiKeySource = target.api_key;
|
|
1093
|
+
const toolsSource = target.tools ?? target.pi_tools;
|
|
1094
|
+
const thinkingSource = target.thinking ?? target.pi_thinking;
|
|
970
1095
|
const cwdSource = target.cwd;
|
|
971
|
-
const workspaceTemplateSource = target.workspace_template
|
|
972
|
-
const timeoutSource = target.timeout_seconds
|
|
973
|
-
const logDirSource = target.log_dir ?? target.
|
|
974
|
-
const logFormatSource = target.log_format
|
|
975
|
-
const systemPromptSource = target.system_prompt
|
|
1096
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1097
|
+
const timeoutSource = target.timeout_seconds;
|
|
1098
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1099
|
+
const logFormatSource = target.log_format;
|
|
1100
|
+
const systemPromptSource = target.system_prompt;
|
|
976
1101
|
const subprovider = resolveOptionalString(
|
|
977
1102
|
subproviderSource,
|
|
978
1103
|
env,
|
|
@@ -990,6 +1115,11 @@ function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
|
990
1115
|
allowLiteral: false,
|
|
991
1116
|
optionalEnv: true
|
|
992
1117
|
});
|
|
1118
|
+
const baseUrlSource = target.base_url ?? target.endpoint;
|
|
1119
|
+
const baseUrl = resolveOptionalString(baseUrlSource, env, `${target.name} pi base url`, {
|
|
1120
|
+
allowLiteral: true,
|
|
1121
|
+
optionalEnv: true
|
|
1122
|
+
});
|
|
993
1123
|
const tools = resolveOptionalString(toolsSource, env, `${target.name} pi tools`, {
|
|
994
1124
|
allowLiteral: true,
|
|
995
1125
|
optionalEnv: true
|
|
@@ -1030,6 +1160,7 @@ function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
|
1030
1160
|
subprovider,
|
|
1031
1161
|
model,
|
|
1032
1162
|
apiKey,
|
|
1163
|
+
baseUrl,
|
|
1033
1164
|
tools,
|
|
1034
1165
|
thinking,
|
|
1035
1166
|
cwd,
|
|
@@ -1043,16 +1174,16 @@ function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
|
1043
1174
|
function resolvePiCliConfig(target, env, evalFilePath) {
|
|
1044
1175
|
const executableSource = target.executable ?? target.command ?? target.binary;
|
|
1045
1176
|
const subproviderSource = target.subprovider;
|
|
1046
|
-
const modelSource = target.model ?? target.pi_model
|
|
1047
|
-
const apiKeySource = target.api_key
|
|
1048
|
-
const toolsSource = target.tools ?? target.pi_tools
|
|
1049
|
-
const thinkingSource = target.thinking ?? target.pi_thinking
|
|
1177
|
+
const modelSource = target.model ?? target.pi_model;
|
|
1178
|
+
const apiKeySource = target.api_key;
|
|
1179
|
+
const toolsSource = target.tools ?? target.pi_tools;
|
|
1180
|
+
const thinkingSource = target.thinking ?? target.pi_thinking;
|
|
1050
1181
|
const cwdSource = target.cwd;
|
|
1051
|
-
const workspaceTemplateSource = target.workspace_template
|
|
1052
|
-
const timeoutSource = target.timeout_seconds
|
|
1053
|
-
const logDirSource = target.log_dir ?? target.
|
|
1054
|
-
const logFormatSource = target.log_format
|
|
1055
|
-
const systemPromptSource = target.system_prompt
|
|
1182
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1183
|
+
const timeoutSource = target.timeout_seconds;
|
|
1184
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1185
|
+
const logFormatSource = target.log_format;
|
|
1186
|
+
const systemPromptSource = target.system_prompt;
|
|
1056
1187
|
const executable = resolveOptionalString(executableSource, env, `${target.name} pi-cli executable`, {
|
|
1057
1188
|
allowLiteral: true,
|
|
1058
1189
|
optionalEnv: true
|
|
@@ -1071,6 +1202,11 @@ function resolvePiCliConfig(target, env, evalFilePath) {
|
|
|
1071
1202
|
allowLiteral: false,
|
|
1072
1203
|
optionalEnv: true
|
|
1073
1204
|
});
|
|
1205
|
+
const baseUrlSource = target.base_url ?? target.endpoint;
|
|
1206
|
+
const baseUrl = resolveOptionalString(baseUrlSource, env, `${target.name} pi-cli base url`, {
|
|
1207
|
+
allowLiteral: true,
|
|
1208
|
+
optionalEnv: true
|
|
1209
|
+
});
|
|
1074
1210
|
const tools = resolveOptionalString(toolsSource, env, `${target.name} pi-cli tools`, {
|
|
1075
1211
|
allowLiteral: true,
|
|
1076
1212
|
optionalEnv: true
|
|
@@ -1109,6 +1245,7 @@ function resolvePiCliConfig(target, env, evalFilePath) {
|
|
|
1109
1245
|
subprovider,
|
|
1110
1246
|
model,
|
|
1111
1247
|
apiKey,
|
|
1248
|
+
baseUrl,
|
|
1112
1249
|
tools,
|
|
1113
1250
|
thinking,
|
|
1114
1251
|
args,
|
|
@@ -1123,11 +1260,11 @@ function resolvePiCliConfig(target, env, evalFilePath) {
|
|
|
1123
1260
|
function resolveClaudeConfig(target, env, evalFilePath) {
|
|
1124
1261
|
const modelSource = target.model;
|
|
1125
1262
|
const cwdSource = target.cwd;
|
|
1126
|
-
const workspaceTemplateSource = target.workspace_template
|
|
1127
|
-
const timeoutSource = target.timeout_seconds
|
|
1128
|
-
const logDirSource = target.log_dir ?? target.
|
|
1129
|
-
const logFormatSource = target.log_format ?? target.
|
|
1130
|
-
const systemPromptSource = target.system_prompt
|
|
1263
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1264
|
+
const timeoutSource = target.timeout_seconds;
|
|
1265
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1266
|
+
const logFormatSource = target.log_format ?? target.log_output_format ?? env.AGENTV_CLAUDE_LOG_FORMAT;
|
|
1267
|
+
const systemPromptSource = target.system_prompt;
|
|
1131
1268
|
const model = resolveOptionalString(modelSource, env, `${target.name} claude model`, {
|
|
1132
1269
|
allowLiteral: true,
|
|
1133
1270
|
optionalEnv: true
|
|
@@ -1160,8 +1297,8 @@ function resolveClaudeConfig(target, env, evalFilePath) {
|
|
|
1160
1297
|
});
|
|
1161
1298
|
const logFormat = normalizeClaudeLogFormat(logFormatSource);
|
|
1162
1299
|
const systemPrompt = typeof systemPromptSource === "string" && systemPromptSource.trim().length > 0 ? systemPromptSource.trim() : void 0;
|
|
1163
|
-
const maxTurns = typeof target.max_turns === "number" ? target.max_turns :
|
|
1164
|
-
const maxBudgetUsd = typeof target.max_budget_usd === "number" ? target.max_budget_usd :
|
|
1300
|
+
const maxTurns = typeof target.max_turns === "number" ? target.max_turns : void 0;
|
|
1301
|
+
const maxBudgetUsd = typeof target.max_budget_usd === "number" ? target.max_budget_usd : void 0;
|
|
1165
1302
|
return {
|
|
1166
1303
|
model,
|
|
1167
1304
|
systemPrompt,
|
|
@@ -1192,9 +1329,7 @@ function resolveMockConfig(target) {
|
|
|
1192
1329
|
return { response };
|
|
1193
1330
|
}
|
|
1194
1331
|
function resolveVSCodeConfig(target, env, insiders, evalFilePath) {
|
|
1195
|
-
const workspaceTemplateEnvVar = resolveOptionalLiteralString(
|
|
1196
|
-
target.workspace_template ?? target.workspaceTemplate
|
|
1197
|
-
);
|
|
1332
|
+
const workspaceTemplateEnvVar = resolveOptionalLiteralString(target.workspace_template);
|
|
1198
1333
|
let workspaceTemplate = workspaceTemplateEnvVar ? resolveOptionalString(
|
|
1199
1334
|
workspaceTemplateEnvVar,
|
|
1200
1335
|
env,
|
|
@@ -1209,9 +1344,9 @@ function resolveVSCodeConfig(target, env, insiders, evalFilePath) {
|
|
|
1209
1344
|
}
|
|
1210
1345
|
const executableSource = target.executable;
|
|
1211
1346
|
const waitSource = target.wait;
|
|
1212
|
-
const dryRunSource = target.dry_run
|
|
1213
|
-
const subagentRootSource = target.subagent_root
|
|
1214
|
-
const timeoutSource = target.timeout_seconds
|
|
1347
|
+
const dryRunSource = target.dry_run;
|
|
1348
|
+
const subagentRootSource = target.subagent_root;
|
|
1349
|
+
const timeoutSource = target.timeout_seconds;
|
|
1215
1350
|
const defaultCommand = insiders ? "code-insiders" : "code";
|
|
1216
1351
|
const executable = resolveOptionalString(executableSource, env, `${target.name} vscode executable`, {
|
|
1217
1352
|
allowLiteral: true,
|
|
@@ -1262,7 +1397,7 @@ function resolveCliConfig(target, env, evalFilePath) {
|
|
|
1262
1397
|
}
|
|
1263
1398
|
function resolveDiscoveredProviderConfig(target, providerKind, env, evalFilePath) {
|
|
1264
1399
|
const command = target.command ? resolveString(target.command, env, `${target.name} command`, true) : `bun run .agentv/providers/${providerKind}.ts {PROMPT}`;
|
|
1265
|
-
const timeoutSeconds = target.timeout_seconds
|
|
1400
|
+
const timeoutSeconds = target.timeout_seconds;
|
|
1266
1401
|
const timeoutMs = resolveTimeoutMs(timeoutSeconds, `${target.name} timeout`);
|
|
1267
1402
|
let cwd = resolveOptionalString(target.cwd, env, `${target.name} working directory`, {
|
|
1268
1403
|
allowLiteral: true,
|
|
@@ -1326,10 +1461,10 @@ function resolveDiscover(value, targetName) {
|
|
|
1326
1461
|
throw new Error(`Target "${targetName}": discover must be "latest" (got "${String(value)}")`);
|
|
1327
1462
|
}
|
|
1328
1463
|
function resolveCopilotLogConfig(target, env) {
|
|
1329
|
-
const sessionDirSource = target.session_dir
|
|
1330
|
-
const sessionIdSource = target.session_id
|
|
1464
|
+
const sessionDirSource = target.session_dir;
|
|
1465
|
+
const sessionIdSource = target.session_id;
|
|
1331
1466
|
const discoverSource = target.discover;
|
|
1332
|
-
const sessionStateDirSource = target.session_state_dir
|
|
1467
|
+
const sessionStateDirSource = target.session_state_dir;
|
|
1333
1468
|
const cwdSource = target.cwd;
|
|
1334
1469
|
return {
|
|
1335
1470
|
sessionDir: resolveOptionalString(
|
|
@@ -1504,6 +1639,15 @@ var AGENT_PROVIDER_KINDS = [
|
|
|
1504
1639
|
"vscode",
|
|
1505
1640
|
"vscode-insiders"
|
|
1506
1641
|
];
|
|
1642
|
+
var LLM_GRADER_CAPABLE_KINDS = [
|
|
1643
|
+
"openai",
|
|
1644
|
+
"openrouter",
|
|
1645
|
+
"azure",
|
|
1646
|
+
"anthropic",
|
|
1647
|
+
"gemini",
|
|
1648
|
+
"agentv",
|
|
1649
|
+
"mock"
|
|
1650
|
+
];
|
|
1507
1651
|
var KNOWN_PROVIDERS = [
|
|
1508
1652
|
"openai",
|
|
1509
1653
|
"openrouter",
|
|
@@ -1523,7 +1667,8 @@ var KNOWN_PROVIDERS = [
|
|
|
1523
1667
|
"mock",
|
|
1524
1668
|
"vscode",
|
|
1525
1669
|
"vscode-insiders",
|
|
1526
|
-
"agentv"
|
|
1670
|
+
"agentv",
|
|
1671
|
+
"transcript"
|
|
1527
1672
|
];
|
|
1528
1673
|
var PROVIDER_ALIASES = [
|
|
1529
1674
|
"azure-openai",
|
|
@@ -1728,11 +1873,14 @@ export {
|
|
|
1728
1873
|
buildSearchRoots,
|
|
1729
1874
|
resolveFileReference,
|
|
1730
1875
|
CLI_PLACEHOLDERS,
|
|
1876
|
+
findDeprecatedCamelCaseTargetWarnings,
|
|
1731
1877
|
COMMON_TARGET_SETTINGS,
|
|
1878
|
+
resolveDelegatedTargetDefinition,
|
|
1732
1879
|
resolveTargetDefinition,
|
|
1880
|
+
LLM_GRADER_CAPABLE_KINDS,
|
|
1733
1881
|
KNOWN_PROVIDERS,
|
|
1734
1882
|
PROVIDER_ALIASES,
|
|
1735
1883
|
extractLastAssistantContent,
|
|
1736
1884
|
isAgentProvider
|
|
1737
1885
|
};
|
|
1738
|
-
//# sourceMappingURL=chunk-
|
|
1886
|
+
//# sourceMappingURL=chunk-75RFVESM.js.map
|