Skip to main content

App

Struct App 

Source
pub struct App {
Show 45 fields pub running: bool, pub messages: Vec<DisplayMessage>, pub editor: EditorState, pub cwd: PathBuf, pub agent_handle: Option<AgentHandle>, pub is_streaming: bool, pub message_queue: Vec<QueuedMessage>, pub session: SessionManager, pub config: Config, pub model_name: String, pub thinking_level: ThinkingLevel, pub context_window: u32, pub mode: UiMode, pub scroll_offset: usize, pub auto_scroll: bool, pub tools_expanded: bool, pub tool_focus: Option<usize>, pub tool_focus_pinned: bool, pub sidebar_auto_follow: bool, pub ctrl_c_count: u8, pub needs_redraw: bool, pub last_esc: Option<Instant>, pub tick: u64, pub ui_rx: Option<Receiver<UiRequest>>, pub ask_state: Option<AskState>, pub ask_reply: Option<AskReply>, pub workflow_mode: WorkflowMode, pub accumulated_usage: Usage, pub accumulated_cost: Cost, pub current_context_tokens: u32, pub status_items: HashMap<String, String>, pub widgets: HashMap<String, WidgetContent>, pub lua_runtime: Option<Arc<Mutex<LuaRuntime>>>, pub sidebar: Sidebar, pub active_pane: Pane, pub sidebar_list_rect: Option<Rect>, pub sidebar_detail_rect: Option<Rect>, pub chat_surface: Option<TextSurface>, pub sidebar_detail_surface: Option<TextSurface>, pub selection: Option<SelectionState>, pub drag_selection: Option<SelectablePane>, pub turn_tracker: TurnTracker, pub theme: Theme, pub highlighter: Highlighter, pub model_registry: ModelRegistry, /* private fields */
}

Fields§

§running: bool§messages: Vec<DisplayMessage>§editor: EditorState§cwd: PathBuf§agent_handle: Option<AgentHandle>§is_streaming: bool§message_queue: Vec<QueuedMessage>§session: SessionManager§config: Config§model_name: String§thinking_level: ThinkingLevel§context_window: u32§mode: UiMode§scroll_offset: usize§auto_scroll: bool§tools_expanded: bool§tool_focus: Option<usize>

Index into the flattened tool call list. None means inspector follows latest.

§tool_focus_pinned: bool

True once the user explicitly selects a tool; prevents new tools stealing focus.

§sidebar_auto_follow: bool

True while inspector should keep live output pinned to the bottom.

§ctrl_c_count: u8§needs_redraw: bool§last_esc: Option<Instant>§tick: u64§ui_rx: Option<Receiver<UiRequest>>§ask_state: Option<AskState>§ask_reply: Option<AskReply>§workflow_mode: WorkflowMode§accumulated_usage: Usage§accumulated_cost: Cost§current_context_tokens: u32

Last turn’s input tokens — best proxy for actual current context size.

§status_items: HashMap<String, String>§widgets: HashMap<String, WidgetContent>§lua_runtime: Option<Arc<Mutex<LuaRuntime>>>

Lua extension runtime (for command dispatch and hot-reload).

§sidebar: Sidebar§active_pane: Pane

Which pane has focus for scroll routing.

§sidebar_list_rect: Option<Rect>

Sidebar list area cached from last render (for click/scroll detection).

§sidebar_detail_rect: Option<Rect>

Sidebar detail area cached from last render (for click/scroll detection).

§chat_surface: Option<TextSurface>

Cached selectable chat surface from last render.

§sidebar_detail_surface: Option<TextSurface>

Cached selectable sidebar detail surface from last render.

§selection: Option<SelectionState>

Current app-native text selection.

§drag_selection: Option<SelectablePane>

Selection anchor while dragging with the mouse.

§turn_tracker: TurnTracker§theme: Theme§highlighter: Highlighter§model_registry: ModelRegistry

Implementations§

Source§

impl App

Source

pub fn new( config: Config, session: SessionManager, model_registry: ModelRegistry, cwd: PathBuf, ) -> Self

Source

pub fn load_session_messages(&mut self)

Load messages from the current session branch into display messages.

Source

pub async fn run( &mut self, terminal: &mut InteractiveTerminal, ) -> Result<(), Box<dyn Error>>

Source

pub fn terminal_title(&self) -> String

Source

pub fn handle_agent_event(&mut self, event: AgentEvent)

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

§

impl !UnwindSafe for App

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> 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, 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> MaybeSend for T
where T: Send,