pub mod claude;
pub mod gemini;
pub mod launch;
pub mod opencode;
pub mod templates;
use crate::environment::Environment;
use anyhow::Result;
use std::path::Path;
pub use launch::{Adapter, AdapterInfo, McpConfig};
pub trait LLMAdapter {
fn name(&self) -> &'static str;
fn init_project(
&self,
project_path: &Path,
project_name: &str,
environment: &Environment,
) -> Result<()>;
fn post_init(&self, _project_path: &Path) -> Result<()> {
Ok(()) }
fn get_custom_commands(&self) -> Vec<(&'static str, &'static str)> {
vec![]
}
fn get_context_file_path(&self, project_path: &Path) -> std::path::PathBuf;
fn check_for_updates(&self, _project_path: &Path) -> Result<Option<(String, String)>> {
Ok(None) }
fn update_adapter_files(&self, _project_path: &Path) -> Result<()> {
Ok(()) }
fn get_version_changes(&self, _version: &str) -> Option<Vec<String>> {
None }
fn get_changelog_since(&self, _from_version: &str) -> Vec<String> {
Vec::new() }
fn get_sessions_path(&self, _project_path: &Path) -> Option<std::path::PathBuf> {
None }
fn version(&self) -> &'static str {
"0.1.0" }
}
pub fn get_adapter(llm_name: &str) -> Box<dyn LLMAdapter> {
match llm_name.to_lowercase().as_str() {
"claude" => Box::new(claude::ClaudeAdapter),
"gemini" => Box::new(gemini::GeminiAdapter::new()),
"opencode" => Box::new(opencode::OpenCodeAdapter::new()),
_ => Box::new(claude::ClaudeAdapter),
}
}