# src/config.ts Modification Intent

## What Changed

Added provider configuration settings to enable multi-provider support (Claude, OpenAI, Gemini) and execution mode selection (container, TUI, direct API).

## Changes Made

1. **Type Definitions**
   - Added `ProviderType` type: `'claude' | 'openai' | 'gemini'`
   - Added `ExecutionMode` type: `'container' | 'tui' | 'direct'`

2. **New Configuration Exports**
   - `AI_PROVIDER` - Which AI provider to use (default: 'claude')
   - `EXECUTION_MODE` - How to execute requests (default: 'container')
   - `CLAUDE_MODEL` - Claude model name (default: 'claude-sonnet-4-20250514')
   - `OPENAI_MODEL` - OpenAI model name (default: 'gpt-4o')
   - `GEMINI_MODEL` - Gemini model name (default: 'gemini-pro')
   - `FALLBACK_PROVIDER` - Optional secondary provider
   - `FALLBACK_MODEL` - Optional fallback model

3. **Helper Function**
   - `getModelForProvider(provider)` - Returns the appropriate model name for a given provider

4. **Validation**
   - Warns if invalid `AI_PROVIDER` is set
   - Warns if invalid `EXECUTION_MODE` is set

## Invariants

1. **Backwards Compatibility**: All existing exports remain unchanged. New settings are additive.

2. **Default Values**: If environment variables are not set, sensible defaults are used:
   - Provider defaults to 'claude' (existing behavior)
   - Mode defaults to 'container' (existing behavior)

3. **No Secret Exposure**: API keys are NOT read here. They remain in environment and are read only where needed (container-runner.ts, providers).

4. **Type Safety**: Provider and mode types are exported for use throughout the codebase.

## Environment Variables

```bash
# Provider Selection
AI_PROVIDER=claude              # claude | openai | gemini
EXECUTION_MODE=container        # container | tui | direct

# Model Selection (provider-specific)
CLAUDE_MODEL=claude-sonnet-4-20250514
OPENAI_MODEL=gpt-4o
GEMINI_MODEL=gemini-pro

# Fallback (optional)
FALLBACK_PROVIDER=openai
FALLBACK_MODEL=gpt-4o
```

## Usage

```typescript
import { AI_PROVIDER, EXECUTION_MODE, getModelForProvider } from './config.js';

const model = getModelForProvider(AI_PROVIDER);
console.log(`Using ${AI_PROVIDER} with model ${model} in ${EXECUTION_MODE} mode`);
```

## Testing Considerations

- Test with each provider type
- Test with missing environment variables
- Test fallback logic
- Verify warnings are logged for invalid values
