pub mod claude_code;
pub mod cursor;

use anyhow::Result;
use second_brain_core::schema::{Conversation, Memory};

pub trait Adapter: Send + Sync {
    fn name(&self) -> &str;
    fn discover_conversations(&self) -> Result<Vec<ConversationSource>>;
    fn ingest_conversation(&self, source: &ConversationSource) -> Result<IngestResult>;
}

#[derive(Debug, Clone)]
pub struct ConversationSource {
    pub id: String,
    pub path: String,
    pub source_name: String,
    pub machine_id: String,
}

#[derive(Debug, Clone)]
pub struct ExtractedEntity {
    pub name: String,
    pub entity_type: String,
}

#[derive(Debug, Clone)]
pub struct IngestResult {
    pub conversation: Conversation,
    pub memories: Vec<Memory>,
    pub entities: Vec<(ExtractedEntity, uuid::Uuid)>,
    pub entities_extracted: usize,
}
