App

Struct App 

Source
pub struct App {
Show 40 fields pub state: AppState, pub textarea: TextArea<'static>, pub input: String, pub messages: Vec<String>, pub logs: Vec<String>, pub show_logs: bool, pub selected_model: usize, pub available_models: Vec<ModelConfig>, pub error_message: Option<String>, pub debug_messages: bool, pub message_scroll: ScrollState, pub log_scroll: ScrollState, pub scroll_position: usize, pub last_query_time: Instant, pub last_message_time: Instant, pub use_agent: bool, pub agent: Option<Agent>, pub tokio_runtime: Option<Runtime>, pub agent_progress_rx: Option<Receiver<String>>, pub api_key: Option<String>, pub current_working_dir: Option<String>, pub command_mode: bool, pub available_commands: Vec<SpecialCommand>, pub selected_command: usize, pub show_command_menu: bool, pub permission_required: bool, pub pending_tool: Option<PendingToolExecution>, pub tool_permission_status: ToolPermissionStatus, pub tool_execution_in_progress: bool, pub show_intermediate_steps: bool, pub show_shortcuts_hint: bool, pub show_detailed_shortcuts: bool, pub cursor_position: usize, pub tasks: Vec<Task>, pub current_task_id: Option<String>, pub task_scroll: ScrollState, pub task_scroll_position: usize, pub conversation_summaries: Vec<ConversationSummary>, pub session_manager: Option<SessionManager>, pub session_id: String,
}

Fields§

§state: AppState§textarea: TextArea<'static>§input: String§messages: Vec<String>§logs: Vec<String>§show_logs: bool§selected_model: usize§available_models: Vec<ModelConfig>§error_message: Option<String>§debug_messages: bool§message_scroll: ScrollState§log_scroll: ScrollState§scroll_position: usize§last_query_time: Instant§last_message_time: Instant§use_agent: bool§agent: Option<Agent>§tokio_runtime: Option<Runtime>§agent_progress_rx: Option<Receiver<String>>§api_key: Option<String>§current_working_dir: Option<String>§command_mode: bool§available_commands: Vec<SpecialCommand>§selected_command: usize§show_command_menu: bool§permission_required: bool§pending_tool: Option<PendingToolExecution>§tool_permission_status: ToolPermissionStatus§tool_execution_in_progress: bool§show_intermediate_steps: bool§show_shortcuts_hint: bool§show_detailed_shortcuts: bool§cursor_position: usize§tasks: Vec<Task>§current_task_id: Option<String>§task_scroll: ScrollState§task_scroll_position: usize§conversation_summaries: Vec<ConversationSummary>§session_manager: Option<SessionManager>§session_id: String

Implementations§

Source§

impl App

Source

pub fn new() -> Self

Source§

impl App

Source

pub fn create_task(&mut self, description: &str) -> String

Create a new task and set it as current

Source

pub fn current_task(&self) -> Option<&Task>

Get the current task if any

Source

pub fn current_task_mut(&mut self) -> Option<&mut Task>

Get the current task as mutable if any

Source

pub fn add_tool_use(&mut self)

Add a tool use to the current task

Source

pub fn add_input_tokens(&mut self, tokens: u32)

Add input tokens to the current task

Source

pub fn complete_current_task(&mut self, tokens: u32)

Complete the current task

Source

pub fn fail_current_task(&mut self, error: &str)

Mark the current task as failed

Trait Implementations§

Source§

impl AgentManager for App

Source§

fn setup_agent(&mut self) -> Result<()>

Source§

fn query_model(&mut self, prompt: &str) -> Result<String>

Source§

fn query_with_agent(&mut self, prompt: &str) -> Result<String>

Source§

impl CommandHandler for App

Source§

impl ContextCompressor for App

Source§

fn compress_context(&mut self) -> Result<()>

Generate a summary of the conversation history
Source§

fn should_compress(&self) -> bool

Check if conversation should be summarized based on thresholds
Source§

fn conversation_char_count(&self) -> usize

Get the total character count of conversation history
Source§

fn summary_count(&self) -> usize

Get summaries count
Source§

fn clear_history(&mut self)

Clear all summaries and history
Source§

fn display_to_session_messages( &self, display_messages: &[String], ) -> Vec<Message>

Convert display messages to session messages
Source§

fn session_to_display_messages( &self, session_messages: &[Message], ) -> Vec<String>

Convert session messages to display messages
Source§

impl Default for App

Source§

fn default() -> Self

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

impl ErrorHandler for App

Source§

fn handle_error(&mut self, message: String)

Source§

impl Logger for App

Source§

fn log(&mut self, message: &str, args: &[&str])

Log a message with optional formatting arguments
Source§

fn toggle_log_view(&mut self)

Toggle between showing logs and normal output
Source§

fn get_log_directory(&self) -> PathBuf

Get the log directory path
Source§

fn get_log_file_path(&self) -> PathBuf

Get the log file path for the current session
Source§

fn write_log_to_file(&self, message: &str) -> Result<()>

Write a log message to file
Source§

impl ModelManager for App

Source§

fn current_model(&self) -> &ModelConfig

Source§

fn select_next_model(&mut self)

Source§

fn select_prev_model(&mut self)

Source§

fn get_agent_model(&self) -> Option<String>

Source§

fn load_model(&mut self, _model_path: &Path) -> Result<()>

Source§

fn setup_models(&mut self, tx: Sender<String>) -> Result<()>

Source§

impl PermissionHandler for App

Source§

fn requires_permission(&self, tool_name: &str) -> bool

Source§

fn request_tool_permission( &mut self, tool_name: &str, args: &str, ) -> ToolPermissionStatus

Source§

fn handle_permission_response(&mut self, granted: bool)

Source§

fn extract_argument(&self, args: &str, arg_name: &str) -> Option<String>

Source§

fn requires_permission_check(&self) -> bool

Source§

impl Scrollable for App

Source§

fn message_scroll_state(&mut self) -> &mut ScrollState

Get a mutable reference to the message scroll state
Source§

fn task_scroll_state(&mut self) -> &mut ScrollState

Get a mutable reference to the task scroll state
Source§

fn scroll_up(&mut self, amount: usize)

Scroll message view up by amount
Source§

fn scroll_down(&mut self, amount: usize)

Scroll message view down by amount
Source§

fn auto_scroll_to_bottom(&mut self)

Auto scroll messages to bottom
Source§

fn scroll_tasks_up(&mut self, amount: usize)

Scroll task list up by amount
Source§

fn scroll_tasks_down(&mut self, amount: usize)

Scroll task list down by amount

Auto Trait Implementations§

§

impl !Freeze for App

§

impl !RefUnwindSafe for App

§

impl Send for App

§

impl !Sync for App

§

impl Unpin 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, 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