Skip to main content

wrapper_events/
normalized.rs

1use crate::{CapturedRaw, ValidatedChannelString};
2
3#[derive(Debug, Clone, Eq, PartialEq)]
4pub enum WrapperAgentKind {
5    Codex,
6    ClaudeCode,
7    /// Open-set escape hatch so new backends don't require enum edits.
8    Other(String),
9}
10
11#[derive(Debug, Clone, Copy, Eq, PartialEq)]
12pub enum NormalizedEventKind {
13    TextOutput,
14    ToolCall,
15    ToolResult,
16    Status,
17    Error,
18    Unknown,
19}
20
21#[derive(Debug, Clone, PartialEq)]
22pub struct NormalizationContext {
23    pub agent_id: String,
24    pub backend_id: Option<String>,
25    pub orchestration_session_id: Option<String>,
26    pub run_id: Option<String>,
27    pub world_id: Option<String>,
28    pub channel_hint: Option<ValidatedChannelString>,
29}
30
31#[derive(Debug, Clone, PartialEq)]
32pub struct NormalizedWrapperEvent {
33    pub line_number: usize,
34    pub agent_kind: WrapperAgentKind,
35    pub kind: NormalizedEventKind,
36    pub context: NormalizationContext,
37    pub channel: Option<ValidatedChannelString>,
38    pub captured_raw: Option<CapturedRaw>,
39}
40
41#[derive(Debug, Clone, Default, PartialEq)]
42pub struct NormalizedEvents(pub Vec<NormalizedWrapperEvent>);