Skip to main content

agent_base/types/
events.rs

1use serde_json::Value;
2
3use super::approval::ApprovalRequest;
4use super::checkpoint::CheckpointData;
5use super::session::SessionId;
6
7#[derive(Clone, Debug)]
8pub enum AgentEvent {
9    TextDelta {
10        session_id: SessionId,
11        text: String,
12    },
13    ThoughtDelta {
14        session_id: SessionId,
15        text: String,
16    },
17    ToolCallStarted {
18        session_id: SessionId,
19        tool_name: String,
20        args_json: String,
21    },
22    ToolCallFinished {
23        session_id: SessionId,
24        tool_name: String,
25        summary: String,
26    },
27    AwaitingApproval {
28        session_id: SessionId,
29        request: ApprovalRequest,
30    },
31    Checkpoint {
32        session_id: SessionId,
33        checkpoint: CheckpointData,
34    },
35    RunFinished {
36        session_id: SessionId,
37    },
38    Custom {
39        session_id: SessionId,
40        payload: Value,
41    },
42}