App

Struct App 

Source
pub struct App {
    pub mode: AppMode,
    pub data: AppData,
    pub actions: Actions,
}
Expand description

Main application state

Fields§

§mode: AppMode

Current application mode (typed).

§data: AppData

Persistent application data.

§actions: Actions

Action handler context.

Implementations§

Source§

impl App

Source

pub fn start_command_palette(&mut self)

Enter slash command palette mode and pre-fill the leading /

Source

pub fn filtered_slash_commands(&self) -> Vec<SlashCommand>

Return the list of slash commands filtered by the current palette input.

Source

pub fn submit_slash_command_palette(&mut self)

Execute the currently-typed slash command (called when user presses Enter).

Source

pub fn run_slash_command(&mut self, cmd: SlashCommand)

Execute a resolved slash command.

Source

pub fn select_next_slash_command(&mut self)

Select the next slash command in the filtered list.

Source

pub fn select_prev_slash_command(&mut self)

Select the previous slash command in the filtered list.

Source

pub const fn reset_slash_command_selection(&mut self)

Reset the slash command selection back to the first entry.

Source

pub fn selected_slash_command(&self) -> Option<SlashCommand>

Get the currently selected slash command (based on filter + selection index).

Source

pub fn confirm_slash_command_selection(&mut self)

Run the currently highlighted command in the palette (fallbacks to parsing the input).

Source§

impl App

Source

pub fn start_push(&mut self, agent_id: Uuid, branch_name: String)

Start the push flow - show confirmation dialog

Source

pub fn start_rename( &mut self, agent_id: Uuid, current_name: String, is_root: bool, )

Start the rename flow

For root agents (is_root=true): Renames branch + agent title + session For sub-agents (is_root=false): Renames agent title + window only

Source

pub fn confirm_rename_branch(&mut self) -> bool

Confirm the branch rename (update branch_name from input_buffer)

Source

pub fn start_open_pr( &mut self, agent_id: Uuid, branch_name: String, base_branch: String, has_unpushed: bool, )

Start the open PR flow - may show push confirmation first

Source

pub fn clear_git_op_state(&mut self)

Clear all git operation state

Source

pub fn start_rebase( &mut self, agent_id: Uuid, current_branch: String, branches: Vec<BranchInfo>, )

Start the rebase flow - show branch selector to choose target branch

Source

pub fn start_merge( &mut self, agent_id: Uuid, current_branch: String, branches: Vec<BranchInfo>, )

Start the merge flow - show branch selector to choose source branch

Source

pub fn confirm_rebase_merge_branch(&mut self) -> bool

Confirm branch selection for rebase/merge and set target branch

Source§

impl App

Source

pub fn apply_mode(&mut self, next: AppMode)

Apply a mode transition to the application, running any required entry/exit hooks.

Source

pub fn enter_mode(&mut self, mode: AppMode)

Enter a new application mode.

Source

pub fn exit_mode(&mut self)

Exit the current mode and return to normal mode.

Source

pub fn set_error(&mut self, message: impl Into<String>)

Set an error message and show the error modal.

Source

pub fn clear_error(&mut self)

Clear the current error message.

Source

pub fn dismiss_error(&mut self)

Dismiss the error modal and clear the stored error message.

Source

pub fn set_status(&mut self, message: impl Into<String>)

Set a status message to display.

Source

pub fn clear_status(&mut self)

Clear the current status message.

Source

pub fn show_success(&mut self, message: impl Into<String>)

Show success modal with message.

Source

pub fn dismiss_success(&mut self)

Dismiss success modal.

Source

pub const fn should_show_keyboard_remap_prompt(&self) -> bool

Check if keyboard remap prompt should be shown at startup Returns true if terminal doesn’t support enhancement AND user hasn’t been asked yet

Source

pub fn show_keyboard_remap_prompt(&mut self)

Show the keyboard remap prompt modal

Source

pub fn accept_keyboard_remap(&mut self)

Accept the keyboard remap (Ctrl+M -> Ctrl+N)

Source

pub fn decline_keyboard_remap(&mut self)

Decline the keyboard remap

Source

pub const fn is_merge_key_remapped(&self) -> bool

Check if merge key should use Ctrl+N instead of Ctrl+M

Source§

impl App

Source

pub fn start_model_selector(&mut self)

Enter the /agents selector modal.

Source

pub fn filtered_model_programs(&self) -> Vec<AgentProgram>

Return the filtered model/program list for the selector UI.

Source

pub fn select_next_model_program(&mut self)

Select next model/program in filtered list.

Source

pub fn select_prev_model_program(&mut self)

Select previous model/program in filtered list.

Source

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

Handle typing in the /agents filter.

Source

pub fn handle_model_filter_backspace(&mut self)

Handle backspace in the /agents filter.

Source

pub fn selected_model_program(&self) -> Option<AgentProgram>

Get the currently highlighted model/program (in /agents).

Source

pub fn confirm_model_program_selection(&mut self)

Confirm the current /agents selection.

Source

pub fn start_custom_agent_command_prompt(&mut self)

Open the custom agent command prompt (used when selecting custom).

Source

pub fn set_agent_program_and_save(&mut self, program: AgentProgram)

Set the agent program and persist settings to disk.

Source

pub fn set_custom_agent_command_and_save(&mut self, command: String)

Update the custom agent command, select custom, and persist settings.

Source

pub fn agent_spawn_command(&self) -> String

The base command used when spawning new agents (based on user settings).

Source§

impl App

Source

pub fn selected_agent(&self) -> Option<&Agent>

Get the currently selected agent (from visible agents list)

Source

pub fn selected_agent_mut(&mut self) -> Option<&mut Agent>

Get a mutable reference to the currently selected agent

Source

pub fn select_next(&mut self)

Move selection to the next agent (in visible list)

Source

pub fn select_prev(&mut self)

Move selection to the previous agent (in visible list)

Source

pub fn switch_tab(&mut self)

Switch between detail pane tabs (forward)

Source

pub fn validate_selection(&mut self)

Ensure the selection index is valid for the current visible agents

Source

pub fn ensure_agent_list_scroll(&mut self)

Ensure the agent list scroll offset keeps the selected agent visible.

Source

pub fn toggle_selected_collapse(&mut self)

Toggle collapse state of the selected agent

Source

pub fn selected_has_children(&self) -> bool

Check if selected agent has children (for UI)

Source

pub fn selected_depth(&self) -> usize

Get depth of the selected agent (for UI)

Source

pub fn has_running_agents(&self) -> bool

Check if there are any running agents

Source

pub fn running_agent_count(&self) -> usize

Get the count of currently running agents

Source§

impl App

Source

pub fn start_review(&mut self, branches: Vec<BranchInfo>)

Start the review flow - show info if no agent selected, otherwise proceed to count

Source

pub fn show_review_info(&mut self)

Show the review info modal (when no agent is selected)

Source

pub fn proceed_to_branch_selector(&mut self)

Proceed from review count to branch selector

Source

pub fn filtered_review_branches(&self) -> Vec<&BranchInfo>

Get filtered branches based on current filter

Source

pub fn select_next_branch(&mut self)

Select next branch in filtered list

Source

pub fn select_prev_branch(&mut self)

Select previous branch in filtered list

Source

pub fn selected_branch(&self) -> Option<&BranchInfo>

Get the currently selected branch

Source

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

Handle character input in branch filter

Source

pub fn handle_branch_filter_backspace(&mut self)

Handle backspace in branch filter

Source

pub fn confirm_branch_selection(&mut self) -> bool

Confirm branch selection and set review_base_branch

Source

pub fn clear_review_state(&mut self)

Clear all review-related state

Source§

impl App

Source

pub fn reset_scroll(&mut self)

Reset scroll positions for both panes Preview is pinned to bottom (with follow enabled), Diff is pinned to top

Source

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

Scroll up in the active pane by the given amount

Source

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

Scroll down in the active pane by the given amount

Source

pub fn scroll_to_top(&mut self)

Scroll to the top of the active pane

Source

pub const fn scroll_to_bottom( &mut self, content_lines: usize, visible_lines: usize, )

Scroll to the bottom of the active pane

Source

pub const fn set_preview_dimensions(&mut self, width: u16, height: u16)

Set the preview pane dimensions for mux window sizing

Source§

impl App

Source

pub const fn increment_child_count(&mut self)

Increment child count (for ChildCount mode)

Source

pub const fn decrement_child_count(&mut self)

Decrement child count (minimum 1)

Source

pub fn start_spawning_under(&mut self, parent_id: Uuid)

Start spawning children under a specific agent

Source

pub fn start_spawning_root(&mut self)

Start spawning a new root agent with children (no plan prompt)

Source

pub fn start_planning_swarm(&mut self)

Start spawning a planning swarm under the selected agent

Source

pub fn proceed_to_child_prompt(&mut self)

Proceed from ChildCount to ChildPrompt mode

Source

pub fn next_terminal_name(&mut self) -> String

Get the next terminal name and increment the counter

Source

pub fn start_terminal_prompt(&mut self)

Start prompting for a terminal startup command

Source§

impl App

Source

pub const fn is_text_input_mode(&self) -> bool

Check if the current mode accepts text input

This is used to consolidate the mode check that was previously duplicated across handle_char, handle_backspace, and handle_delete.

Source

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

Handle a character input in text input modes

Source

pub fn handle_backspace(&mut self)

Handle backspace in text input modes

Source

pub fn handle_delete(&mut self)

Handle delete key in text input modes (delete char at cursor)

Source

pub fn input_cursor_left(&mut self)

Move cursor left in text input

Source

pub fn input_cursor_right(&mut self)

Move cursor right in text input

Source

pub fn input_cursor_up(&mut self)

Move cursor up one line in text input

Source

pub fn input_cursor_down(&mut self)

Move cursor down one line in text input

Source

pub fn input_cursor_home(&mut self)

Move cursor to start of line

Source

pub fn input_cursor_end(&mut self)

Move cursor to end of line

Source§

impl App

Source

pub const fn new( config: Config, storage: Storage, settings: Settings, keyboard_enhancement_supported: bool, ) -> Self

Create a new application with the given config, storage, and settings

Trait Implementations§

Source§

impl Debug for App

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for App

Source§

fn default() -> Self

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

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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, 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<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