1use crate::SlashCommandItem;
2use crate::{KeyboardProtocolSettings, SessionSurface};
3
4pub trait WorkspaceInfoProvider {
6 fn workspace_name(&self) -> String;
7 fn workspace_root(&self) -> Option<std::path::PathBuf>;
8}
9
10pub trait NotificationProvider {
12 fn set_terminal_focused(&self, focused: bool);
13}
14
15pub trait ThemeProvider {
17 fn available_themes(&self) -> Vec<String>;
18 fn active_theme_name(&self) -> Option<String>;
19}
20
21#[derive(Debug, Clone, PartialEq, Eq)]
23pub struct HostSessionDefaults {
24 pub surface_preference: SessionSurface,
25 pub inline_rows: u16,
26 pub keyboard_protocol: KeyboardProtocolSettings,
27}
28
29impl Default for HostSessionDefaults {
30 fn default() -> Self {
31 Self {
32 surface_preference: SessionSurface::default(),
33 inline_rows: crate::config::constants::ui::DEFAULT_INLINE_VIEWPORT_ROWS,
34 keyboard_protocol: KeyboardProtocolSettings::default(),
35 }
36 }
37}
38
39pub trait HostAdapter: WorkspaceInfoProvider + NotificationProvider + ThemeProvider {
41 fn session_defaults(&self) -> HostSessionDefaults {
43 HostSessionDefaults::default()
44 }
45
46 fn slash_commands(&self) -> Vec<SlashCommandItem> {
48 Vec::new()
49 }
50
51 fn app_name(&self) -> String {
53 "Agent TUI".to_string()
54 }
55
56 fn non_interactive_hint(&self) -> Option<String> {
58 None
59 }
60}