swarm / companies/lantern/seed/src/events.rs

raw file 629 bytes
//! Event stream (seed stub): every session publishes structured events on
//! GET /events/{id} (SSE) and mirrors them to an audit JSONL log.
//! Backlog T4 — types here are the event vocabulary contract.

use serde::Serialize;

#[derive(Serialize, Debug, Clone)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum SessionEvent {
    Step { session: String, n: u32, note: String },
    ToolCall { session: String, action: String, args: serde_json::Value },
    PageEvent { session: String, url: String, title: String },
    Result { session: String, summary: String },
    Error { session: String, message: String },
}