use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use std::str::FromStr;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum AgentKind {
ClaudeCode,
Cursor,
Codex,
QwenCode,
Cline,
}
impl FromStr for AgentKind {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"claude-code" | "claude" => Ok(Self::ClaudeCode),
"cursor" => Ok(Self::Cursor),
"codex" => Ok(Self::Codex),
"qwen" | "qwen-code" => Ok(Self::QwenCode),
"cline" => Ok(Self::Cline),
_ => Err(()),
}
}
}
#[derive(Debug, Clone)]
pub struct NormalizedHookInput {
pub session_id: Option<String>,
pub hook_event_name: String,
pub tool_name: Option<String>,
pub file_paths: Vec<PathBuf>,
pub cwd: Option<PathBuf>,
pub stop_hook_active: bool,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ScarHit {
pub path: PathBuf,
pub line_number: usize,
pub kind: String,
pub message: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct SanitizedEvent {
pub session_id: Option<String>,
pub hook_event_name: String,
pub tool_name: Option<String>,
pub file_paths: Vec<PathBuf>,
pub cwd: PathBuf,
pub timestamp_ms: u64,
}