-
Notifications
You must be signed in to change notification settings - Fork 0
feat: TypeScript targets config (agentv.config.ts) #908
Copy link
Copy link
Open
Labels
coreAnything pertaining to core functionality of AgentVAnything pertaining to core functionality of AgentV
Description
Problem
Target configuration in targets.yaml is growing complex with use_target delegation, env var interpolation (${{ VAR }}), and provider-specific fields. YAML lacks type safety, autocomplete, and conditional logic.
Proposal
Extend the existing agentv.config.ts (via defineConfig()) to support targets alongside eval config:
import { defineConfig } from 'agentv';
export default defineConfig({
targets: {
default: { use_target: process.env.AGENT_TARGET ?? 'copilot-cli' },
grader: { use_target: process.env.GRADER_TARGET ?? 'openrouter' },
llm: { use_target: process.env.GRADER_TARGET ?? 'openrouter' },
'copilot-cli': {
provider: 'copilot-cli',
model: process.env.COPILOT_MODEL ?? 'gpt-5-mini',
grader_target: 'grader',
},
openrouter: {
provider: 'openrouter',
api_key: process.env.OPENROUTER_API_KEY!,
model: process.env.OPENROUTER_MODEL ?? 'openai/gpt-5.4-mini',
},
},
});Benefits over YAML
| Feature | YAML targets.yaml | TypeScript agentv.config.ts |
|---|---|---|
| Type safety | None | Full autocomplete + compile errors |
| Env vars | ${{ VAR }} custom syntax |
Native process.env.VAR |
| Conditionals | Not possible | if/else, ternary, ?? |
| Defaults | Requires fallback syntax | Native ?? operator |
| Validation | Runtime only | Compile-time + runtime |
| Composition | Flat list | Spread, functions, imports |
Prior art
- Vitest:
vitest.config.tsreplaced JSON config - Next.js:
next.config.tsreplacednext.config.js - ESLint:
eslint.config.tsflat config - promptfoo:
promptfooconfig.tsalongside YAML - Tailwind:
tailwind.config.ts
All major frameworks are converging on TypeScript config for complex configuration.
Backward compatibility
targets.yamlcontinues to work unchangedagentv.config.tstargets take precedence when both exist- Discovery order:
agentv.config.ts>.agentv/targets.yaml
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of AgentVAnything pertaining to core functionality of AgentV