@agentv/core 2.0.1 → 2.0.2
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-IBTKEEOT.js → chunk-KDEP4I7G.js} +44 -1
- package/dist/chunk-KDEP4I7G.js.map +1 -0
- package/dist/evaluation/validation/index.cjs +1 -0
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +1 -1
- package/dist/index.cjs +209 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -30
- package/dist/index.d.ts +16 -30
- package/dist/index.js +168 -41
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/dist/chunk-IBTKEEOT.js.map +0 -1
|
@@ -389,6 +389,15 @@ function resolveTargetDefinition(definition, env = process.env, evalFilePath) {
|
|
|
389
389
|
providerBatching,
|
|
390
390
|
config: resolvePiCodingAgentConfig(parsed, env)
|
|
391
391
|
};
|
|
392
|
+
case "pi-agent-sdk":
|
|
393
|
+
return {
|
|
394
|
+
kind: "pi-agent-sdk",
|
|
395
|
+
name: parsed.name,
|
|
396
|
+
judgeTarget: parsed.judge_target,
|
|
397
|
+
workers: parsed.workers,
|
|
398
|
+
providerBatching,
|
|
399
|
+
config: resolvePiAgentSdkConfig(parsed, env)
|
|
400
|
+
};
|
|
392
401
|
case "claude-code":
|
|
393
402
|
return {
|
|
394
403
|
kind: "claude-code",
|
|
@@ -610,6 +619,39 @@ function resolvePiCodingAgentConfig(target, env) {
|
|
|
610
619
|
systemPrompt
|
|
611
620
|
};
|
|
612
621
|
}
|
|
622
|
+
function resolvePiAgentSdkConfig(target, env) {
|
|
623
|
+
const providerSource = target.pi_provider ?? target.piProvider ?? target.llm_provider;
|
|
624
|
+
const modelSource = target.model ?? target.pi_model ?? target.piModel;
|
|
625
|
+
const apiKeySource = target.api_key ?? target.apiKey;
|
|
626
|
+
const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;
|
|
627
|
+
const systemPromptSource = target.system_prompt ?? target.systemPrompt;
|
|
628
|
+
const provider = resolveOptionalString(
|
|
629
|
+
providerSource,
|
|
630
|
+
env,
|
|
631
|
+
`${target.name} pi-agent-sdk provider`,
|
|
632
|
+
{
|
|
633
|
+
allowLiteral: true,
|
|
634
|
+
optionalEnv: true
|
|
635
|
+
}
|
|
636
|
+
);
|
|
637
|
+
const model = resolveOptionalString(modelSource, env, `${target.name} pi-agent-sdk model`, {
|
|
638
|
+
allowLiteral: true,
|
|
639
|
+
optionalEnv: true
|
|
640
|
+
});
|
|
641
|
+
const apiKey = resolveOptionalString(apiKeySource, env, `${target.name} pi-agent-sdk api key`, {
|
|
642
|
+
allowLiteral: false,
|
|
643
|
+
optionalEnv: true
|
|
644
|
+
});
|
|
645
|
+
const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} pi-agent-sdk timeout`);
|
|
646
|
+
const systemPrompt = typeof systemPromptSource === "string" && systemPromptSource.trim().length > 0 ? systemPromptSource.trim() : void 0;
|
|
647
|
+
return {
|
|
648
|
+
provider,
|
|
649
|
+
model,
|
|
650
|
+
apiKey,
|
|
651
|
+
timeoutMs,
|
|
652
|
+
systemPrompt
|
|
653
|
+
};
|
|
654
|
+
}
|
|
613
655
|
function resolveClaudeCodeConfig(target, env) {
|
|
614
656
|
const executableSource = target.executable ?? target.command ?? target.binary;
|
|
615
657
|
const modelSource = target.model;
|
|
@@ -920,6 +962,7 @@ var KNOWN_PROVIDERS = [
|
|
|
920
962
|
"gemini",
|
|
921
963
|
"codex",
|
|
922
964
|
"pi-coding-agent",
|
|
965
|
+
"pi-agent-sdk",
|
|
923
966
|
"claude-code",
|
|
924
967
|
"cli",
|
|
925
968
|
"mock",
|
|
@@ -979,4 +1022,4 @@ export {
|
|
|
979
1022
|
extractLastAssistantContent,
|
|
980
1023
|
isAgentProvider
|
|
981
1024
|
};
|
|
982
|
-
//# sourceMappingURL=chunk-
|
|
1025
|
+
//# sourceMappingURL=chunk-KDEP4I7G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/evaluation/file-utils.ts","../src/evaluation/providers/targets.ts","../src/evaluation/providers/types.ts"],"sourcesContent":["import { constants } from 'node:fs';\nimport { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await access(filePath, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Normalize line endings to LF (\\n).\n * This ensures consistent behavior across Windows (CRLF) and Unix (LF) systems.\n */\nexport function normalizeLineEndings(content: string): string {\n return content.replace(/\\r\\n/g, '\\n');\n}\n\n/**\n * Read a text file and normalize line endings to LF (\\n).\n * This ensures consistent behavior across Windows (CRLF) and Unix (LF) systems.\n */\nexport async function readTextFile(filePath: string): Promise<string> {\n const content = await readFile(filePath, 'utf8');\n return normalizeLineEndings(content);\n}\n\n/**\n * Read a JSON file and parse it.\n */\nexport async function readJsonFile<T = unknown>(filePath: string): Promise<T> {\n const content = await readFile(filePath, 'utf8');\n return JSON.parse(content) as T;\n}\n\n/**\n * Find git repository root by walking up the directory tree.\n */\nexport async function findGitRoot(startPath: string): Promise<string | null> {\n let currentDir = path.dirname(path.resolve(startPath));\n const root = path.parse(currentDir).root;\n\n while (currentDir !== root) {\n const gitPath = path.join(currentDir, '.git');\n if (await fileExists(gitPath)) {\n return currentDir;\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) {\n break;\n }\n currentDir = parentDir;\n }\n\n return null;\n}\n\n/**\n * Build a chain of directories walking from a file's location up to repo root.\n * Used for discovering configuration files like targets.yaml or config.yaml.\n */\nexport function buildDirectoryChain(filePath: string, repoRoot: string): readonly string[] {\n const directories: string[] = [];\n const seen = new Set<string>();\n const boundary = path.resolve(repoRoot);\n let current: string | undefined = path.resolve(path.dirname(filePath));\n\n while (current !== undefined) {\n if (!seen.has(current)) {\n directories.push(current);\n seen.add(current);\n }\n if (current === boundary) {\n break;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n break;\n }\n current = parent;\n }\n\n if (!seen.has(boundary)) {\n directories.push(boundary);\n }\n\n return directories;\n}\n\n/**\n * Build search roots for file resolution, matching yaml-parser behavior.\n * Searches from eval file directory up to repo root.\n */\nexport function buildSearchRoots(evalPath: string, repoRoot: string): readonly string[] {\n const uniqueRoots: string[] = [];\n const addRoot = (root: string): void => {\n const normalized = path.resolve(root);\n if (!uniqueRoots.includes(normalized)) {\n uniqueRoots.push(normalized);\n }\n };\n\n let currentDir = path.dirname(evalPath);\n let reachedBoundary = false;\n while (!reachedBoundary) {\n addRoot(currentDir);\n const parentDir = path.dirname(currentDir);\n if (currentDir === repoRoot || parentDir === currentDir) {\n reachedBoundary = true;\n } else {\n currentDir = parentDir;\n }\n }\n\n addRoot(repoRoot);\n addRoot(process.cwd());\n return uniqueRoots;\n}\n\n/**\n * Trim leading path separators for display.\n */\nfunction trimLeadingSeparators(value: string): string {\n const trimmed = value.replace(/^[/\\\\]+/, '');\n return trimmed.length > 0 ? trimmed : value;\n}\n\n/**\n * Resolve a file reference using search roots, matching yaml-parser behavior.\n */\nexport async function resolveFileReference(\n rawValue: string,\n searchRoots: readonly string[],\n): Promise<{\n readonly displayPath: string;\n readonly resolvedPath?: string;\n readonly attempted: readonly string[];\n}> {\n const displayPath = trimLeadingSeparators(rawValue);\n const potentialPaths: string[] = [];\n\n if (path.isAbsolute(rawValue)) {\n potentialPaths.push(path.normalize(rawValue));\n }\n\n for (const base of searchRoots) {\n potentialPaths.push(path.resolve(base, displayPath));\n }\n\n const attempted: string[] = [];\n const seen = new Set<string>();\n for (const candidate of potentialPaths) {\n const absoluteCandidate = path.resolve(candidate);\n if (seen.has(absoluteCandidate)) {\n continue;\n }\n seen.add(absoluteCandidate);\n attempted.push(absoluteCandidate);\n if (await fileExists(absoluteCandidate)) {\n return { displayPath, resolvedPath: absoluteCandidate, attempted };\n }\n }\n\n return { displayPath, attempted };\n}\n","import path from 'node:path';\nimport { z } from 'zod';\n\nimport type { EnvLookup, TargetDefinition } from './types.js';\n\n// ---------------------------------------------------------------------------\n// Zod Schemas for CLI Provider Configuration\n// ---------------------------------------------------------------------------\n\n/**\n * Loose input schema for HTTP healthcheck configuration.\n * Accepts both snake_case (YAML convention) and camelCase (JavaScript convention)\n * property names for flexibility in configuration files.\n *\n * @example\n * ```yaml\n * healthcheck:\n * type: http\n * url: http://localhost:8080/health\n * timeout_seconds: 30\n * ```\n */\nexport const CliHealthcheckHttpInputSchema = z.object({\n type: z.literal('http'),\n url: z.string().min(1, 'healthcheck URL is required'),\n timeout_seconds: z.number().positive().optional(),\n timeoutSeconds: z.number().positive().optional(),\n});\n\n/**\n * Loose input schema for command healthcheck configuration.\n * Accepts both snake_case (YAML convention) and camelCase (JavaScript convention)\n * property names for flexibility in configuration files.\n *\n * Note: discriminatedUnion requires plain ZodObject, so command_template/commandTemplate\n * presence is validated during normalization rather than here.\n *\n * @example\n * ```yaml\n * healthcheck:\n * type: command\n * command_template: curl http://localhost:8080/health\n * cwd: /app\n * timeout_seconds: 10\n * ```\n */\nexport const CliHealthcheckCommandInputSchema = z.object({\n type: z.literal('command'),\n command_template: z.string().optional(),\n commandTemplate: z.string().optional(),\n cwd: z.string().optional(),\n timeout_seconds: z.number().positive().optional(),\n timeoutSeconds: z.number().positive().optional(),\n});\n\n/**\n * Discriminated union for healthcheck input configuration.\n * Uses the 'type' field to distinguish between HTTP and command healthchecks.\n *\n * @see CliHealthcheckHttpInputSchema for HTTP healthcheck configuration\n * @see CliHealthcheckCommandInputSchema for command healthcheck configuration\n */\nexport const CliHealthcheckInputSchema = z.discriminatedUnion('type', [\n CliHealthcheckHttpInputSchema,\n CliHealthcheckCommandInputSchema,\n]);\n\n/**\n * Loose input schema for CLI target configuration.\n * Accepts both snake_case (YAML convention) and camelCase (JavaScript convention)\n * property names for maximum flexibility in configuration files.\n *\n * This schema validates the raw YAML input structure before normalization\n * and environment variable resolution. Unknown properties are allowed\n * (passthrough mode) to support future extensions.\n *\n * @example\n * ```yaml\n * targets:\n * - name: my-agent\n * provider: cli\n * command_template: agent run {PROMPT}\n * timeout_seconds: 120\n * healthcheck:\n * type: http\n * url: http://localhost:8080/health\n * ```\n */\nexport const CliTargetInputSchema = z\n .object({\n name: z.string().min(1, 'target name is required'),\n provider: z\n .string()\n .refine((p) => p.toLowerCase() === 'cli', { message: \"provider must be 'cli'\" }),\n\n // Command template - required (accept both naming conventions)\n command_template: z.string().optional(),\n commandTemplate: z.string().optional(),\n\n // Files format - optional\n files_format: z.string().optional(),\n filesFormat: z.string().optional(),\n attachments_format: z.string().optional(),\n attachmentsFormat: z.string().optional(),\n\n // Working directory - optional\n cwd: z.string().optional(),\n\n // Timeout in seconds - optional\n timeout_seconds: z.number().positive().optional(),\n timeoutSeconds: z.number().positive().optional(),\n\n // Healthcheck configuration - optional\n healthcheck: CliHealthcheckInputSchema.optional(),\n\n // Verbose mode - optional\n verbose: z.boolean().optional(),\n cli_verbose: z.boolean().optional(),\n cliVerbose: z.boolean().optional(),\n\n // Keep temp files - optional\n keep_temp_files: z.boolean().optional(),\n keepTempFiles: z.boolean().optional(),\n keep_output_files: z.boolean().optional(),\n keepOutputFiles: z.boolean().optional(),\n\n // Common target fields\n judge_target: z.string().optional(),\n workers: z.number().int().min(1).optional(),\n provider_batching: z.boolean().optional(),\n providerBatching: z.boolean().optional(),\n })\n .refine((data) => data.command_template !== undefined || data.commandTemplate !== undefined, {\n message: 'Either command_template or commandTemplate is required',\n });\n\n/**\n * Strict normalized schema for HTTP healthcheck configuration.\n * Uses camelCase property names only and rejects unknown properties.\n * This is an internal schema used as part of CliHealthcheckSchema.\n */\nconst CliHealthcheckHttpSchema = z\n .object({\n type: z.literal('http'),\n url: z.string().min(1),\n timeoutMs: z.number().positive().optional(),\n })\n .strict();\n\n/**\n * Strict normalized schema for command healthcheck configuration.\n * Uses camelCase property names only and rejects unknown properties.\n * This is an internal schema used as part of CliHealthcheckSchema.\n */\nconst CliHealthcheckCommandSchema = z\n .object({\n type: z.literal('command'),\n commandTemplate: z.string().min(1),\n cwd: z.string().optional(),\n timeoutMs: z.number().positive().optional(),\n })\n .strict();\n\n/**\n * Strict normalized schema for healthcheck configuration.\n * Discriminated union on 'type' field supporting HTTP and command healthchecks.\n * Rejects unknown properties to catch typos and misconfigurations.\n *\n * @see CliHealthcheckHttpSchema for HTTP healthcheck fields\n * @see CliHealthcheckCommandSchema for command healthcheck fields\n */\nexport const CliHealthcheckSchema = z.discriminatedUnion('type', [\n CliHealthcheckHttpSchema,\n CliHealthcheckCommandSchema,\n]);\n\n/**\n * Strict normalized schema for CLI target configuration.\n * This is the final validated shape after environment variable resolution\n * and snake_case to camelCase normalization.\n *\n * Uses .strict() to reject unknown properties, ensuring configuration\n * errors are caught early rather than silently ignored.\n *\n * @example\n * ```typescript\n * const config: CliNormalizedConfig = {\n * commandTemplate: 'agent run {PROMPT}',\n * timeoutMs: 120000,\n * verbose: true,\n * };\n * CliTargetConfigSchema.parse(config); // Validates the normalized config\n * ```\n */\nexport const CliTargetConfigSchema = z\n .object({\n commandTemplate: z.string().min(1),\n filesFormat: z.string().optional(),\n cwd: z.string().optional(),\n timeoutMs: z.number().positive().optional(),\n healthcheck: CliHealthcheckSchema.optional(),\n verbose: z.boolean().optional(),\n keepTempFiles: z.boolean().optional(),\n })\n .strict();\n\n// Type inference from schemas\nexport type CliHealthcheckInput = z.infer<typeof CliHealthcheckInputSchema>;\nexport type CliTargetInput = z.infer<typeof CliTargetInputSchema>;\nexport type CliNormalizedHealthcheck = z.infer<typeof CliHealthcheckSchema>;\nexport type CliNormalizedConfig = z.infer<typeof CliTargetConfigSchema>;\n\n/**\n * Resolved CLI configuration type derived from CliTargetConfigSchema.\n * This is the final validated shape used by the CLI provider at runtime.\n * Using Readonly to ensure immutability for runtime safety.\n */\nexport type CliResolvedConfig = Readonly<CliNormalizedConfig>;\n\n/**\n * Normalizes a healthcheck input from loose (snake_case + camelCase) to\n * strict normalized form (camelCase only). Resolves environment variables.\n *\n * @param input - The loose healthcheck input from YAML\n * @param env - Environment variable lookup\n * @param targetName - Name of the target (for error messages)\n * @param evalFilePath - Optional path to eval file for relative path resolution\n * @returns Normalized healthcheck configuration\n */\nexport function normalizeCliHealthcheck(\n input: CliHealthcheckInput,\n env: EnvLookup,\n targetName: string,\n evalFilePath?: string,\n): CliNormalizedHealthcheck {\n const timeoutSeconds = input.timeout_seconds ?? input.timeoutSeconds;\n const timeoutMs = timeoutSeconds !== undefined ? Math.floor(timeoutSeconds * 1000) : undefined;\n\n if (input.type === 'http') {\n const url = resolveString(input.url, env, `${targetName} healthcheck URL`);\n return {\n type: 'http',\n url,\n timeoutMs,\n };\n }\n\n // type === 'command'\n const commandTemplateSource = input.command_template ?? input.commandTemplate;\n if (commandTemplateSource === undefined) {\n throw new Error(\n `${targetName} healthcheck: Either command_template or commandTemplate is required for command healthcheck`,\n );\n }\n const commandTemplate = resolveString(\n commandTemplateSource,\n env,\n `${targetName} healthcheck command template`,\n true,\n );\n\n let cwd = resolveOptionalString(input.cwd, env, `${targetName} healthcheck cwd`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n // Resolve relative cwd paths against eval file directory\n if (cwd && evalFilePath && !path.isAbsolute(cwd)) {\n cwd = path.resolve(path.dirname(path.resolve(evalFilePath)), cwd);\n }\n // Fallback: if cwd is not set and we have an eval file path, use the eval directory\n if (!cwd && evalFilePath) {\n cwd = path.dirname(path.resolve(evalFilePath));\n }\n\n return {\n type: 'command',\n commandTemplate,\n cwd,\n timeoutMs,\n };\n}\n\n/**\n * Normalizes a CLI target input from loose (snake_case + camelCase) to\n * strict normalized form (camelCase only). Resolves environment variables.\n *\n * This function coalesces snake_case/camelCase variants and resolves\n * environment variable references using ${{ VAR_NAME }} syntax.\n *\n * @param input - The loose CLI target input from YAML\n * @param env - Environment variable lookup\n * @param evalFilePath - Optional path to eval file for relative path resolution\n * @returns Normalized CLI configuration matching CliResolvedConfig\n */\nexport function normalizeCliTargetInput(\n input: CliTargetInput,\n env: EnvLookup,\n evalFilePath?: string,\n): CliNormalizedConfig {\n const targetName = input.name;\n\n // Coalesce command template variants - at least one is required by schema refinement\n const commandTemplateSource = input.command_template ?? input.commandTemplate;\n if (commandTemplateSource === undefined) {\n throw new Error(`${targetName}: Either command_template or commandTemplate is required`);\n }\n const commandTemplate = resolveString(\n commandTemplateSource,\n env,\n `${targetName} CLI command template`,\n true,\n );\n\n // Coalesce files format variants\n const filesFormatSource =\n input.files_format ?? input.filesFormat ?? input.attachments_format ?? input.attachmentsFormat;\n const filesFormat = resolveOptionalLiteralString(filesFormatSource);\n\n // Resolve working directory\n let cwd = resolveOptionalString(input.cwd, env, `${targetName} working directory`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n // Resolve relative cwd paths against eval file directory\n if (cwd && evalFilePath && !path.isAbsolute(cwd)) {\n cwd = path.resolve(path.dirname(path.resolve(evalFilePath)), cwd);\n }\n // Fallback: if cwd is not set and we have an eval file path, use the eval directory\n if (!cwd && evalFilePath) {\n cwd = path.dirname(path.resolve(evalFilePath));\n }\n\n // Coalesce timeout variants (seconds -> ms)\n const timeoutSeconds = input.timeout_seconds ?? input.timeoutSeconds;\n const timeoutMs = timeoutSeconds !== undefined ? Math.floor(timeoutSeconds * 1000) : undefined;\n\n // Coalesce verbose variants\n const verbose = resolveOptionalBoolean(input.verbose ?? input.cli_verbose ?? input.cliVerbose);\n\n // Coalesce keepTempFiles variants\n const keepTempFiles = resolveOptionalBoolean(\n input.keep_temp_files ??\n input.keepTempFiles ??\n input.keep_output_files ??\n input.keepOutputFiles,\n );\n\n // Normalize healthcheck if present\n const healthcheck = input.healthcheck\n ? normalizeCliHealthcheck(input.healthcheck, env, targetName, evalFilePath)\n : undefined;\n\n return {\n commandTemplate,\n filesFormat,\n cwd,\n timeoutMs,\n healthcheck,\n verbose,\n keepTempFiles,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Other Provider Configurations and Utilities\n// ---------------------------------------------------------------------------\n\n/**\n * Supported CLI placeholder tokens that can be used in command templates.\n * These are replaced with actual values during command execution.\n */\nexport const CLI_PLACEHOLDERS = new Set([\n 'PROMPT',\n 'GUIDELINES',\n 'EVAL_ID',\n 'ATTEMPT',\n 'FILES',\n 'OUTPUT_FILE',\n]);\n\nexport interface RetryConfig {\n readonly maxRetries?: number;\n readonly initialDelayMs?: number;\n readonly maxDelayMs?: number;\n readonly backoffFactor?: number;\n readonly retryableStatusCodes?: readonly number[];\n}\n\n/**\n * Azure OpenAI settings used by the Vercel AI SDK.\n */\nexport interface AzureResolvedConfig {\n readonly resourceName: string;\n readonly deploymentName: string;\n readonly apiKey: string;\n readonly version?: string;\n readonly temperature?: number;\n readonly maxOutputTokens?: number;\n readonly retry?: RetryConfig;\n}\n\n/**\n * Anthropic Claude settings used by the Vercel AI SDK.\n */\nexport interface AnthropicResolvedConfig {\n readonly apiKey: string;\n readonly model: string;\n readonly temperature?: number;\n readonly maxOutputTokens?: number;\n readonly thinkingBudget?: number;\n readonly retry?: RetryConfig;\n}\n\n/**\n * Google Gemini settings used by the Vercel AI SDK.\n */\nexport interface GeminiResolvedConfig {\n readonly apiKey: string;\n readonly model: string;\n readonly temperature?: number;\n readonly maxOutputTokens?: number;\n readonly retry?: RetryConfig;\n}\n\nexport interface CodexResolvedConfig {\n readonly executable: string;\n readonly args?: readonly string[];\n readonly cwd?: string;\n readonly timeoutMs?: number;\n readonly logDir?: string;\n readonly logFormat?: 'summary' | 'json';\n readonly systemPrompt?: string;\n}\n\nexport interface PiCodingAgentResolvedConfig {\n readonly executable: string;\n readonly provider?: string;\n readonly model?: string;\n readonly apiKey?: string;\n readonly tools?: string;\n readonly thinking?: string;\n readonly args?: readonly string[];\n readonly cwd?: string;\n readonly timeoutMs?: number;\n readonly logDir?: string;\n readonly logFormat?: 'summary' | 'json';\n readonly systemPrompt?: string;\n}\n\nexport interface PiAgentSdkResolvedConfig {\n readonly provider?: string;\n readonly model?: string;\n readonly apiKey?: string;\n readonly timeoutMs?: number;\n readonly systemPrompt?: string;\n}\n\nexport interface ClaudeCodeResolvedConfig {\n readonly executable: string;\n readonly model?: string;\n readonly systemPrompt?: string;\n readonly args?: readonly string[];\n readonly cwd?: string;\n readonly timeoutMs?: number;\n readonly logDir?: string;\n readonly logFormat?: 'summary' | 'json';\n}\n\nexport interface MockResolvedConfig {\n readonly response?: string;\n readonly delayMs?: number;\n readonly delayMinMs?: number;\n readonly delayMaxMs?: number;\n}\n\nexport interface VSCodeResolvedConfig {\n readonly command: string;\n readonly waitForResponse: boolean;\n readonly dryRun: boolean;\n readonly subagentRoot?: string;\n readonly workspaceTemplate?: string;\n}\n\n/**\n * Healthcheck configuration type derived from CliHealthcheckSchema.\n * Supports both HTTP and command-based healthchecks.\n */\nexport type CliHealthcheck = Readonly<CliNormalizedHealthcheck>;\n\n// Note: CliResolvedConfig is a type alias derived from CliNormalizedConfig (see above),\n// which itself is inferred from CliTargetConfigSchema for type safety and single source of truth.\n\nexport type ResolvedTarget =\n | {\n readonly kind: 'azure';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: AzureResolvedConfig;\n }\n | {\n readonly kind: 'anthropic';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: AnthropicResolvedConfig;\n }\n | {\n readonly kind: 'gemini';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: GeminiResolvedConfig;\n }\n | {\n readonly kind: 'codex';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: CodexResolvedConfig;\n }\n | {\n readonly kind: 'pi-coding-agent';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: PiCodingAgentResolvedConfig;\n }\n | {\n readonly kind: 'pi-agent-sdk';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: PiAgentSdkResolvedConfig;\n }\n | {\n readonly kind: 'claude-code';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: ClaudeCodeResolvedConfig;\n }\n | {\n readonly kind: 'mock';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: MockResolvedConfig;\n }\n | {\n readonly kind: 'vscode' | 'vscode-insiders';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: VSCodeResolvedConfig;\n }\n | {\n readonly kind: 'cli';\n readonly name: string;\n readonly judgeTarget?: string;\n readonly workers?: number;\n readonly providerBatching?: boolean;\n readonly config: CliResolvedConfig;\n };\n\nconst BASE_TARGET_SCHEMA = z\n .object({\n name: z.string().min(1, 'target name is required'),\n provider: z.string().min(1, 'provider is required'),\n judge_target: z.string().optional(),\n workers: z.number().int().min(1).optional(),\n })\n .passthrough();\n\nconst DEFAULT_AZURE_API_VERSION = '2024-12-01-preview';\n\nfunction normalizeAzureApiVersion(value: string | undefined): string {\n if (!value) {\n return DEFAULT_AZURE_API_VERSION;\n }\n\n const trimmed = value.trim();\n if (trimmed.length === 0) {\n return DEFAULT_AZURE_API_VERSION;\n }\n\n const withoutPrefix = trimmed.replace(/^api[-_]?version\\s*=\\s*/i, '').trim();\n return withoutPrefix.length > 0 ? withoutPrefix : DEFAULT_AZURE_API_VERSION;\n}\n\nfunction resolveRetryConfig(target: z.infer<typeof BASE_TARGET_SCHEMA>): RetryConfig | undefined {\n const maxRetries = resolveOptionalNumber(\n target.max_retries ?? target.maxRetries,\n `${target.name} max retries`,\n );\n const initialDelayMs = resolveOptionalNumber(\n target.retry_initial_delay_ms ?? target.retryInitialDelayMs,\n `${target.name} retry initial delay`,\n );\n const maxDelayMs = resolveOptionalNumber(\n target.retry_max_delay_ms ?? target.retryMaxDelayMs,\n `${target.name} retry max delay`,\n );\n const backoffFactor = resolveOptionalNumber(\n target.retry_backoff_factor ?? target.retryBackoffFactor,\n `${target.name} retry backoff factor`,\n );\n const retryableStatusCodes = resolveOptionalNumberArray(\n target.retry_status_codes ?? target.retryStatusCodes,\n `${target.name} retry status codes`,\n );\n\n // Only return retry config if at least one field is set\n if (\n maxRetries === undefined &&\n initialDelayMs === undefined &&\n maxDelayMs === undefined &&\n backoffFactor === undefined &&\n retryableStatusCodes === undefined\n ) {\n return undefined;\n }\n\n return {\n maxRetries,\n initialDelayMs,\n maxDelayMs,\n backoffFactor,\n retryableStatusCodes,\n };\n}\n\nexport function resolveTargetDefinition(\n definition: TargetDefinition,\n env: EnvLookup = process.env,\n evalFilePath?: string,\n): ResolvedTarget {\n const parsed = BASE_TARGET_SCHEMA.parse(definition);\n const provider = parsed.provider.toLowerCase();\n const providerBatching = resolveOptionalBoolean(\n parsed.provider_batching ?? parsed.providerBatching,\n );\n\n switch (provider) {\n case 'azure':\n case 'azure-openai':\n return {\n kind: 'azure',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveAzureConfig(parsed, env),\n };\n case 'anthropic':\n return {\n kind: 'anthropic',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveAnthropicConfig(parsed, env),\n };\n case 'gemini':\n case 'google':\n case 'google-gemini':\n return {\n kind: 'gemini',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveGeminiConfig(parsed, env),\n };\n case 'codex':\n case 'codex-cli':\n return {\n kind: 'codex',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveCodexConfig(parsed, env),\n };\n case 'pi':\n case 'pi-coding-agent':\n return {\n kind: 'pi-coding-agent',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolvePiCodingAgentConfig(parsed, env),\n };\n case 'pi-agent-sdk':\n return {\n kind: 'pi-agent-sdk',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolvePiAgentSdkConfig(parsed, env),\n };\n case 'claude-code':\n return {\n kind: 'claude-code',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveClaudeCodeConfig(parsed, env),\n };\n case 'mock':\n return {\n kind: 'mock',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveMockConfig(parsed),\n };\n case 'vscode':\n case 'vscode-insiders':\n return {\n kind: provider as 'vscode' | 'vscode-insiders',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveVSCodeConfig(parsed, env, provider === 'vscode-insiders'),\n };\n case 'cli':\n return {\n kind: 'cli',\n name: parsed.name,\n judgeTarget: parsed.judge_target,\n workers: parsed.workers,\n providerBatching,\n config: resolveCliConfig(parsed, env, evalFilePath),\n };\n default:\n throw new Error(`Unsupported provider '${parsed.provider}' in target '${parsed.name}'`);\n }\n}\n\nfunction resolveAzureConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): AzureResolvedConfig {\n const endpointSource = target.endpoint ?? target.resource ?? target.resourceName;\n const apiKeySource = target.api_key ?? target.apiKey;\n const deploymentSource = target.deployment ?? target.deploymentName ?? target.model;\n const versionSource = target.version ?? target.api_version;\n const temperatureSource = target.temperature;\n const maxTokensSource = target.max_output_tokens ?? target.maxTokens;\n\n const resourceName = resolveString(endpointSource, env, `${target.name} endpoint`);\n const apiKey = resolveString(apiKeySource, env, `${target.name} api key`);\n const deploymentName = resolveString(deploymentSource, env, `${target.name} deployment`);\n const version = normalizeAzureApiVersion(\n resolveOptionalString(versionSource, env, `${target.name} api version`, {\n allowLiteral: true,\n optionalEnv: true,\n }),\n );\n const temperature = resolveOptionalNumber(temperatureSource, `${target.name} temperature`);\n const maxOutputTokens = resolveOptionalNumber(\n maxTokensSource,\n `${target.name} max output tokens`,\n );\n const retry = resolveRetryConfig(target);\n\n return {\n resourceName,\n deploymentName,\n apiKey,\n version,\n temperature,\n maxOutputTokens,\n retry,\n };\n}\n\nfunction resolveAnthropicConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): AnthropicResolvedConfig {\n const apiKeySource = target.api_key ?? target.apiKey;\n const modelSource = target.model ?? target.deployment ?? target.variant;\n const temperatureSource = target.temperature;\n const maxTokensSource = target.max_output_tokens ?? target.maxTokens;\n const thinkingBudgetSource = target.thinking_budget ?? target.thinkingBudget;\n\n const apiKey = resolveString(apiKeySource, env, `${target.name} Anthropic api key`);\n const model = resolveString(modelSource, env, `${target.name} Anthropic model`);\n const retry = resolveRetryConfig(target);\n\n return {\n apiKey,\n model,\n temperature: resolveOptionalNumber(temperatureSource, `${target.name} temperature`),\n maxOutputTokens: resolveOptionalNumber(maxTokensSource, `${target.name} max output tokens`),\n thinkingBudget: resolveOptionalNumber(thinkingBudgetSource, `${target.name} thinking budget`),\n retry,\n };\n}\n\nfunction resolveGeminiConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): GeminiResolvedConfig {\n const apiKeySource = target.api_key ?? target.apiKey;\n const modelSource = target.model ?? target.deployment ?? target.variant;\n const temperatureSource = target.temperature;\n const maxTokensSource = target.max_output_tokens ?? target.maxTokens;\n\n const apiKey = resolveString(apiKeySource, env, `${target.name} Google API key`);\n const model =\n resolveOptionalString(modelSource, env, `${target.name} Gemini model`, {\n allowLiteral: true,\n optionalEnv: true,\n }) ?? 'gemini-2.5-flash';\n const retry = resolveRetryConfig(target);\n\n return {\n apiKey,\n model,\n temperature: resolveOptionalNumber(temperatureSource, `${target.name} temperature`),\n maxOutputTokens: resolveOptionalNumber(maxTokensSource, `${target.name} max output tokens`),\n retry,\n };\n}\n\nfunction resolveCodexConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): CodexResolvedConfig {\n const executableSource = target.executable ?? target.command ?? target.binary;\n const argsSource = target.args ?? target.arguments;\n const cwdSource = target.cwd;\n const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;\n const logDirSource =\n target.log_dir ?? target.logDir ?? target.log_directory ?? target.logDirectory;\n const logFormatSource =\n target.log_format ??\n target.logFormat ??\n target.log_output_format ??\n target.logOutputFormat ??\n env.AGENTV_CODEX_LOG_FORMAT;\n const systemPromptSource = target.system_prompt ?? target.systemPrompt;\n\n const executable =\n resolveOptionalString(executableSource, env, `${target.name} codex executable`, {\n allowLiteral: true,\n optionalEnv: true,\n }) ?? 'codex';\n\n const args = resolveOptionalStringArray(argsSource, env, `${target.name} codex args`);\n\n const cwd = resolveOptionalString(cwdSource, env, `${target.name} codex cwd`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} codex timeout`);\n const logDir = resolveOptionalString(logDirSource, env, `${target.name} codex log directory`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n const logFormat = normalizeCodexLogFormat(logFormatSource);\n\n const systemPrompt =\n typeof systemPromptSource === 'string' && systemPromptSource.trim().length > 0\n ? systemPromptSource.trim()\n : undefined;\n\n return {\n executable,\n args,\n cwd,\n timeoutMs,\n logDir,\n logFormat,\n systemPrompt,\n };\n}\n\nfunction normalizeCodexLogFormat(value: unknown): 'summary' | 'json' | undefined {\n if (value === undefined || value === null) {\n return undefined;\n }\n if (typeof value !== 'string') {\n throw new Error(\"codex log format must be 'summary' or 'json'\");\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === 'json' || normalized === 'summary') {\n return normalized;\n }\n throw new Error(\"codex log format must be 'summary' or 'json'\");\n}\n\nfunction resolvePiCodingAgentConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): PiCodingAgentResolvedConfig {\n const executableSource = target.executable ?? target.command ?? target.binary;\n const providerSource = target.pi_provider ?? target.piProvider ?? target.llm_provider;\n const modelSource = target.model ?? target.pi_model ?? target.piModel;\n const apiKeySource = target.api_key ?? target.apiKey;\n const toolsSource = target.tools ?? target.pi_tools ?? target.piTools;\n const thinkingSource = target.thinking ?? target.pi_thinking ?? target.piThinking;\n const argsSource = target.args ?? target.arguments;\n const cwdSource = target.cwd;\n const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;\n const logDirSource =\n target.log_dir ?? target.logDir ?? target.log_directory ?? target.logDirectory;\n const logFormatSource = target.log_format ?? target.logFormat;\n const systemPromptSource = target.system_prompt ?? target.systemPrompt;\n\n const executable =\n resolveOptionalString(executableSource, env, `${target.name} pi executable`, {\n allowLiteral: true,\n optionalEnv: true,\n }) ?? 'pi';\n\n const provider = resolveOptionalString(providerSource, env, `${target.name} pi provider`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const model = resolveOptionalString(modelSource, env, `${target.name} pi model`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const apiKey = resolveOptionalString(apiKeySource, env, `${target.name} pi api key`, {\n allowLiteral: false,\n optionalEnv: true,\n });\n\n const tools = resolveOptionalString(toolsSource, env, `${target.name} pi tools`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const thinking = resolveOptionalString(thinkingSource, env, `${target.name} pi thinking`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const args = resolveOptionalStringArray(argsSource, env, `${target.name} pi args`);\n\n const cwd = resolveOptionalString(cwdSource, env, `${target.name} pi cwd`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} pi timeout`);\n\n const logDir = resolveOptionalString(logDirSource, env, `${target.name} pi log directory`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const logFormat =\n logFormatSource === 'json' || logFormatSource === 'summary' ? logFormatSource : undefined;\n\n const systemPrompt =\n typeof systemPromptSource === 'string' && systemPromptSource.trim().length > 0\n ? systemPromptSource.trim()\n : undefined;\n\n return {\n executable,\n provider,\n model,\n apiKey,\n tools,\n thinking,\n args,\n cwd,\n timeoutMs,\n logDir,\n logFormat,\n systemPrompt,\n };\n}\n\nfunction resolvePiAgentSdkConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): PiAgentSdkResolvedConfig {\n const providerSource = target.pi_provider ?? target.piProvider ?? target.llm_provider;\n const modelSource = target.model ?? target.pi_model ?? target.piModel;\n const apiKeySource = target.api_key ?? target.apiKey;\n const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;\n const systemPromptSource = target.system_prompt ?? target.systemPrompt;\n\n const provider = resolveOptionalString(\n providerSource,\n env,\n `${target.name} pi-agent-sdk provider`,\n {\n allowLiteral: true,\n optionalEnv: true,\n },\n );\n\n const model = resolveOptionalString(modelSource, env, `${target.name} pi-agent-sdk model`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const apiKey = resolveOptionalString(apiKeySource, env, `${target.name} pi-agent-sdk api key`, {\n allowLiteral: false,\n optionalEnv: true,\n });\n\n const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} pi-agent-sdk timeout`);\n\n const systemPrompt =\n typeof systemPromptSource === 'string' && systemPromptSource.trim().length > 0\n ? systemPromptSource.trim()\n : undefined;\n\n return {\n provider,\n model,\n apiKey,\n timeoutMs,\n systemPrompt,\n };\n}\n\nfunction resolveClaudeCodeConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n): ClaudeCodeResolvedConfig {\n const executableSource = target.executable ?? target.command ?? target.binary;\n const modelSource = target.model;\n const argsSource = target.args ?? target.arguments;\n const cwdSource = target.cwd;\n const timeoutSource = target.timeout_seconds ?? target.timeoutSeconds;\n const logDirSource =\n target.log_dir ?? target.logDir ?? target.log_directory ?? target.logDirectory;\n const logFormatSource =\n target.log_format ??\n target.logFormat ??\n target.log_output_format ??\n target.logOutputFormat ??\n env.AGENTV_CLAUDE_CODE_LOG_FORMAT;\n const systemPromptSource = target.system_prompt ?? target.systemPrompt;\n\n const executable =\n resolveOptionalString(executableSource, env, `${target.name} claude-code executable`, {\n allowLiteral: true,\n optionalEnv: true,\n }) ?? 'claude';\n\n const model = resolveOptionalString(modelSource, env, `${target.name} claude-code model`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const args = resolveOptionalStringArray(argsSource, env, `${target.name} claude-code args`);\n\n const cwd = resolveOptionalString(cwdSource, env, `${target.name} claude-code cwd`, {\n allowLiteral: true,\n optionalEnv: true,\n });\n\n const timeoutMs = resolveTimeoutMs(timeoutSource, `${target.name} claude-code timeout`);\n\n const logDir = resolveOptionalString(\n logDirSource,\n env,\n `${target.name} claude-code log directory`,\n {\n allowLiteral: true,\n optionalEnv: true,\n },\n );\n\n const logFormat = normalizeClaudeCodeLogFormat(logFormatSource);\n\n const systemPrompt =\n typeof systemPromptSource === 'string' && systemPromptSource.trim().length > 0\n ? systemPromptSource.trim()\n : undefined;\n\n return {\n executable,\n model,\n systemPrompt,\n args,\n cwd,\n timeoutMs,\n logDir,\n logFormat,\n };\n}\n\nfunction normalizeClaudeCodeLogFormat(value: unknown): 'summary' | 'json' | undefined {\n if (value === undefined || value === null) {\n return undefined;\n }\n if (typeof value !== 'string') {\n throw new Error(\"claude-code log format must be 'summary' or 'json'\");\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === 'json' || normalized === 'summary') {\n return normalized;\n }\n throw new Error(\"claude-code log format must be 'summary' or 'json'\");\n}\n\nfunction resolveMockConfig(target: z.infer<typeof BASE_TARGET_SCHEMA>): MockResolvedConfig {\n const response = typeof target.response === 'string' ? target.response : undefined;\n return { response };\n}\n\nfunction resolveVSCodeConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n insiders: boolean,\n): VSCodeResolvedConfig {\n const workspaceTemplateEnvVar = resolveOptionalLiteralString(\n target.workspace_template ?? target.workspaceTemplate,\n );\n const workspaceTemplate = workspaceTemplateEnvVar\n ? resolveOptionalString(\n workspaceTemplateEnvVar,\n env,\n `${target.name} workspace template path`,\n {\n allowLiteral: false,\n optionalEnv: true,\n },\n )\n : undefined;\n\n const commandSource = target.vscode_cmd ?? target.command;\n const waitSource = target.wait;\n const dryRunSource = target.dry_run ?? target.dryRun;\n const subagentRootSource = target.subagent_root ?? target.subagentRoot;\n\n const defaultCommand = insiders ? 'code-insiders' : 'code';\n const command = resolveOptionalLiteralString(commandSource) ?? defaultCommand;\n\n return {\n command,\n waitForResponse: resolveOptionalBoolean(waitSource) ?? true,\n dryRun: resolveOptionalBoolean(dryRunSource) ?? false,\n subagentRoot: resolveOptionalString(subagentRootSource, env, `${target.name} subagent root`, {\n allowLiteral: true,\n optionalEnv: true,\n }),\n workspaceTemplate,\n };\n}\n\n/**\n * Custom Zod error map for CLI provider validation.\n * Provides clear, user-friendly error messages for common validation failures.\n */\nconst cliErrorMap: z.ZodErrorMap = (issue, ctx) => {\n if (issue.code === z.ZodIssueCode.unrecognized_keys) {\n return { message: `Unknown CLI provider settings: ${issue.keys.join(', ')}` };\n }\n if (issue.code === z.ZodIssueCode.invalid_union_discriminator) {\n return { message: \"healthcheck type must be 'http' or 'command'\" };\n }\n if (issue.code === z.ZodIssueCode.invalid_type && issue.expected === 'string') {\n return { message: `${ctx.defaultError} (expected a string value)` };\n }\n return { message: ctx.defaultError };\n};\n\n/**\n * Resolves a CLI target configuration using Zod schema validation and normalization.\n *\n * This function:\n * 1. Parses the raw target with CliTargetInputSchema for structural validation\n * 2. Normalizes the input using normalizeCliTargetInput() for env var resolution and casing\n * 3. Validates CLI placeholders in the command template\n *\n * @param target - The raw target definition from YAML\n * @param env - Environment variable lookup for ${{ VAR }} resolution\n * @param evalFilePath - Optional path to eval file for relative path resolution\n * @returns Normalized CLI configuration matching CliResolvedConfig\n */\nfunction resolveCliConfig(\n target: z.infer<typeof BASE_TARGET_SCHEMA>,\n env: EnvLookup,\n evalFilePath?: string,\n): CliResolvedConfig {\n // Parse with Zod schema for structural validation with custom error messages\n const parseResult = CliTargetInputSchema.safeParse(target, { errorMap: cliErrorMap });\n if (!parseResult.success) {\n const firstError = parseResult.error.errors[0];\n const path = firstError?.path.join('.') || '';\n const prefix = path ? `${target.name} ${path}: ` : `${target.name}: `;\n throw new Error(`${prefix}${firstError?.message}`);\n }\n\n // Normalize the parsed input (handles env var resolution, casing, path resolution)\n const normalized = normalizeCliTargetInput(parseResult.data, env, evalFilePath);\n\n // Validate CLI placeholders in command template\n assertSupportedCliPlaceholders(normalized.commandTemplate, `${target.name} CLI command template`);\n\n // Validate CLI placeholders in healthcheck command template if present\n if (normalized.healthcheck?.type === 'command') {\n assertSupportedCliPlaceholders(\n normalized.healthcheck.commandTemplate,\n `${target.name} healthcheck command template`,\n );\n }\n\n return normalized;\n}\n\nfunction resolveTimeoutMs(source: unknown, description: string): number | undefined {\n const seconds = resolveOptionalNumber(source, `${description} (seconds)`);\n if (seconds === undefined) {\n return undefined;\n }\n if (seconds <= 0) {\n throw new Error(`${description} must be greater than zero seconds`);\n }\n return Math.floor(seconds * 1000);\n}\n\nfunction assertSupportedCliPlaceholders(template: string, description: string): void {\n const placeholders = extractCliPlaceholders(template);\n for (const placeholder of placeholders) {\n if (!CLI_PLACEHOLDERS.has(placeholder)) {\n throw new Error(\n `${description} includes unsupported placeholder '{${placeholder}}'. Supported placeholders: ${Array.from(CLI_PLACEHOLDERS).join(', ')}`,\n );\n }\n }\n}\n\nfunction extractCliPlaceholders(template: string): string[] {\n const matches = template.matchAll(/\\{([A-Z_]+)\\}/g);\n const results: string[] = [];\n for (const match of matches) {\n if (match[1]) {\n results.push(match[1]);\n }\n }\n return results;\n}\n\nfunction resolveString(\n source: unknown,\n env: EnvLookup,\n description: string,\n allowLiteral = false,\n): string {\n const value = resolveOptionalString(source, env, description, {\n allowLiteral,\n optionalEnv: false,\n });\n if (value === undefined) {\n throw new Error(`${description} is required`);\n }\n return value;\n}\n\nfunction resolveOptionalString(\n source: unknown,\n env: EnvLookup,\n description: string,\n options?: { allowLiteral?: boolean; optionalEnv?: boolean },\n): string | undefined {\n if (source === undefined || source === null) {\n return undefined;\n }\n if (typeof source !== 'string') {\n throw new Error(`${description} must be a string`);\n }\n const trimmed = source.trim();\n if (trimmed.length === 0) {\n return undefined;\n }\n\n // Check for ${{ variable }} syntax\n const envVarMatch = trimmed.match(/^\\$\\{\\{\\s*([A-Z0-9_]+)\\s*\\}\\}$/i);\n if (envVarMatch) {\n const varName = envVarMatch[1];\n const envValue = env[varName];\n const optionalEnv = options?.optionalEnv ?? false;\n\n // Treat empty or undefined env vars the same way\n if (envValue === undefined || envValue.trim().length === 0) {\n if (optionalEnv) {\n return undefined;\n }\n const status = envValue === undefined ? 'is not set' : 'is empty';\n throw new Error(`Environment variable '${varName}' required for ${description} ${status}`);\n }\n return envValue;\n }\n\n // Return as literal value\n const allowLiteral = options?.allowLiteral ?? false;\n if (!allowLiteral) {\n throw new Error(\n `${description} must use \\${{ VARIABLE_NAME }} syntax for environment variables or be marked as allowing literals`,\n );\n }\n return trimmed;\n}\n\nfunction resolveOptionalLiteralString(source: unknown): string | undefined {\n if (source === undefined || source === null) {\n return undefined;\n }\n if (typeof source !== 'string') {\n throw new Error('expected string value');\n }\n const trimmed = source.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction resolveOptionalNumber(source: unknown, description: string): number | undefined {\n if (source === undefined || source === null || source === '') {\n return undefined;\n }\n if (typeof source === 'number') {\n return Number.isFinite(source) ? source : undefined;\n }\n if (typeof source === 'string') {\n const numeric = Number(source);\n if (Number.isFinite(numeric)) {\n return numeric;\n }\n }\n throw new Error(`${description} must be a number`);\n}\n\nfunction resolveOptionalBoolean(source: unknown): boolean | undefined {\n if (source === undefined || source === null || source === '') {\n return undefined;\n }\n if (typeof source === 'boolean') {\n return source;\n }\n if (typeof source === 'string') {\n const lowered = source.trim().toLowerCase();\n if (lowered === 'true' || lowered === '1') {\n return true;\n }\n if (lowered === 'false' || lowered === '0') {\n return false;\n }\n }\n throw new Error('expected boolean value');\n}\n\nfunction resolveOptionalStringArray(\n source: unknown,\n env: EnvLookup,\n description: string,\n): readonly string[] | undefined {\n if (source === undefined || source === null) {\n return undefined;\n }\n if (!Array.isArray(source)) {\n throw new Error(`${description} must be an array of strings`);\n }\n if (source.length === 0) {\n return undefined;\n }\n const resolved: string[] = [];\n for (let i = 0; i < source.length; i++) {\n const item = source[i];\n if (typeof item !== 'string') {\n throw new Error(`${description}[${i}] must be a string`);\n }\n const trimmed = item.trim();\n if (trimmed.length === 0) {\n throw new Error(`${description}[${i}] cannot be empty`);\n }\n\n // Check for ${{ variable }} syntax\n const envVarMatch = trimmed.match(/^\\$\\{\\{\\s*([A-Z0-9_]+)\\s*\\}\\}$/i);\n if (envVarMatch) {\n const varName = envVarMatch[1];\n const envValue = env[varName];\n if (envValue !== undefined) {\n if (envValue.trim().length === 0) {\n throw new Error(`Environment variable '${varName}' for ${description}[${i}] is empty`);\n }\n resolved.push(envValue);\n continue;\n }\n throw new Error(`Environment variable '${varName}' for ${description}[${i}] is not set`);\n }\n\n // Treat as literal value\n resolved.push(trimmed);\n }\n return resolved.length > 0 ? resolved : undefined;\n}\n\nfunction resolveOptionalNumberArray(\n source: unknown,\n description: string,\n): readonly number[] | undefined {\n if (source === undefined || source === null) {\n return undefined;\n }\n if (!Array.isArray(source)) {\n throw new Error(`${description} must be an array of numbers`);\n }\n if (source.length === 0) {\n return undefined;\n }\n const resolved: number[] = [];\n for (let i = 0; i < source.length; i++) {\n const item = source[i];\n if (typeof item !== 'number' || !Number.isFinite(item)) {\n throw new Error(`${description}[${i}] must be a number`);\n }\n resolved.push(item);\n }\n return resolved.length > 0 ? resolved : undefined;\n}\n","import type { JsonObject } from '../types.js';\n\nexport type ChatMessageRole = 'system' | 'user' | 'assistant' | 'tool' | 'function';\n\nexport interface ChatMessage {\n readonly role: ChatMessageRole;\n readonly content: string;\n readonly name?: string;\n}\n\nexport type ChatPrompt = readonly ChatMessage[];\n\nexport type ProviderKind =\n | 'azure'\n | 'anthropic'\n | 'gemini'\n | 'codex'\n | 'pi-coding-agent'\n | 'pi-agent-sdk'\n | 'claude-code'\n | 'cli'\n | 'mock'\n | 'vscode'\n | 'vscode-insiders';\n\n/**\n * Agent providers that have filesystem access and don't need unwrapped guidelines.\n * These providers read files directly from the filesystem using file:// URIs.\n */\nexport const AGENT_PROVIDER_KINDS: readonly ProviderKind[] = [\n 'codex',\n 'pi-coding-agent',\n 'claude-code',\n 'vscode',\n 'vscode-insiders',\n] as const;\n\n/**\n * List of all supported provider kinds.\n * This is the source of truth for provider validation.\n */\nexport const KNOWN_PROVIDERS: readonly ProviderKind[] = [\n 'azure',\n 'anthropic',\n 'gemini',\n 'codex',\n 'pi-coding-agent',\n 'pi-agent-sdk',\n 'claude-code',\n 'cli',\n 'mock',\n 'vscode',\n 'vscode-insiders',\n] as const;\n\n/**\n * Provider aliases that are accepted in target definitions.\n * These map to the canonical ProviderKind values.\n */\nexport const PROVIDER_ALIASES: readonly string[] = [\n 'azure-openai', // alias for \"azure\"\n 'google', // alias for \"gemini\"\n 'google-gemini', // alias for \"gemini\"\n 'codex-cli', // alias for \"codex\"\n 'pi', // alias for \"pi-coding-agent\"\n 'openai', // legacy/future support\n 'bedrock', // legacy/future support\n 'vertex', // legacy/future support\n] as const;\n\n/**\n * Schema identifier for targets.yaml files (version 2).\n */\nexport const TARGETS_SCHEMA_V2 = 'agentv-targets-v2.2';\n\nexport interface ProviderRequest {\n readonly question: string;\n readonly systemPrompt?: string;\n readonly guidelines?: string;\n readonly guideline_patterns?: readonly string[];\n readonly chatPrompt?: ChatPrompt;\n readonly inputFiles?: readonly string[];\n readonly evalCaseId?: string;\n readonly attempt?: number;\n readonly maxOutputTokens?: number;\n readonly temperature?: number;\n readonly metadata?: JsonObject;\n readonly signal?: AbortSignal;\n}\n\n/**\n * A tool call within an output message.\n * Represents a single tool invocation with its input and optional output.\n */\nexport interface ToolCall {\n /** Tool name */\n readonly tool: string;\n /** Tool input arguments */\n readonly input?: unknown;\n /** Tool output result */\n readonly output?: unknown;\n /** Stable identifier for pairing tool calls */\n readonly id?: string;\n /** ISO 8601 timestamp */\n readonly timestamp?: string;\n}\n\n/**\n * An output message from agent execution.\n * Represents a single message in the conversation with optional tool calls.\n */\nexport interface OutputMessage {\n /** Message role (e.g., 'assistant', 'user', 'tool') */\n readonly role: string;\n /** Optional name for the message sender */\n readonly name?: string;\n /** Message content */\n readonly content?: unknown;\n /** Tool calls made in this message */\n readonly toolCalls?: readonly ToolCall[];\n /** ISO 8601 timestamp */\n readonly timestamp?: string;\n /** Provider-specific metadata */\n readonly metadata?: Record<string, unknown>;\n}\n\n/**\n * Token usage metrics reported by provider.\n */\nexport interface ProviderTokenUsage {\n /** Input/prompt tokens consumed */\n readonly input: number;\n /** Output/completion tokens generated */\n readonly output: number;\n /** Cached tokens (optional, provider-specific) */\n readonly cached?: number;\n}\n\nexport interface ProviderResponse {\n readonly raw?: unknown;\n readonly usage?: JsonObject;\n /** Output messages from agent execution (primary source for tool trajectory) */\n readonly outputMessages?: readonly OutputMessage[];\n /** Token usage metrics (optional) */\n readonly tokenUsage?: ProviderTokenUsage;\n /** Total cost in USD (optional) */\n readonly costUsd?: number;\n /** Execution duration in milliseconds (optional) */\n readonly durationMs?: number;\n}\n\n/**\n * Extract the content from the last assistant message in an output message array.\n * Returns empty string if no assistant message found.\n */\nexport function extractLastAssistantContent(\n messages: readonly OutputMessage[] | undefined,\n): string {\n if (!messages || messages.length === 0) {\n return '';\n }\n\n // Find the last assistant message (reverse search)\n for (let i = messages.length - 1; i >= 0; i--) {\n const msg = messages[i];\n if (msg.role === 'assistant' && msg.content !== undefined) {\n if (typeof msg.content === 'string') {\n return msg.content;\n }\n return JSON.stringify(msg.content);\n }\n }\n\n return '';\n}\n\n/**\n * Type guard to check if a provider is an agent provider with filesystem access.\n * Agent providers read files directly and don't need unwrapped guideline content.\n */\nexport function isAgentProvider(provider: Provider | undefined): boolean {\n return provider ? AGENT_PROVIDER_KINDS.includes(provider.kind) : false;\n}\n\nexport interface Provider {\n readonly id: string;\n readonly kind: ProviderKind;\n readonly targetName: string;\n invoke(request: ProviderRequest): Promise<ProviderResponse>;\n /**\n * Optional capability marker for provider-managed batching (single session handling multiple requests).\n */\n readonly supportsBatch?: boolean;\n /**\n * Optional batch invocation hook. When defined alongside supportsBatch=true,\n * the orchestrator may send multiple requests in a single provider session.\n */\n invokeBatch?(requests: readonly ProviderRequest[]): Promise<readonly ProviderResponse[]>;\n /**\n * Optional method to get a Vercel AI SDK LanguageModel instance for structured output generation.\n * Used by evaluators that need generateObject/generateText from the AI SDK.\n */\n asLanguageModel?(): import('ai').LanguageModel;\n}\n\nexport type EnvLookup = Readonly<Record<string, string | undefined>>;\n\nexport interface TargetDefinition {\n readonly name: string;\n readonly provider: ProviderKind | string;\n readonly judge_target?: string | undefined;\n readonly workers?: number | undefined;\n // Provider batching\n readonly provider_batching?: boolean | undefined;\n readonly providerBatching?: boolean | undefined;\n // Azure fields\n readonly endpoint?: string | unknown | undefined;\n readonly resource?: string | unknown | undefined;\n readonly resourceName?: string | unknown | undefined;\n readonly api_key?: string | unknown | undefined;\n readonly apiKey?: string | unknown | undefined;\n readonly deployment?: string | unknown | undefined;\n readonly deploymentName?: string | unknown | undefined;\n readonly model?: string | unknown | undefined;\n readonly version?: string | unknown | undefined;\n readonly api_version?: string | unknown | undefined;\n // Anthropic fields\n readonly variant?: string | unknown | undefined;\n readonly thinking_budget?: number | unknown | undefined;\n readonly thinkingBudget?: number | unknown | undefined;\n // Common fields\n readonly temperature?: number | unknown | undefined;\n readonly max_output_tokens?: number | unknown | undefined;\n readonly maxTokens?: number | unknown | undefined;\n // Codex fields\n readonly executable?: string | unknown | undefined;\n readonly command?: string | unknown | undefined;\n readonly binary?: string | unknown | undefined;\n readonly args?: unknown | undefined;\n readonly arguments?: unknown | undefined;\n readonly cwd?: string | unknown | undefined;\n readonly timeout_seconds?: number | unknown | undefined;\n readonly timeoutSeconds?: number | unknown | undefined;\n readonly log_dir?: string | unknown | undefined;\n readonly logDir?: string | unknown | undefined;\n readonly log_directory?: string | unknown | undefined;\n readonly logDirectory?: string | unknown | undefined;\n readonly log_format?: string | unknown | undefined;\n readonly logFormat?: string | unknown | undefined;\n readonly log_output_format?: string | unknown | undefined;\n readonly logOutputFormat?: string | unknown | undefined;\n // Mock fields\n readonly response?: string | unknown | undefined;\n readonly delayMs?: number | unknown | undefined;\n readonly delayMinMs?: number | unknown | undefined;\n readonly delayMaxMs?: number | unknown | undefined;\n // VSCode fields\n readonly vscode_cmd?: string | unknown | undefined;\n readonly wait?: boolean | unknown | undefined;\n readonly dry_run?: boolean | unknown | undefined;\n readonly dryRun?: boolean | unknown | undefined;\n readonly subagent_root?: string | unknown | undefined;\n readonly subagentRoot?: string | unknown | undefined;\n readonly workspace_template?: string | unknown | undefined;\n readonly workspaceTemplate?: string | unknown | undefined;\n // CLI fields\n readonly command_template?: string | unknown | undefined;\n readonly commandTemplate?: string | unknown | undefined;\n readonly files_format?: string | unknown | undefined;\n readonly filesFormat?: string | unknown | undefined;\n readonly attachments_format?: string | unknown | undefined;\n readonly attachmentsFormat?: string | unknown | undefined;\n readonly env?: unknown | undefined;\n readonly healthcheck?: unknown | undefined;\n // Retry configuration fields\n readonly max_retries?: number | unknown | undefined;\n readonly maxRetries?: number | unknown | undefined;\n readonly retry_initial_delay_ms?: number | unknown | undefined;\n readonly retryInitialDelayMs?: number | unknown | undefined;\n readonly retry_max_delay_ms?: number | unknown | undefined;\n readonly retryMaxDelayMs?: number | unknown | undefined;\n readonly retry_backoff_factor?: number | unknown | undefined;\n readonly retryBackoffFactor?: number | unknown | undefined;\n readonly retry_status_codes?: unknown | undefined;\n readonly retryStatusCodes?: unknown | undefined;\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,gBAAgB;AACjC,OAAO,UAAU;AAEjB,eAAsB,WAAW,UAAoC;AACnE,MAAI;AACF,UAAM,OAAO,UAAU,UAAU,IAAI;AACrC,WAAO;AAA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