@agentv/core 4.6.1 → 4.8.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-ZK4GG7PR.js → chunk-VCVVKCC4.js} +268 -128
- package/dist/chunk-VCVVKCC4.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +110 -94
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +30 -71
- package/dist/evaluation/validation/index.js.map +1 -1
- package/dist/index.cjs +1353 -466
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +301 -74
- package/dist/index.d.ts +301 -74
- package/dist/index.js +1053 -311
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-ZK4GG7PR.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,14 +371,104 @@ 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
|
];
|
|
395
473
|
var USE_TARGET_ENV_PATTERN = /^\$\{\{\s*([A-Z0-9_]+)\s*\}\}$/i;
|
|
396
474
|
var BASE_TARGET_SCHEMA = z.object({
|
|
@@ -402,43 +480,40 @@ var BASE_TARGET_SCHEMA = z.object({
|
|
|
402
480
|
// backward compat
|
|
403
481
|
workers: z.number().int().min(1).optional(),
|
|
404
482
|
workspace_template: z.string().optional(),
|
|
405
|
-
workspaceTemplate: z.string().optional(),
|
|
406
483
|
subagent_mode_allowed: z.boolean().optional(),
|
|
407
|
-
fallback_targets: z.array(z.string().min(1)).optional()
|
|
408
|
-
fallbackTargets: z.array(z.string().min(1)).optional()
|
|
484
|
+
fallback_targets: z.array(z.string().min(1)).optional()
|
|
409
485
|
}).passthrough();
|
|
410
486
|
var DEFAULT_AZURE_API_VERSION = "2024-12-01-preview";
|
|
487
|
+
var DEFAULT_AZURE_RESPONSES_API_VERSION = "v1";
|
|
411
488
|
var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
412
|
-
function normalizeAzureApiVersion(value) {
|
|
489
|
+
function normalizeAzureApiVersion(value, apiFormat) {
|
|
490
|
+
const defaultVersion = apiFormat === "responses" ? DEFAULT_AZURE_RESPONSES_API_VERSION : DEFAULT_AZURE_API_VERSION;
|
|
413
491
|
if (!value) {
|
|
414
|
-
return
|
|
492
|
+
return defaultVersion;
|
|
415
493
|
}
|
|
416
494
|
const trimmed = value.trim();
|
|
417
495
|
if (trimmed.length === 0) {
|
|
418
|
-
return
|
|
496
|
+
return defaultVersion;
|
|
419
497
|
}
|
|
420
498
|
const withoutPrefix = trimmed.replace(/^api[-_]?version\s*=\s*/i, "").trim();
|
|
421
|
-
return withoutPrefix.length > 0 ? withoutPrefix :
|
|
499
|
+
return withoutPrefix.length > 0 ? withoutPrefix : defaultVersion;
|
|
422
500
|
}
|
|
423
501
|
function resolveRetryConfig(target) {
|
|
424
|
-
const maxRetries = resolveOptionalNumber(
|
|
425
|
-
target.max_retries ?? target.maxRetries,
|
|
426
|
-
`${target.name} max retries`
|
|
427
|
-
);
|
|
502
|
+
const maxRetries = resolveOptionalNumber(target.max_retries, `${target.name} max retries`);
|
|
428
503
|
const initialDelayMs = resolveOptionalNumber(
|
|
429
|
-
target.retry_initial_delay_ms
|
|
504
|
+
target.retry_initial_delay_ms,
|
|
430
505
|
`${target.name} retry initial delay`
|
|
431
506
|
);
|
|
432
507
|
const maxDelayMs = resolveOptionalNumber(
|
|
433
|
-
target.retry_max_delay_ms
|
|
508
|
+
target.retry_max_delay_ms,
|
|
434
509
|
`${target.name} retry max delay`
|
|
435
510
|
);
|
|
436
511
|
const backoffFactor = resolveOptionalNumber(
|
|
437
|
-
target.retry_backoff_factor
|
|
512
|
+
target.retry_backoff_factor,
|
|
438
513
|
`${target.name} retry backoff factor`
|
|
439
514
|
);
|
|
440
515
|
const retryableStatusCodes = resolveOptionalNumberArray(
|
|
441
|
-
target.retry_status_codes
|
|
516
|
+
target.retry_status_codes,
|
|
442
517
|
`${target.name} retry status codes`
|
|
443
518
|
);
|
|
444
519
|
if (maxRetries === void 0 && initialDelayMs === void 0 && maxDelayMs === void 0 && backoffFactor === void 0 && retryableStatusCodes === void 0) {
|
|
@@ -498,9 +573,10 @@ function resolveDelegatedTargetDefinition(name, definitions, env = process.env)
|
|
|
498
573
|
`Target "${name}" exceeded the maximum use_target resolution depth (10). Check for a delegation loop or overly deep alias chain.`
|
|
499
574
|
);
|
|
500
575
|
}
|
|
501
|
-
function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
|
|
576
|
+
function resolveTargetDefinition(definition, env = process.env, evalFilePath, options) {
|
|
577
|
+
assertNoDeprecatedCamelCaseTargetFields(definition);
|
|
502
578
|
const parsed = BASE_TARGET_SCHEMA.parse(definition);
|
|
503
|
-
if (parsed.workspace_template !== void 0
|
|
579
|
+
if (parsed.workspace_template !== void 0) {
|
|
504
580
|
throw new Error(
|
|
505
581
|
`${parsed.name}: target-level workspace_template has been removed. Use eval-level workspace.template.`
|
|
506
582
|
);
|
|
@@ -516,13 +592,9 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
|
|
|
516
592
|
`${parsed.name} provider`,
|
|
517
593
|
true
|
|
518
594
|
).toLowerCase();
|
|
519
|
-
const providerBatching = resolveOptionalBoolean(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const subagentModeAllowed = resolveOptionalBoolean(
|
|
523
|
-
parsed.subagent_mode_allowed ?? parsed.subagentModeAllowed
|
|
524
|
-
);
|
|
525
|
-
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;
|
|
526
598
|
const base = {
|
|
527
599
|
name: parsed.name,
|
|
528
600
|
graderTarget: parsed.grader_target ?? parsed.judge_target,
|
|
@@ -672,20 +744,22 @@ function normalizeOpenAIBaseUrl(value) {
|
|
|
672
744
|
return trimmed.endsWith("/v1") ? trimmed : `${trimmed}/v1`;
|
|
673
745
|
}
|
|
674
746
|
function resolveAzureConfig(target, env) {
|
|
675
|
-
const endpointSource = target.endpoint ?? target.resource
|
|
676
|
-
const apiKeySource = target.api_key
|
|
677
|
-
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;
|
|
678
750
|
const versionSource = target.version ?? target.api_version;
|
|
679
751
|
const temperatureSource = target.temperature;
|
|
680
|
-
const maxTokensSource = target.max_output_tokens
|
|
752
|
+
const maxTokensSource = target.max_output_tokens;
|
|
681
753
|
const resourceName = resolveString(endpointSource, env, `${target.name} endpoint`);
|
|
682
754
|
const apiKey = resolveString(apiKeySource, env, `${target.name} api key`);
|
|
683
755
|
const deploymentName = resolveString(deploymentSource, env, `${target.name} deployment`);
|
|
756
|
+
const apiFormat = resolveApiFormat(target, env, target.name);
|
|
684
757
|
const version = normalizeAzureApiVersion(
|
|
685
758
|
resolveOptionalString(versionSource, env, `${target.name} api version`, {
|
|
686
759
|
allowLiteral: true,
|
|
687
760
|
optionalEnv: true
|
|
688
|
-
})
|
|
761
|
+
}),
|
|
762
|
+
apiFormat
|
|
689
763
|
);
|
|
690
764
|
const temperature = resolveOptionalNumber(temperatureSource, `${target.name} temperature`);
|
|
691
765
|
const maxOutputTokens = resolveOptionalNumber(
|
|
@@ -698,13 +772,17 @@ function resolveAzureConfig(target, env) {
|
|
|
698
772
|
deploymentName,
|
|
699
773
|
apiKey,
|
|
700
774
|
version,
|
|
775
|
+
apiFormat,
|
|
701
776
|
temperature,
|
|
702
777
|
maxOutputTokens,
|
|
703
778
|
retry
|
|
704
779
|
};
|
|
705
780
|
}
|
|
706
|
-
function resolveApiFormat(target, targetName) {
|
|
707
|
-
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
|
+
});
|
|
708
786
|
if (raw === void 0) return void 0;
|
|
709
787
|
if (raw === "chat" || raw === "responses") return raw;
|
|
710
788
|
throw new Error(
|
|
@@ -712,11 +790,11 @@ function resolveApiFormat(target, targetName) {
|
|
|
712
790
|
);
|
|
713
791
|
}
|
|
714
792
|
function resolveOpenAIConfig(target, env) {
|
|
715
|
-
const endpointSource = target.endpoint ?? target.base_url
|
|
716
|
-
const apiKeySource = target.api_key
|
|
793
|
+
const endpointSource = target.endpoint ?? target.base_url;
|
|
794
|
+
const apiKeySource = target.api_key;
|
|
717
795
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
718
796
|
const temperatureSource = target.temperature;
|
|
719
|
-
const maxTokensSource = target.max_output_tokens
|
|
797
|
+
const maxTokensSource = target.max_output_tokens;
|
|
720
798
|
const baseURL = normalizeOpenAIBaseUrl(
|
|
721
799
|
resolveOptionalString(endpointSource, env, `${target.name} endpoint`, {
|
|
722
800
|
allowLiteral: true,
|
|
@@ -730,17 +808,17 @@ function resolveOpenAIConfig(target, env) {
|
|
|
730
808
|
baseURL,
|
|
731
809
|
apiKey,
|
|
732
810
|
model,
|
|
733
|
-
apiFormat: resolveApiFormat(target, target.name),
|
|
811
|
+
apiFormat: resolveApiFormat(target, env, target.name),
|
|
734
812
|
temperature: resolveOptionalNumber(temperatureSource, `${target.name} temperature`),
|
|
735
813
|
maxOutputTokens: resolveOptionalNumber(maxTokensSource, `${target.name} max output tokens`),
|
|
736
814
|
retry
|
|
737
815
|
};
|
|
738
816
|
}
|
|
739
817
|
function resolveOpenRouterConfig(target, env) {
|
|
740
|
-
const apiKeySource = target.api_key
|
|
818
|
+
const apiKeySource = target.api_key;
|
|
741
819
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
742
820
|
const temperatureSource = target.temperature;
|
|
743
|
-
const maxTokensSource = target.max_output_tokens
|
|
821
|
+
const maxTokensSource = target.max_output_tokens;
|
|
744
822
|
const retry = resolveRetryConfig(target);
|
|
745
823
|
return {
|
|
746
824
|
apiKey: resolveString(apiKeySource, env, `${target.name} OpenRouter api key`),
|
|
@@ -751,11 +829,11 @@ function resolveOpenRouterConfig(target, env) {
|
|
|
751
829
|
};
|
|
752
830
|
}
|
|
753
831
|
function resolveAnthropicConfig(target, env) {
|
|
754
|
-
const apiKeySource = target.api_key
|
|
832
|
+
const apiKeySource = target.api_key;
|
|
755
833
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
756
834
|
const temperatureSource = target.temperature;
|
|
757
|
-
const maxTokensSource = target.max_output_tokens
|
|
758
|
-
const thinkingBudgetSource = target.thinking_budget
|
|
835
|
+
const maxTokensSource = target.max_output_tokens;
|
|
836
|
+
const thinkingBudgetSource = target.thinking_budget;
|
|
759
837
|
const apiKey = resolveString(apiKeySource, env, `${target.name} Anthropic api key`);
|
|
760
838
|
const model = resolveString(modelSource, env, `${target.name} Anthropic model`);
|
|
761
839
|
const retry = resolveRetryConfig(target);
|
|
@@ -769,10 +847,10 @@ function resolveAnthropicConfig(target, env) {
|
|
|
769
847
|
};
|
|
770
848
|
}
|
|
771
849
|
function resolveGeminiConfig(target, env) {
|
|
772
|
-
const apiKeySource = target.api_key
|
|
850
|
+
const apiKeySource = target.api_key;
|
|
773
851
|
const modelSource = target.model ?? target.deployment ?? target.variant;
|
|
774
852
|
const temperatureSource = target.temperature;
|
|
775
|
-
const maxTokensSource = target.max_output_tokens
|
|
853
|
+
const maxTokensSource = target.max_output_tokens;
|
|
776
854
|
const apiKey = resolveString(apiKeySource, env, `${target.name} Google API key`);
|
|
777
855
|
const model = resolveOptionalString(modelSource, env, `${target.name} Gemini model`, {
|
|
778
856
|
allowLiteral: true,
|
|
@@ -792,11 +870,11 @@ function resolveCodexConfig(target, env, evalFilePath) {
|
|
|
792
870
|
const executableSource = target.executable ?? target.command ?? target.binary;
|
|
793
871
|
const argsSource = target.args ?? target.arguments;
|
|
794
872
|
const cwdSource = target.cwd;
|
|
795
|
-
const workspaceTemplateSource = target.workspace_template
|
|
796
|
-
const timeoutSource = target.timeout_seconds
|
|
797
|
-
const logDirSource = target.log_dir ?? target.
|
|
798
|
-
const logFormatSource = target.log_format ?? target.
|
|
799
|
-
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;
|
|
800
878
|
const model = resolveOptionalString(modelSource, env, `${target.name} codex model`, {
|
|
801
879
|
allowLiteral: true,
|
|
802
880
|
optionalEnv: true
|
|
@@ -860,16 +938,16 @@ function normalizeCodexLogFormat(value) {
|
|
|
860
938
|
throw new Error("codex log format must be 'summary' or 'json'");
|
|
861
939
|
}
|
|
862
940
|
function resolveCopilotSdkConfig(target, env, evalFilePath) {
|
|
863
|
-
const cliUrlSource = target.cli_url
|
|
864
|
-
const cliPathSource = target.cli_path
|
|
865
|
-
const githubTokenSource = target.github_token
|
|
941
|
+
const cliUrlSource = target.cli_url;
|
|
942
|
+
const cliPathSource = target.cli_path;
|
|
943
|
+
const githubTokenSource = target.github_token;
|
|
866
944
|
const modelSource = target.model;
|
|
867
945
|
const cwdSource = target.cwd;
|
|
868
|
-
const workspaceTemplateSource = target.workspace_template
|
|
869
|
-
const timeoutSource = target.timeout_seconds
|
|
870
|
-
const logDirSource = target.log_dir ?? target.
|
|
871
|
-
const logFormatSource = target.log_format
|
|
872
|
-
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;
|
|
873
951
|
const cliUrl = resolveOptionalString(cliUrlSource, env, `${target.name} copilot-sdk cli URL`, {
|
|
874
952
|
allowLiteral: true,
|
|
875
953
|
optionalEnv: true
|
|
@@ -924,6 +1002,52 @@ function resolveCopilotSdkConfig(target, env, evalFilePath) {
|
|
|
924
1002
|
);
|
|
925
1003
|
const logFormat = normalizeCopilotLogFormat(logFormatSource);
|
|
926
1004
|
const systemPrompt = typeof systemPromptSource === "string" && systemPromptSource.trim().length > 0 ? systemPromptSource.trim() : void 0;
|
|
1005
|
+
const byok = target.byok;
|
|
1006
|
+
let byokType;
|
|
1007
|
+
let byokBaseUrl;
|
|
1008
|
+
let byokApiKey;
|
|
1009
|
+
let byokBearerToken;
|
|
1010
|
+
let byokApiVersion;
|
|
1011
|
+
let byokWireApi;
|
|
1012
|
+
if (byok && typeof byok === "object") {
|
|
1013
|
+
byokType = resolveOptionalString(byok.type, env, `${target.name} byok type`, {
|
|
1014
|
+
allowLiteral: true,
|
|
1015
|
+
optionalEnv: true
|
|
1016
|
+
});
|
|
1017
|
+
byokBaseUrl = resolveOptionalString(byok.base_url, env, `${target.name} byok base URL`, {
|
|
1018
|
+
allowLiteral: true,
|
|
1019
|
+
optionalEnv: true
|
|
1020
|
+
});
|
|
1021
|
+
byokApiKey = resolveOptionalString(byok.api_key, env, `${target.name} byok API key`, {
|
|
1022
|
+
allowLiteral: false,
|
|
1023
|
+
optionalEnv: true
|
|
1024
|
+
});
|
|
1025
|
+
byokBearerToken = resolveOptionalString(
|
|
1026
|
+
byok.bearer_token,
|
|
1027
|
+
env,
|
|
1028
|
+
`${target.name} byok bearer token`,
|
|
1029
|
+
{
|
|
1030
|
+
allowLiteral: false,
|
|
1031
|
+
optionalEnv: true
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
byokApiVersion = resolveOptionalString(
|
|
1035
|
+
byok.api_version,
|
|
1036
|
+
env,
|
|
1037
|
+
`${target.name} byok API version`,
|
|
1038
|
+
{
|
|
1039
|
+
allowLiteral: true,
|
|
1040
|
+
optionalEnv: true
|
|
1041
|
+
}
|
|
1042
|
+
);
|
|
1043
|
+
byokWireApi = resolveOptionalString(byok.wire_api, env, `${target.name} byok wire API`, {
|
|
1044
|
+
allowLiteral: true,
|
|
1045
|
+
optionalEnv: true
|
|
1046
|
+
});
|
|
1047
|
+
if (!byokBaseUrl) {
|
|
1048
|
+
throw new Error(`${target.name}: 'byok.base_url' is required when 'byok' is specified`);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
927
1051
|
return {
|
|
928
1052
|
cliUrl,
|
|
929
1053
|
cliPath,
|
|
@@ -934,7 +1058,13 @@ function resolveCopilotSdkConfig(target, env, evalFilePath) {
|
|
|
934
1058
|
timeoutMs,
|
|
935
1059
|
logDir,
|
|
936
1060
|
logFormat,
|
|
937
|
-
systemPrompt
|
|
1061
|
+
systemPrompt,
|
|
1062
|
+
byokType,
|
|
1063
|
+
byokBaseUrl,
|
|
1064
|
+
byokApiKey,
|
|
1065
|
+
byokBearerToken,
|
|
1066
|
+
byokApiVersion,
|
|
1067
|
+
byokWireApi
|
|
938
1068
|
};
|
|
939
1069
|
}
|
|
940
1070
|
function resolveCopilotCliConfig(target, env, evalFilePath) {
|
|
@@ -942,11 +1072,11 @@ function resolveCopilotCliConfig(target, env, evalFilePath) {
|
|
|
942
1072
|
const modelSource = target.model;
|
|
943
1073
|
const argsSource = target.args ?? target.arguments;
|
|
944
1074
|
const cwdSource = target.cwd;
|
|
945
|
-
const workspaceTemplateSource = target.workspace_template
|
|
946
|
-
const timeoutSource = target.timeout_seconds
|
|
947
|
-
const logDirSource = target.log_dir ?? target.
|
|
948
|
-
const logFormatSource = target.log_format
|
|
949
|
-
const systemPromptSource = target.system_prompt
|
|
1075
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1076
|
+
const timeoutSource = target.timeout_seconds;
|
|
1077
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1078
|
+
const logFormatSource = target.log_format;
|
|
1079
|
+
const systemPromptSource = target.system_prompt;
|
|
950
1080
|
const executable = resolveOptionalString(executableSource, env, `${target.name} copilot-cli executable`, {
|
|
951
1081
|
allowLiteral: true,
|
|
952
1082
|
optionalEnv: true
|
|
@@ -1010,16 +1140,16 @@ function normalizeCopilotLogFormat(value) {
|
|
|
1010
1140
|
}
|
|
1011
1141
|
function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
1012
1142
|
const subproviderSource = target.subprovider;
|
|
1013
|
-
const modelSource = target.model ?? target.pi_model
|
|
1014
|
-
const apiKeySource = target.api_key
|
|
1015
|
-
const toolsSource = target.tools ?? target.pi_tools
|
|
1016
|
-
const thinkingSource = target.thinking ?? target.pi_thinking
|
|
1143
|
+
const modelSource = target.model ?? target.pi_model;
|
|
1144
|
+
const apiKeySource = target.api_key;
|
|
1145
|
+
const toolsSource = target.tools ?? target.pi_tools;
|
|
1146
|
+
const thinkingSource = target.thinking ?? target.pi_thinking;
|
|
1017
1147
|
const cwdSource = target.cwd;
|
|
1018
|
-
const workspaceTemplateSource = target.workspace_template
|
|
1019
|
-
const timeoutSource = target.timeout_seconds
|
|
1020
|
-
const logDirSource = target.log_dir ?? target.
|
|
1021
|
-
const logFormatSource = target.log_format
|
|
1022
|
-
const systemPromptSource = target.system_prompt
|
|
1148
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1149
|
+
const timeoutSource = target.timeout_seconds;
|
|
1150
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1151
|
+
const logFormatSource = target.log_format;
|
|
1152
|
+
const systemPromptSource = target.system_prompt;
|
|
1023
1153
|
const subprovider = resolveOptionalString(
|
|
1024
1154
|
subproviderSource,
|
|
1025
1155
|
env,
|
|
@@ -1037,7 +1167,7 @@ function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
|
1037
1167
|
allowLiteral: false,
|
|
1038
1168
|
optionalEnv: true
|
|
1039
1169
|
});
|
|
1040
|
-
const baseUrlSource = target.base_url ?? target.
|
|
1170
|
+
const baseUrlSource = target.base_url ?? target.endpoint;
|
|
1041
1171
|
const baseUrl = resolveOptionalString(baseUrlSource, env, `${target.name} pi base url`, {
|
|
1042
1172
|
allowLiteral: true,
|
|
1043
1173
|
optionalEnv: true
|
|
@@ -1096,16 +1226,16 @@ function resolvePiCodingAgentConfig(target, env, evalFilePath) {
|
|
|
1096
1226
|
function resolvePiCliConfig(target, env, evalFilePath) {
|
|
1097
1227
|
const executableSource = target.executable ?? target.command ?? target.binary;
|
|
1098
1228
|
const subproviderSource = target.subprovider;
|
|
1099
|
-
const modelSource = target.model ?? target.pi_model
|
|
1100
|
-
const apiKeySource = target.api_key
|
|
1101
|
-
const toolsSource = target.tools ?? target.pi_tools
|
|
1102
|
-
const thinkingSource = target.thinking ?? target.pi_thinking
|
|
1229
|
+
const modelSource = target.model ?? target.pi_model;
|
|
1230
|
+
const apiKeySource = target.api_key;
|
|
1231
|
+
const toolsSource = target.tools ?? target.pi_tools;
|
|
1232
|
+
const thinkingSource = target.thinking ?? target.pi_thinking;
|
|
1103
1233
|
const cwdSource = target.cwd;
|
|
1104
|
-
const workspaceTemplateSource = target.workspace_template
|
|
1105
|
-
const timeoutSource = target.timeout_seconds
|
|
1106
|
-
const logDirSource = target.log_dir ?? target.
|
|
1107
|
-
const logFormatSource = target.log_format
|
|
1108
|
-
const systemPromptSource = target.system_prompt
|
|
1234
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1235
|
+
const timeoutSource = target.timeout_seconds;
|
|
1236
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1237
|
+
const logFormatSource = target.log_format;
|
|
1238
|
+
const systemPromptSource = target.system_prompt;
|
|
1109
1239
|
const executable = resolveOptionalString(executableSource, env, `${target.name} pi-cli executable`, {
|
|
1110
1240
|
allowLiteral: true,
|
|
1111
1241
|
optionalEnv: true
|
|
@@ -1124,7 +1254,7 @@ function resolvePiCliConfig(target, env, evalFilePath) {
|
|
|
1124
1254
|
allowLiteral: false,
|
|
1125
1255
|
optionalEnv: true
|
|
1126
1256
|
});
|
|
1127
|
-
const baseUrlSource = target.base_url ?? target.
|
|
1257
|
+
const baseUrlSource = target.base_url ?? target.endpoint;
|
|
1128
1258
|
const baseUrl = resolveOptionalString(baseUrlSource, env, `${target.name} pi-cli base url`, {
|
|
1129
1259
|
allowLiteral: true,
|
|
1130
1260
|
optionalEnv: true
|
|
@@ -1182,11 +1312,11 @@ function resolvePiCliConfig(target, env, evalFilePath) {
|
|
|
1182
1312
|
function resolveClaudeConfig(target, env, evalFilePath) {
|
|
1183
1313
|
const modelSource = target.model;
|
|
1184
1314
|
const cwdSource = target.cwd;
|
|
1185
|
-
const workspaceTemplateSource = target.workspace_template
|
|
1186
|
-
const timeoutSource = target.timeout_seconds
|
|
1187
|
-
const logDirSource = target.log_dir ?? target.
|
|
1188
|
-
const logFormatSource = target.log_format ?? target.
|
|
1189
|
-
const systemPromptSource = target.system_prompt
|
|
1315
|
+
const workspaceTemplateSource = target.workspace_template;
|
|
1316
|
+
const timeoutSource = target.timeout_seconds;
|
|
1317
|
+
const logDirSource = target.log_dir ?? target.log_directory;
|
|
1318
|
+
const logFormatSource = target.log_format ?? target.log_output_format ?? env.AGENTV_CLAUDE_LOG_FORMAT;
|
|
1319
|
+
const systemPromptSource = target.system_prompt;
|
|
1190
1320
|
const model = resolveOptionalString(modelSource, env, `${target.name} claude model`, {
|
|
1191
1321
|
allowLiteral: true,
|
|
1192
1322
|
optionalEnv: true
|
|
@@ -1219,8 +1349,8 @@ function resolveClaudeConfig(target, env, evalFilePath) {
|
|
|
1219
1349
|
});
|
|
1220
1350
|
const logFormat = normalizeClaudeLogFormat(logFormatSource);
|
|
1221
1351
|
const systemPrompt = typeof systemPromptSource === "string" && systemPromptSource.trim().length > 0 ? systemPromptSource.trim() : void 0;
|
|
1222
|
-
const maxTurns = typeof target.max_turns === "number" ? target.max_turns :
|
|
1223
|
-
const maxBudgetUsd = typeof target.max_budget_usd === "number" ? target.max_budget_usd :
|
|
1352
|
+
const maxTurns = typeof target.max_turns === "number" ? target.max_turns : void 0;
|
|
1353
|
+
const maxBudgetUsd = typeof target.max_budget_usd === "number" ? target.max_budget_usd : void 0;
|
|
1224
1354
|
return {
|
|
1225
1355
|
model,
|
|
1226
1356
|
systemPrompt,
|
|
@@ -1251,9 +1381,7 @@ function resolveMockConfig(target) {
|
|
|
1251
1381
|
return { response };
|
|
1252
1382
|
}
|
|
1253
1383
|
function resolveVSCodeConfig(target, env, insiders, evalFilePath) {
|
|
1254
|
-
const workspaceTemplateEnvVar = resolveOptionalLiteralString(
|
|
1255
|
-
target.workspace_template ?? target.workspaceTemplate
|
|
1256
|
-
);
|
|
1384
|
+
const workspaceTemplateEnvVar = resolveOptionalLiteralString(target.workspace_template);
|
|
1257
1385
|
let workspaceTemplate = workspaceTemplateEnvVar ? resolveOptionalString(
|
|
1258
1386
|
workspaceTemplateEnvVar,
|
|
1259
1387
|
env,
|
|
@@ -1268,9 +1396,9 @@ function resolveVSCodeConfig(target, env, insiders, evalFilePath) {
|
|
|
1268
1396
|
}
|
|
1269
1397
|
const executableSource = target.executable;
|
|
1270
1398
|
const waitSource = target.wait;
|
|
1271
|
-
const dryRunSource = target.dry_run
|
|
1272
|
-
const subagentRootSource = target.subagent_root
|
|
1273
|
-
const timeoutSource = target.timeout_seconds
|
|
1399
|
+
const dryRunSource = target.dry_run;
|
|
1400
|
+
const subagentRootSource = target.subagent_root;
|
|
1401
|
+
const timeoutSource = target.timeout_seconds;
|
|
1274
1402
|
const defaultCommand = insiders ? "code-insiders" : "code";
|
|
1275
1403
|
const executable = resolveOptionalString(executableSource, env, `${target.name} vscode executable`, {
|
|
1276
1404
|
allowLiteral: true,
|
|
@@ -1321,7 +1449,7 @@ function resolveCliConfig(target, env, evalFilePath) {
|
|
|
1321
1449
|
}
|
|
1322
1450
|
function resolveDiscoveredProviderConfig(target, providerKind, env, evalFilePath) {
|
|
1323
1451
|
const command = target.command ? resolveString(target.command, env, `${target.name} command`, true) : `bun run .agentv/providers/${providerKind}.ts {PROMPT}`;
|
|
1324
|
-
const timeoutSeconds = target.timeout_seconds
|
|
1452
|
+
const timeoutSeconds = target.timeout_seconds;
|
|
1325
1453
|
const timeoutMs = resolveTimeoutMs(timeoutSeconds, `${target.name} timeout`);
|
|
1326
1454
|
let cwd = resolveOptionalString(target.cwd, env, `${target.name} working directory`, {
|
|
1327
1455
|
allowLiteral: true,
|
|
@@ -1385,10 +1513,10 @@ function resolveDiscover(value, targetName) {
|
|
|
1385
1513
|
throw new Error(`Target "${targetName}": discover must be "latest" (got "${String(value)}")`);
|
|
1386
1514
|
}
|
|
1387
1515
|
function resolveCopilotLogConfig(target, env) {
|
|
1388
|
-
const sessionDirSource = target.session_dir
|
|
1389
|
-
const sessionIdSource = target.session_id
|
|
1516
|
+
const sessionDirSource = target.session_dir;
|
|
1517
|
+
const sessionIdSource = target.session_id;
|
|
1390
1518
|
const discoverSource = target.discover;
|
|
1391
|
-
const sessionStateDirSource = target.session_state_dir
|
|
1519
|
+
const sessionStateDirSource = target.session_state_dir;
|
|
1392
1520
|
const cwdSource = target.cwd;
|
|
1393
1521
|
return {
|
|
1394
1522
|
sessionDir: resolveOptionalString(
|
|
@@ -1563,6 +1691,15 @@ var AGENT_PROVIDER_KINDS = [
|
|
|
1563
1691
|
"vscode",
|
|
1564
1692
|
"vscode-insiders"
|
|
1565
1693
|
];
|
|
1694
|
+
var LLM_GRADER_CAPABLE_KINDS = [
|
|
1695
|
+
"openai",
|
|
1696
|
+
"openrouter",
|
|
1697
|
+
"azure",
|
|
1698
|
+
"anthropic",
|
|
1699
|
+
"gemini",
|
|
1700
|
+
"agentv",
|
|
1701
|
+
"mock"
|
|
1702
|
+
];
|
|
1566
1703
|
var KNOWN_PROVIDERS = [
|
|
1567
1704
|
"openai",
|
|
1568
1705
|
"openrouter",
|
|
@@ -1582,7 +1719,8 @@ var KNOWN_PROVIDERS = [
|
|
|
1582
1719
|
"mock",
|
|
1583
1720
|
"vscode",
|
|
1584
1721
|
"vscode-insiders",
|
|
1585
|
-
"agentv"
|
|
1722
|
+
"agentv",
|
|
1723
|
+
"transcript"
|
|
1586
1724
|
];
|
|
1587
1725
|
var PROVIDER_ALIASES = [
|
|
1588
1726
|
"azure-openai",
|
|
@@ -1787,12 +1925,14 @@ export {
|
|
|
1787
1925
|
buildSearchRoots,
|
|
1788
1926
|
resolveFileReference,
|
|
1789
1927
|
CLI_PLACEHOLDERS,
|
|
1928
|
+
findDeprecatedCamelCaseTargetWarnings,
|
|
1790
1929
|
COMMON_TARGET_SETTINGS,
|
|
1791
1930
|
resolveDelegatedTargetDefinition,
|
|
1792
1931
|
resolveTargetDefinition,
|
|
1932
|
+
LLM_GRADER_CAPABLE_KINDS,
|
|
1793
1933
|
KNOWN_PROVIDERS,
|
|
1794
1934
|
PROVIDER_ALIASES,
|
|
1795
1935
|
extractLastAssistantContent,
|
|
1796
1936
|
isAgentProvider
|
|
1797
1937
|
};
|
|
1798
|
-
//# sourceMappingURL=chunk-
|
|
1938
|
+
//# sourceMappingURL=chunk-VCVVKCC4.js.map
|