Skip to content
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
This repository was archived by the owner on Oct 16, 2026. It is now read-only.

feat: TypeScript targets config (agentv.config.ts) #908

Closed as not planned
Closed as not planned

Description

@christso

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.ts replaced JSON config
  • Next.js: next.config.ts replaced next.config.js
  • ESLint: eslint.config.ts flat config
  • promptfoo: promptfooconfig.ts alongside YAML
  • Tailwind: tailwind.config.ts

All major frameworks are converging on TypeScript config for complex configuration.

Backward compatibility

  • targets.yaml continues to work unchanged
  • agentv.config.ts targets take precedence when both exist
  • Discovery order: agentv.config.ts > .agentv/targets.yaml

Activity

  1. added
    coreAnything pertaining to core functionality of AgentV
    on Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreAnything pertaining to core functionality of AgentV

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions