1#[derive(Debug, Clone, PartialEq)]
2pub enum TodoStatus {
3 Pending,
4 InProgress,
5 Completed,
6}
7
8#[derive(Debug, Clone)]
9pub struct TodoItem {
10 pub content: String,
11 pub status: TodoStatus,
12}
13
14pub struct QuestionResponder(pub tokio::sync::oneshot::Sender<String>);
15
16impl std::fmt::Debug for QuestionResponder {
17 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18 f.write_str("QuestionResponder")
19 }
20}
21
22use crate::provider::Usage;
23#[derive(Debug)]
24pub enum AgentEvent {
25 TextDelta(String),
26 ThinkingDelta(String),
27 TextComplete(String),
28 ToolCallStart {
29 id: String,
30 name: String,
31 },
32 ToolCallInputDelta(String),
33 ToolCallExecuting {
34 id: String,
35 name: String,
36 input: String,
37 },
38 ToolCallResult {
39 id: String,
40 name: String,
41 output: String,
42 is_error: bool,
43 },
44 Done {
45 usage: Usage,
46 },
47 Error(String),
48 Compacting,
49 Compacted {
50 messages_removed: usize,
51 },
52 TitleGenerated(String),
53 TodoUpdate(Vec<TodoItem>),
54 Question {
55 id: String,
56 question: String,
57 options: Vec<String>,
58 responder: QuestionResponder,
59 },
60 PermissionRequest {
61 tool_name: String,
62 input_summary: String,
63 responder: QuestionResponder,
64 },
65 SubagentStart {
66 id: String,
67 description: String,
68 background: bool,
69 },
70 SubagentDelta {
71 id: String,
72 text: String,
73 },
74 SubagentToolStart {
75 id: String,
76 tool_name: String,
77 detail: String,
78 },
79 SubagentToolComplete {
80 id: String,
81 tool_name: String,
82 },
83 SubagentComplete {
84 id: String,
85 output: String,
86 },
87 SubagentBackgroundDone {
88 id: String,
89 description: String,
90 output: String,
91 },
92 MemoryExtracted {
93 added: usize,
94 updated: usize,
95 deleted: usize,
96 },
97 AsideDelta(String),
98 AsideDone,
99 AsideError(String),
100}
101
102pub(super) struct PendingToolCall {
103 pub id: String,
104 pub name: String,
105 pub input: String,
106}