Skip to main content

Session

Struct Session 

Source
pub struct Session { /* private fields */ }

Implementations§

Source§

impl Session

Source§

impl Session

Source

pub fn handle_event( &mut self, event: CrosstermEvent, events: &UnboundedSender<InlineEvent>, callback: Option<&(dyn Fn(&InlineEvent) + Send + Sync + 'static)>, )

Source§

impl Session

Source

pub fn new( theme: InlineTheme, placeholder: Option<String>, view_rows: u16, ) -> Self

Source

pub fn new_with_logs( theme: InlineTheme, placeholder: Option<String>, view_rows: u16, show_logs: bool, appearance: Option<AppearanceConfig>, slash_commands: Vec<SlashCommandItem>, app_name: String, ) -> Self

Source§

impl Session

Source

pub fn cursor(&self) -> usize

Source

pub fn set_input(&mut self, text: impl Into<String>)

Source

pub fn set_cursor(&mut self, pos: usize)

Source

pub fn process_key(&mut self, key: KeyEvent) -> Option<InlineEvent>

Source

pub fn handle_command(&mut self, command: InlineCommand)

Source§

impl Session

Source

pub fn apply_view_rows(&mut self, rows: u16)

Source§

impl Session

Source

pub fn set_log_receiver(&mut self, receiver: UnboundedReceiver<LogEntry>)

Source§

impl Session

Source

pub fn render(&mut self, frame: &mut Frame<'_>)

Source§

impl Session

Source

pub fn scroll_offset(&self) -> usize

Source§

impl Session

Source§

impl Session

Source

pub fn build_input_widget_data( &self, width: u16, height: u16, ) -> InputWidgetData

Build input render data for external widgets

Source

pub fn build_input_status_widget_data( &self, width: u16, ) -> Option<Vec<Span<'static>>>

Build input status line for external widgets

Source§

impl Session

Source

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

Insert pasted text without enforcing the inline newline cap.

This preserves the full block (including large multi-line pastes) so the agent receives the exact content instead of dropping line breaks after hitting the interactive input’s visual limit.

Source

pub fn history_position(&self) -> Option<(usize, usize)>

Returns the current history position for status bar display Returns (current_index, total_entries) or None if not navigating history

Source§

impl Session

Source

pub fn check_file_reference_trigger(&mut self)

Check if the current input should trigger the file palette

Source§

impl Session

Source

pub fn should_exit(&self) -> bool

Check if the session should exit

Source

pub fn request_exit(&mut self)

Request session exit

Source

pub fn take_redraw(&mut self) -> bool

Take the redraw flag and reset it

Returns true if a redraw was needed

Source

pub fn mark_dirty(&mut self)

Mark the session as needing a redraw

Source

pub fn invalidate_header_cache(&mut self)

Invalidate only the header cache (e.g. when provider/model changes)

Source

pub fn invalidate_sidebar_cache(&mut self)

Invalidate only the sidebar cache (e.g. when queue changes)

Source

pub fn handle_tick(&mut self)

Advance animation state on tick and request redraw when a frame changes.

Source

pub fn scroll_line_up(&mut self)

Scroll operations

Note: The scroll offset model is inverted for chat-style display: offset=0 shows the bottom (newest content), offset=max shows the top. Therefore “scroll up” (show older content) increases the offset, and “scroll down” (show newer content) decreases it.

Source

pub fn scroll_line_down(&mut self)

Source§

impl Session

Source

pub fn set_workspace_root(&mut self, workspace_root: Option<PathBuf>)

Set the workspace root path for dynamic title generation

Source

pub fn update_terminal_title(&mut self)

Update the terminal title if it has changed.

Source

pub fn clear_terminal_title(&mut self)

Clear terminal title (reset to default)

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> 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