Skip to main content

ai_agent/utils/
render_options.rs

1//! Render options for terminal output.
2
3use serde::{Deserialize, Serialize};
4
5/// Terminal render options
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct RenderOptions {
8    pub use_ansi: bool,
9    pub use_color: bool,
10    pub use_theme: bool,
11    pub compact: bool,
12    pub show_sender: bool,
13    pub show_timestamp: bool,
14}
15
16impl Default for RenderOptions {
17    fn default() -> Self {
18        Self {
19            use_ansi: true,
20            use_color: true,
21            use_theme: true,
22            compact: false,
23            show_sender: true,
24            show_timestamp: false,
25        }
26    }
27}
28
29impl RenderOptions {
30    pub fn compact() -> Self {
31        Self {
32            compact: true,
33            ..Default::default()
34        }
35    }
36
37    pub fn plain() -> Self {
38        Self {
39            use_ansi: false,
40            use_color: false,
41            use_theme: false,
42            compact: true,
43            ..Default::default()
44        }
45    }
46}