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