mod claude;
mod codex;
pub(crate) mod common;
mod gemini;
mod generic;
mod grok;
mod kimi;
use crate::event::EventKind;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Item {
pub key: String,
pub kind: EventKind,
}
#[derive(Clone, Debug, Default)]
pub struct Parsed {
pub items: Vec<Item>,
pub working: Option<String>,
pub needs_input: bool,
pub prompt_hint: String,
}
pub trait ProviderParser: Send {
fn provider(&self) -> &'static str;
fn parse(&mut self, rows: &[String]) -> Parsed;
}
pub fn parser_for(provider: &str) -> Box<dyn ProviderParser> {
match provider {
"claude" => Box::new(claude::ClaudeParser),
"codex" => Box::new(codex::CodexParser),
"kimi" => Box::new(kimi::KimiParser),
"grok" => Box::new(grok::GrokParser),
"gemini" => Box::new(gemini::GeminiParser),
_ => Box::new(generic::GenericParser),
}
}