Skip to main content

AppState

Struct AppState 

Source
pub struct AppState {
Show 92 fields pub view_mode: ViewMode, pub input_mode: InputMode, pub messages: Vec<ChatMessage>, pub input: String, pub input_cursor: usize, pub input_scroll: usize, pub chat_scroll: usize, pub chat_last_max_scroll: usize, pub tool_preview_scroll: usize, pub tool_preview_last_max_scroll: usize, pub status: String, pub processing: bool, pub session_id: Option<String>, pub sessions: Vec<SessionSummary>, pub selected_session: usize, pub session_filter: String, pub cwd_display: String, pub bus_log: BusLogState, pub swarm: SwarmViewState, pub ralph: RalphViewState, pub symbol_search: SymbolSearchState, pub slash_suggestions: Vec<String>, pub selected_slash_suggestion: usize, pub command_history: Vec<String>, pub history_index: Option<usize>, pub worker_id: Option<String>, pub worker_name: Option<String>, pub a2a_connected: bool, pub recent_tasks: Vec<String>, pub worker_bridge_registered_agents: HashSet<String>, pub worker_bridge_processing_state: Option<bool>, pub worker_task_queue: VecDeque<IncomingTask>, pub help_scroll: HelpScrollState, pub show_help: bool, pub available_models: Vec<String>, pub selected_model_index: usize, pub model_picker_active: bool, pub model_filter: String, pub streaming_text: String, pub processing_started_at: Option<Instant>, pub current_request_first_token_ms: Option<u64>, pub current_request_last_token_ms: Option<u64>, pub last_request_first_token_ms: Option<u64>, pub last_request_last_token_ms: Option<u64>, pub last_completion_model: Option<String>, pub last_completion_latency_ms: Option<u64>, pub last_completion_prompt_tokens: Option<usize>, pub last_completion_output_tokens: Option<usize>, pub last_tool_name: Option<String>, pub last_tool_latency_ms: Option<u64>, pub last_tool_success: Option<bool>, pub pending_images: Vec<ImageAttachment>, pub queued_steering: Vec<String>, pub auto_apply_edits: bool, pub allow_network: bool, pub slash_autocomplete: bool, pub use_worktree: bool, pub selected_settings_index: usize, pub mcp_registry: Arc<TuiMcpRegistry>, pub spawned_agents: HashMap<String, SpawnedAgent>, pub active_spawned_agent: Option<String>, pub streaming_agent_texts: HashMap<String, String>, pub cached_message_lines: Vec<Line<'static>>, pub cached_messages_len: usize, pub cached_max_width: usize, pub cached_streaming_snapshot: Option<String>, pub cached_processing: bool, pub cached_frozen_len: usize, pub watchdog_notification: Option<WatchdogNotification>, pub main_watchdog_root_prompt: Option<String>, pub main_last_event_at: Option<Instant>, pub main_watchdog_restart_count: u32, pub main_inflight_prompt: Option<String>, pub okr_repository: Option<Arc<OkrRepository>>, pub pending_okr_approval: Option<PendingOkrApproval>, pub pending_smart_switch_retry: Option<PendingSmartSwitchRetry>, pub smart_switch_retry_count: u32, pub smart_switch_attempted_models: Vec<String>, pub chat_sync_rx: Option<UnboundedReceiver<ChatSyncUiEvent>>, pub chat_sync_status: Option<String>, pub chat_sync_last_success: Option<String>, pub chat_sync_last_error: Option<String>, pub chat_sync_uploaded_bytes: u64, pub chat_sync_uploaded_batches: u64, pub autochat: AutochatState, pub file_picker_dir: PathBuf, pub file_picker_entries: Vec<FilePickerEntry>, pub file_picker_selected: usize, pub file_picker_filter: String, pub file_picker_active: bool, pub workspace: WorkspaceSnapshot, pub chat_layout_mode: ChatLayoutMode,
}

Fields§

§view_mode: ViewMode§input_mode: InputMode§messages: Vec<ChatMessage>§input: String§input_cursor: usize§input_scroll: usize§chat_scroll: usize§chat_last_max_scroll: usize§tool_preview_scroll: usize§tool_preview_last_max_scroll: usize§status: String§processing: bool§session_id: Option<String>§sessions: Vec<SessionSummary>§selected_session: usize§session_filter: String§cwd_display: String§bus_log: BusLogState§swarm: SwarmViewState§ralph: RalphViewState§symbol_search: SymbolSearchState§slash_suggestions: Vec<String>§selected_slash_suggestion: usize§command_history: Vec<String>§history_index: Option<usize>§worker_id: Option<String>§worker_name: Option<String>§a2a_connected: bool§recent_tasks: Vec<String>§worker_bridge_registered_agents: HashSet<String>§worker_bridge_processing_state: Option<bool>§worker_task_queue: VecDeque<IncomingTask>§help_scroll: HelpScrollState§show_help: bool§available_models: Vec<String>§selected_model_index: usize§model_picker_active: bool§model_filter: String§streaming_text: String§processing_started_at: Option<Instant>§current_request_first_token_ms: Option<u64>§current_request_last_token_ms: Option<u64>§last_request_first_token_ms: Option<u64>§last_request_last_token_ms: Option<u64>§last_completion_model: Option<String>§last_completion_latency_ms: Option<u64>§last_completion_prompt_tokens: Option<usize>§last_completion_output_tokens: Option<usize>§last_tool_name: Option<String>§last_tool_latency_ms: Option<u64>§last_tool_success: Option<bool>§pending_images: Vec<ImageAttachment>§queued_steering: Vec<String>§auto_apply_edits: bool§allow_network: bool§slash_autocomplete: bool§use_worktree: bool§selected_settings_index: usize§mcp_registry: Arc<TuiMcpRegistry>§spawned_agents: HashMap<String, SpawnedAgent>§active_spawned_agent: Option<String>§streaming_agent_texts: HashMap<String, String>§cached_message_lines: Vec<Line<'static>>§cached_messages_len: usize§cached_max_width: usize§cached_streaming_snapshot: Option<String>§cached_processing: bool§cached_frozen_len: usize§watchdog_notification: Option<WatchdogNotification>§main_watchdog_root_prompt: Option<String>§main_last_event_at: Option<Instant>§main_watchdog_restart_count: u32§main_inflight_prompt: Option<String>§okr_repository: Option<Arc<OkrRepository>>§pending_okr_approval: Option<PendingOkrApproval>§pending_smart_switch_retry: Option<PendingSmartSwitchRetry>§smart_switch_retry_count: u32§smart_switch_attempted_models: Vec<String>§chat_sync_rx: Option<UnboundedReceiver<ChatSyncUiEvent>>§chat_sync_status: Option<String>§chat_sync_last_success: Option<String>§chat_sync_last_error: Option<String>§chat_sync_uploaded_bytes: u64§chat_sync_uploaded_batches: u64§autochat: AutochatState§file_picker_dir: PathBuf§file_picker_entries: Vec<FilePickerEntry>§file_picker_selected: usize§file_picker_filter: String§file_picker_active: bool§workspace: WorkspaceSnapshot§chat_layout_mode: ChatLayoutMode

Implementations§

Source§

impl AppState

Source

pub fn push_history(&mut self, entry: String)

Source

pub fn history_prev(&mut self) -> bool

Source

pub fn history_next(&mut self) -> bool

Source§

impl AppState

Source

pub fn clamp_input_cursor(&mut self)

Source

pub fn ensure_input_cursor_visible(&mut self, visible_width: usize)

Source

pub fn move_cursor_left(&mut self)

Source

pub fn move_cursor_right(&mut self)

Source

pub fn move_cursor_word_left(&mut self)

Source

pub fn move_cursor_word_right(&mut self)

Source

pub fn move_cursor_home(&mut self)

Source

pub fn move_cursor_end(&mut self)

Source§

impl AppState

Source

pub fn insert_char(&mut self, c: char)

Source

pub fn insert_text(&mut self, text: &str)

Source

pub fn delete_backspace(&mut self)

Source

pub fn delete_forward(&mut self)

Source

pub fn clear_input(&mut self)

Source§

impl AppState

Source

pub fn get_or_build_message_lines( &mut self, max_width: usize, ) -> Option<Vec<Line<'static>>>

Returns cached lines when still valid for max_width, or None.

Source§

impl AppState

Source

pub async fn refresh_available_models( &mut self, registry: Option<&Arc<ProviderRegistry>>, ) -> Result<()>

Refresh the available models list from the provider registry.

§Errors

Returns an error if any provider call fails critically.

Source§

impl AppState

Source

pub fn filtered_models(&self) -> Vec<&str>

Source

pub fn set_available_models(&mut self, models: Vec<String>)

Source

pub fn open_model_picker(&mut self)

Source

pub fn close_model_picker(&mut self)

Source

pub fn model_select_prev(&mut self)

Source

pub fn model_select_next(&mut self)

Source

pub fn model_filter_push(&mut self, c: char)

Source

pub fn model_filter_backspace(&mut self)

Source

pub fn selected_model(&self) -> Option<&str>

Source§

impl AppState

Source

pub fn scroll_up(&mut self, amount: usize)

Source

pub fn scroll_down(&mut self, amount: usize)

Source

pub fn scroll_to_bottom(&mut self)

Set sentinel value — clamped to actual content height at render time.

Source

pub fn scroll_to_top(&mut self)

Source

pub fn set_chat_max_scroll(&mut self, max_scroll: usize)

Source

pub fn scroll_tool_preview_up(&mut self, amount: usize)

Source

pub fn scroll_tool_preview_down(&mut self, amount: usize)

Source

pub fn reset_tool_preview_scroll(&mut self)

Source

pub fn set_tool_preview_max_scroll(&mut self, max_scroll: usize)

Source§

impl AppState

Source§

impl AppState

Source

pub fn settings_select_prev(&mut self)

Source

pub fn settings_select_next(&mut self)

Source

pub fn set_view_mode(&mut self, view_mode: ViewMode)

Source§

impl AppState

Source§

impl AppState

Source

pub fn queue_steering(&mut self, value: impl Into<String>)

Source

pub fn clear_steering(&mut self)

Source

pub fn steering_count(&self) -> usize

Source

pub fn steering_prompt_prefix(&self) -> Option<String>

Source§

impl AppState

Source§

impl AppState

Source

pub fn set_worker_bridge(&mut self, worker_id: String, worker_name: String)

Source

pub fn sync_worker_bridge_processing(&mut self, processing: bool)

Source

pub fn register_worker_agent(&mut self, name: String)

Source

pub fn push_recent_task(&mut self, task: String)

Source

pub fn enqueue_worker_task(&mut self, task: IncomingTask)

Source

pub fn dequeue_worker_task(&mut self) -> Option<IncomingTask>

Trait Implementations§

Source§

impl Default for AppState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ServiceExt for T

Source§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
Source§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
Source§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
Source§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,