Skip to main content

ClientMessage

Enum ClientMessage 

Source
pub enum ClientMessage {
Show 25 variants SessionCreate { id: String, name: String, workdir: String, provider_id: Option<String>, }, SessionList { id: String, }, ModelsList { id: String, provider: Option<String>, }, SessionAttach { id: String, session_id: String, }, SessionDetach { id: String, session_id: String, }, SessionSend { id: String, session_id: String, text: String, attachments: Option<Vec<Attachment>>, priority: Option<SendPriority>, }, SessionInterrupt { id: String, session_id: String, }, SessionApprove { id: String, session_id: String, approval_id: String, approved: bool, updated_input: Option<Value>, }, SessionUiResponse { id: String, session_id: String, request_id: String, value: Option<String>, confirmed: Option<bool>, cancelled: Option<bool>, }, SessionPartAction { id: String, session_id: String, message_id: String, action: String, data: Option<Value>, }, SessionCommands { id: String, session_id: String, }, SessionDestroy { id: String, session_id: String, }, SessionSetMode { id: String, session_id: String, mode: SessionMode, max_turns: Option<u32>, }, SessionPin { id: String, session_id: String, path: String, }, SessionUnpin { id: String, session_id: String, path: String, }, SessionRotate { id: String, session_id: String, }, SessionSearch { id: String, query: String, scope: Option<SearchScope>, workdir: Option<String>, limit: Option<u32>, }, SessionSetProvider { id: String, session_id: String, provider_id: String, }, SessionFork { id: String, session_id: String, name: Option<String>, provider_id: Option<String>, }, ScrollbackPage { id: String, session_id: String, before_message_id: String, max_bytes: Option<u64>, }, SessionSetModel { id: String, session_id: String, model: String, fallback_model: Option<Option<String>>, }, SessionRename { id: String, session_id: String, name: String, }, ClaudeConfig { id: String, session_id: String, }, SessionExport { id: String, session_id: String, include_memory: Option<bool>, include_pinned_files: Option<bool>, alias_override: Option<String>, to_file: Option<bool>, }, SessionImport { id: String, source: SessionImportSource, target_workdir: String, name_override: Option<String>, write_pinned_files: Option<bool>, },
}
Expand description

Tagged union of every message a client can send the daemon.

Variants§

§

SessionCreate

Fields

§name: String
§workdir: String
§provider_id: Option<String>

Backend for the session (one of AuthOkMsg.providers). The daemon fail-closes on unknown ids. Absent = daemon default.

§

SessionList

Fields

§

ModelsList

Request the backend’s selectable model catalog. Daemon answers with DaemonMessage::ModelsListResult.

Fields

§provider: Option<String>

Which backend’s catalog to fetch. Absent = the daemon’s default backend (older clients). Additive on the wire.

§

SessionAttach

Fields

§session_id: String
§

SessionDetach

Fields

§session_id: String
§

SessionSend

Fields

§session_id: String
§text: String
§attachments: Option<Vec<Attachment>>
§

SessionInterrupt

Fields

§session_id: String
§

SessionApprove

Fields

§session_id: String
§approval_id: String
§approved: bool
§updated_input: Option<Value>

Optional patch shallow-merged into the original tool input before the SDK runs the tool. Required for AskUserQuestion where it carries { "answers": { "<question>": "..." } }. Omitted for binary approvals (Bash, Edit, ExitPlanMode, …).

§

SessionUiResponse

Answer a provider-initiated dialog (DaemonMessage::SessionUiRequest). Exactly one payload field applies per method: value for select/input/editor, confirmed for confirm, cancelled: true to dismiss any method. First answer wins; a late answer gets not_found (the session.ui_resolved broadcast already dismissed it).

Fields

§session_id: String
§request_id: String
§confirmed: Option<bool>
§cancelled: Option<bool>
§

SessionPartAction

Activate a ContentPart::Button from a message’s parts[]. The daemon validates the button exists on the real message before forwarding to the provider.

Fields

§session_id: String
§message_id: String
§action: String
§

SessionCommands

Fetch the session’s provider-defined command catalog. Daemon answers with DaemonMessage::SessionCommandsResult. Gated on the daemon capability commands.dynamic.

Fields

§session_id: String
§

SessionDestroy

Fields

§session_id: String
§

SessionSetMode

Fields

§session_id: String
§max_turns: Option<u32>
§

SessionPin

Fields

§session_id: String
§path: String
§

SessionUnpin

Fields

§session_id: String
§path: String
§

SessionRotate

Fields

§session_id: String
§

SessionSearch

Fields

§query: String
§workdir: Option<String>
§limit: Option<u32>
§

SessionSetProvider

Switch a live session’s BACKEND (claude ⇄ pi …). The session id, scrollback, and transcript stay; the daemon carries the history to the new backend as a transcript and resets the model to its default. Rejected mid-turn and on unknown ids.

Fields

§session_id: String
§provider_id: String
§

SessionFork

Branch a session into an independent one, optionally onto a different backend. The fork is seeded with a deep copy of the parent’s canonical history + restamped scrollback; the parent is untouched. name absent ⇒ parent name + “ (fork)“; provider_id absent ⇒ parent’s backend. Fail-closed: foreign/unknown session ⇒ not_found, unknown provider ⇒ invalid_request.

Fields

§session_id: String
§provider_id: Option<String>
§

ScrollbackPage

Fetch history OLDER than a message the client already holds (scrollback.paging). Anchored by message id — ids survive daemon restarts, seq cursors don’t. Answered with scrollback.page.result.

Fields

§session_id: String
§before_message_id: String

The OLDEST message id the client currently holds.

§max_bytes: Option<u64>
§

SessionSetModel

Fields

§session_id: String
§model: String
§fallback_model: Option<Option<String>>
§

SessionRename

Fields

§session_id: String
§name: String
§

ClaudeConfig

Snapshot of Claude Code config (~/.claude/ + workdir .claude/) for the focused session — agents, skills, MCP servers, hooks. Daemon answers with ClaudeConfigResult.

Fields

§session_id: String
§

SessionExport

Export a session as a portable ShareBundle.

Fields

§session_id: String
§include_memory: Option<bool>
§include_pinned_files: Option<bool>
§alias_override: Option<String>
§to_file: Option<bool>
§

SessionImport

Import a session bundle. The TUI typically uses the file variant (operator pastes a path); the web pushes inline JSON.

Fields

§target_workdir: String
§name_override: Option<String>
§write_pinned_files: Option<bool>

Implementations§

Source§

impl ClientMessage

Source

pub fn request_id(&self) -> &str

Correlation id used to match a DaemonMessage::ResponseOk or DaemonMessage::ResponseError back to this request.

Trait Implementations§

Source§

impl Clone for ClientMessage

Source§

fn clone(&self) -> ClientMessage

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, 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> 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 = 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.