Skip to main content

deepseek_rust_cli/agent/
types.rs

1use crate::api::types::TokenUsage;
2
3#[derive(Debug, Clone, Copy, PartialEq)]
4pub enum ApprovalResult {
5    Yes,
6    No,
7    Always,
8}
9
10#[derive(Debug, Clone)]
11pub enum AgentEvent {
12    Reasoning {
13        content: String,
14    },
15    Content {
16        content: String,
17    },
18    ToolStart {
19        name: String,
20        args: String,
21    },
22    ToolEnd {
23        name: String,
24        /// Truncated result output for display (colorized by TUI)
25        result: Option<String>,
26    },
27    Error {
28        content: String,
29    },
30    ApprovalRequest {
31        name: String,
32        args: String,
33    },
34    Done {
35        token_usage: TokenUsage,
36    },
37    Aborted {
38        token_usage: TokenUsage,
39    },
40}
41
42#[derive(Debug, Clone)]
43pub struct UndoAction {
44    pub r#type: String,
45    pub path: String,
46    /// For 'write', 'replace', 'delete': contains file content.
47    /// For 'rename': contains the original source path as bytes.
48    pub backup: Option<Vec<u8>>,
49}