//! LLM integration module for file editing via tool calling.

pub mod claude;
pub mod groq;
pub mod tools;

pub use claude::{ClaudeClient, ClaudeModel};
pub use groq::GroqClient;
pub use tools::{execute_tool_call, Tool, ToolCall, ToolResult, AVAILABLE_TOOLS};

/// Available LLM providers and models
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum LlmModel {
    /// Claude Sonnet 4.5 - balanced speed and capability
    ClaudeSonnet,
    /// Claude Opus 4.5 (default) - most capable
    #[default]
    ClaudeOpus,
    /// Groq Kimi - fast alternative provider
    GroqKimi,
}

impl LlmModel {
    pub fn from_str(s: &str) -> Option<Self> {
        match s.to_lowercase().as_str() {
            "claude-sonnet" | "sonnet" | "claude" => Some(LlmModel::ClaudeSonnet),
            "claude-opus" | "opus" => Some(LlmModel::ClaudeOpus),
            "groq" | "kimi" | "groq-kimi" => Some(LlmModel::GroqKimi),
            _ => None,
        }
    }
}
