# Ralph Orchestrator Configuration
# This file configures Ralph and its AI agent adapters

# Core orchestrator settings
agent: auto                    # Which agent to use: claude, kiro, q, gemini, acp, auto
# Agent selection + fallback ordering (used when agent=auto, and for fallback order)
# Valid values: acp, claude, gemini, kiro, qchat (aliases: codex->acp, q->qchat, kiro-cli->kiro)
agent_priority:                # Priority order (first available wins)
  - claude
  - kiro
  - gemini
  - qchat
  - acp
prompt_file: PROMPT.md         # Path to prompt file
completion_promise: "LOOP_COMPLETE"
max_iterations: 100            # Maximum iterations before stopping
max_runtime: 14400             # Maximum runtime in seconds (4 hours)
checkpoint_interval: 5         # Git checkpoint every N iterations
retry_delay: 2                 # Delay between retries in seconds

# Resource limits
max_tokens: 1000000           # Maximum total tokens (1M)
max_cost: 50.0                # Maximum cost in USD
context_window: 200000        # Context window size in tokens
context_threshold: 0.8        # Trigger summarization at 80% of context

# Features
archive_prompts: true         # Archive prompt history
git_checkpoint: true          # Enable git checkpointing
enable_metrics: true          # Enable metrics collection
verbose: false                # Enable verbose output
dry_run: false                # Test mode without execution

# Telemetry settings
iteration_telemetry: true     # Enable per-iteration telemetry capture
output_preview_length: 500    # Max chars for output preview in telemetry (truncated for privacy)

# Safety settings
max_prompt_size: 10485760     # Max prompt file size (10MB)
allow_unsafe_paths: false     # Allow potentially unsafe prompt paths

# Adapter-specific configurations
adapters:
  claude:
    enabled: true
    timeout: 300              # Timeout in seconds
    max_retries: 3            # Max retry attempts
    tool_permissions:         # Tool permissions for Claude
      allow_all: true         # Allow all tools without approval
  
  # Kiro CLI adapter (successor to Amazon Q Developer CLI)
  # Primary command: kiro-cli, falls back to 'q' for compatibility
  # Config paths: ~/.kiro/settings/mcp.json, ~/.kiro/prompts, .kiro/
  kiro:
    enabled: true
    timeout: 600              # Timeout in seconds (default: 600)
    max_retries: 3            # Max retry attempts
    args: []
    env: {}
    # Environment overrides (optional):
    # RALPH_KIRO_COMMAND      - Primary command (default: kiro-cli)
    # RALPH_KIRO_TIMEOUT      - Timeout in seconds (default: 600)
    # RALPH_KIRO_TRUST_TOOLS  - Trust all tools (default: true)
    # RALPH_KIRO_NO_INTERACTIVE - Disable interactive mode (default: true)
  
  # Q Chat adapter (legacy - deprecated in favor of kiro)
  # NOTE: Amazon Q Developer CLI has been rebranded to Kiro CLI
  # Consider migrating to the 'kiro' adapter for new projects
  q:
    enabled: true
    timeout: 300
    max_retries: 3
    args: []
    env: {}
  
  gemini:
    enabled: true
    timeout: 300
    max_retries: 3
    args: []
    env: {}

  # Agent Client Protocol (ACP) adapter
  # Works with any ACP-compliant agent, e.g. `codex-acp` (Codex), `gemini`, etc.
  acp:
    enabled: true
    timeout: 300
    max_retries: 3
    args: []
    env: {}
    tool_permissions:
      agent_command: codex-acp          # ACP agent command to run
      agent_args: []                   # Args passed to the ACP agent
      permission_mode: interactive      # auto_approve | deny_all | allowlist | interactive
      permission_allowlist: []         # Used when permission_mode=allowlist
