//! SSE helpers for streaming build/run output. use axum::response::sse::Event; /// Build a line-output SSE event, classifying the line as error/warning/success/info. pub fn classify_line(line: &str) -> Event { let event_type = if line.to_lowercase().contains("error") { "error" } else if line.to_lowercase().contains("warning") || line.to_lowercase().contains("warn") { "warning" } else if line.to_lowercase().contains("compiled") || line.to_lowercase().contains("ok") || line.to_lowercase().contains("success") { "success" } else { "info" }; Event::default().event(event_type).data(line.to_string()) }