Skip to main content

ClientMessage

Enum ClientMessage 

Source
pub enum ClientMessage {
Show 16 variants CreateSession { cwd: PathBuf, location: Option<RemoteName>, model: Option<ModelRef>, keeps_session_alive: bool, }, Connect { root_thread_id: ThreadRef, thread_id: Option<ThreadRef>, keeps_session_alive: bool, }, UserInput { thread_id: ThreadRef, text: String, }, Disconnect, SoftDetach { root_thread_id: ThreadRef, }, ShutdownSession { root_thread_id: ThreadRef, }, ArchiveSession { root_thread_id: ThreadRef, }, SwitchModel { thread_id: ThreadRef, model: ModelRef, }, UserChoiceAnswered { choice_id: ChoiceId, selected: usize, }, TriggerCompaction { root_thread_id: ThreadRef, }, RequestMigrate { root_thread_id: ThreadRef, to: Option<RemoteName>, dest_cwd: PathBuf, }, Emigrate { root_thread_id: ThreadId, dest_rap_urls: HashMap<String, String>, }, EmigrateDone { root_thread_id: ThreadId, }, ImportSession { root_thread_id: ThreadId, cwd: PathBuf, session_data: String, }, BootRapServers { cwd: PathBuf, }, ListDirectory { path: String, on: Option<RemoteName>, },
}

Variants§

§

CreateSession

Create a new session with the given working directory.

Fields

§location: Option<RemoteName>

Optional target location. None means local. Otherwise, the name of a remote.

§model: Option<ModelRef>

Optional model to use for the new session. None uses the daemon’s default model.

§keeps_session_alive: bool

When false, this connection will not prevent the session from going idle and being shut down by the daemon. Defaults to true so that normal interactive clients keep sessions alive.

§

Connect

Connect to an existing session (optionally a specific thread).

Fields

§root_thread_id: ThreadRef
§thread_id: Option<ThreadRef>
§keeps_session_alive: bool

When false, this connection will not prevent the session from going idle and being shut down by the daemon. Defaults to true so that normal interactive clients keep sessions alive.

§

UserInput

Fields

§thread_id: ThreadRef
§text: String
§

Disconnect

Disconnect from the session while letting the agent continue to run in the background.

§

SoftDetach

Immediately attempt to detach. If the agent is idle, the daemon shuts down the session (closing the display channel). If not idle, the daemon responds with DisconnectNotIdle so the client can show a picker.

Fields

§root_thread_id: ThreadRef
§

ShutdownSession

Disconnects from the session and shuts down the agent so that it can only be woken bu new user inputs.

Fields

§root_thread_id: ThreadRef
§

ArchiveSession

Archive a session (shut it down and hide from the main list).

Fields

§root_thread_id: ThreadRef
§

SwitchModel

Switch the model used for future requests on a thread. thread_id may be any thread (root or subthread); the switch affects only that specific thread — it does not propagate to child threads. If a completion is currently in flight on the thread, it finishes on the old model and the switch applies to subsequent requests.

Fields

§thread_id: ThreadRef
§model: ModelRef
§

UserChoiceAnswered

Notify the daemon that a user choice was answered so it can be removed from the pending replay list.

Fields

§choice_id: ChoiceId
§selected: usize
§

TriggerCompaction

Trigger compaction for the given session.

Fields

§root_thread_id: ThreadRef
§

RequestMigrate

Request migration of a session to a different host.

Fields

§root_thread_id: ThreadRef
§to: Option<RemoteName>

None means local, Some(name) means a remote.

§dest_cwd: PathBuf
§

Emigrate

Daemon-to-daemon: request a session to emigrate. Includes destination RAP URLs so source RAP servers can migrate their state.

Fields

§root_thread_id: ThreadId
§dest_rap_urls: HashMap<String, String>

config_id → destination URL

§

EmigrateDone

Daemon-to-daemon: immigration is complete, source can clean up.

Fields

§root_thread_id: ThreadId
§

ImportSession

Daemon-to-daemon: import a serialized session at the given cwd.

Fields

§root_thread_id: ThreadId
§session_data: String
§

BootRapServers

Daemon-to-daemon: boot RAP servers at the given cwd and return their ports.

Fields

§

ListDirectory

Request directory listing for path completion.

Fields

§path: String
§on: Option<RemoteName>

Target remote name. None means list on the local filesystem.

Trait Implementations§

Source§

impl Clone for ClientMessage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientMessage

Source§

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

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

impl<'de> Deserialize<'de> for ClientMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ClientMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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: Sized + 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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