1use crate::app::SlashCommandItem;
2use crate::{FullscreenInteractionSettings, 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 pub fullscreen: FullscreenInteractionSettings,
28}
29
30impl Default for HostSessionDefaults {
31 fn default() -> Self {
32 Self {
33 surface_preference: SessionSurface::default(),
34 inline_rows: crate::config::constants::ui::DEFAULT_INLINE_VIEWPORT_ROWS,
35 keyboard_protocol: KeyboardProtocolSettings::default(),
36 fullscreen: FullscreenInteractionSettings::default(),
37 }
38 }
39}
40
41pub trait HostAdapter: WorkspaceInfoProvider + NotificationProvider + ThemeProvider {
43 fn session_defaults(&self) -> HostSessionDefaults {
45 HostSessionDefaults::default()
46 }
47
48 fn slash_commands(&self) -> Vec<SlashCommandItem> {
50 Vec::new()
51 }
52
53 fn app_name(&self) -> String {
55 "Agent TUI".to_string()
56 }
57
58 fn non_interactive_hint(&self) -> Option<String> {
60 None
61 }
62}