Skip to main content

AgentCommand

Enum AgentCommand 

Source
pub enum AgentCommand {
Show 20 variants SendMessage { text: String, images: Vec<ImagePart>, image_markers: Vec<usize>, }, Cancel, ApproveTool, ApproveToolAlways, DenyTool, ReloadConfig(Config), ChangeDir(String), AppendInput(String), ClearConversation, SetMessages(Vec<Message>), SetPlanMode(bool), Compact { prompt: Option<String>, }, Remember { content: String, global: bool, }, Forget { keyword: String, }, ShowMemory, Background { task: String, }, RefreshContextStats, ReloadHooks, SyncMessages, Shutdown,
}
Expand description

Commands sent FROM the UI TO the agent loop.

Variants§

§

SendMessage

User sent a message (may include attached file content and/or images). image_markers[i] is the [Image #N] number printed for images[i] at paste time. Round-tripped through AgentEvent::RestorePendingImages so that on VL preprocess failure the TUI can re-attach images with their ORIGINAL markers — otherwise an UP-recalled [Image #5] text wouldn’t match a freshly-renumbered restored image. Empty when the caller has no images (slash commands, queued text from streaming, CLI single-shot).

Fields

§text: String
§images: Vec<ImagePart>
§image_markers: Vec<usize>
§

Cancel

Cancel current operation.

§

ApproveTool

Approve a pending tool call.

§

ApproveToolAlways

Approve and always allow this tool for the session.

§

DenyTool

Deny a pending tool call.

§

ReloadConfig(Config)

Reload config from TUI (the single source of truth for in-memory config, including ephemeral OAuth providers). Switches to the new default provider.

§

ChangeDir(String)

Change working directory.

§

AppendInput(String)

Append input during streaming — queued and injected before next LLM call.

§

ClearConversation

Clear conversation history.

§

SetMessages(Vec<Message>)

Set messages from a resumed session.

§

SetPlanMode(bool)

Set plan mode (read-only exploration, no edits).

§

Compact

Manually compact conversation history. prompt is accepted for forward-compat with an eventual LLM-backed summarize-with-instruction path; currently unused — this is the mechanical path only.

Fields

§prompt: Option<String>
§

Remember

Fields

§content: String
§global: bool
§

Forget

Fields

§keyword: String
§

ShowMemory

§

Background

Run a one-shot task in an isolated background context (read-only-ish tool subset, independent conversation, capped turns + timeout). Result is returned via AgentEvent::BackgroundComplete.

Fields

§task: String
§

RefreshContextStats

Recompute and re-emit a rich ContextStats snapshot. /context sends this before rendering so the user never sees a stale cache — the cache is only refreshed on LLM round-trips, so between turns (or after out-of-turn mutations like inject_post_compress_state) the snapshot can lag the actual conversation state.

§

ReloadHooks

Rebuild the hook executor from disk after a /plugin install|uninstall or other change to plugin state. Cheap (just re-reads JSON files); does NOT touch provider/model state, unlike ReloadConfig.

§

SyncMessages

Request a snapshot of the current conversation messages. The agent responds with AgentEvent::MessagesSync carrying conversation.messages. Used by the TUI before /bg to ensure the session has up-to-date message history even when a turn is still in progress (e.g. waiting for tool approval).

§

Shutdown

Shutdown the agent.

Trait Implementations§

Source§

impl Debug for AgentCommand

Source§

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

Formats the value using the given formatter. 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> 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<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