pub struct TuiBridge { /* private fields */ }Expand description
Bridge connecting limit-cli REPL to limit-tui components
Implementations§
Source§impl TuiBridge
impl TuiBridge
Sourcepub fn new(
agent_bridge: AgentBridge,
event_rx: UnboundedReceiver<AgentEvent>,
) -> Result<Self, CliError>
pub fn new( agent_bridge: AgentBridge, event_rx: UnboundedReceiver<AgentEvent>, ) -> Result<Self, CliError>
Create a new TuiBridge with the given agent bridge and event channel
Sourcepub fn with_session_manager(
agent_bridge: AgentBridge,
event_rx: UnboundedReceiver<AgentEvent>,
session_manager: SessionManager,
) -> Result<Self, CliError>
pub fn with_session_manager( agent_bridge: AgentBridge, event_rx: UnboundedReceiver<AgentEvent>, session_manager: SessionManager, ) -> Result<Self, CliError>
Create a new TuiBridge with a custom session manager
Sourcepub fn agent_bridge_arc(&self) -> Arc<Mutex<AgentBridge>>
pub fn agent_bridge_arc(&self) -> Arc<Mutex<AgentBridge>>
Get a clone of the agent bridge Arc for spawning tasks
Sourcepub fn agent_bridge(&self) -> MutexGuard<'_, AgentBridge>
pub fn agent_bridge(&self) -> MutexGuard<'_, AgentBridge>
Get locked access to the agent bridge (for compatibility)
Sourcepub fn activity_feed(&self) -> &Arc<Mutex<ActivityFeed>>
pub fn activity_feed(&self) -> &Arc<Mutex<ActivityFeed>>
Get a reference to the activity feed
Sourcepub fn process_events(&mut self) -> Result<(), CliError>
pub fn process_events(&mut self) -> Result<(), CliError>
Process events from the agent and update TUI state
Sourcepub fn add_user_message(&self, content: String)
pub fn add_user_message(&self, content: String)
Add a user message to the chat
Sourcepub fn tick_spinner(&self)
pub fn tick_spinner(&self)
Tick the spinner animation
Sourcepub fn operation_id(&self) -> u64
pub fn operation_id(&self) -> u64
Get current operation ID
Sourcepub fn next_operation_id(&self) -> u64
pub fn next_operation_id(&self) -> u64
Increment and get new operation ID
Sourcepub fn total_input_tokens(&self) -> u64
pub fn total_input_tokens(&self) -> u64
Get total input tokens for the session
Sourcepub fn total_output_tokens(&self) -> u64
pub fn total_output_tokens(&self) -> u64
Get total output tokens for the session
Sourcepub fn session_id(&self) -> String
pub fn session_id(&self) -> String
Get the current session ID
Sourcepub fn save_session(&self) -> Result<(), CliError>
pub fn save_session(&self) -> Result<(), CliError>
Save the current session
Sourcepub fn session_manager(&self) -> Arc<Mutex<SessionManager>>
pub fn session_manager(&self) -> Arc<Mutex<SessionManager>>
Get session manager (for command handling)
Sourcepub fn total_input_tokens_arc(&self) -> Arc<Mutex<u64>>
pub fn total_input_tokens_arc(&self) -> Arc<Mutex<u64>>
Get total input tokens arc (for command handling)
Sourcepub fn total_output_tokens_arc(&self) -> Arc<Mutex<u64>>
pub fn total_output_tokens_arc(&self) -> Arc<Mutex<u64>>
Get total output tokens arc (for command handling)
Sourcepub fn session_id_arc(&self) -> Arc<Mutex<String>>
pub fn session_id_arc(&self) -> Arc<Mutex<String>>
Get session id arc (for command handling)
Auto Trait Implementations§
impl Freeze for TuiBridge
impl RefUnwindSafe for TuiBridge
impl Send for TuiBridge
impl Sync for TuiBridge
impl Unpin for TuiBridge
impl UnsafeUnpin for TuiBridge
impl UnwindSafe for TuiBridge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more