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
SessionList
ModelsList
Request the backend’s selectable model catalog. Daemon answers with
DaemonMessage::ModelsListResult.
Fields
SessionAttach
SessionDetach
SessionSend
SessionInterrupt
SessionApprove
Fields
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
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.
SessionCommands
Fetch the session’s provider-defined command catalog. Daemon answers
with DaemonMessage::SessionCommandsResult.
Gated on the daemon capability commands.dynamic.
SessionDestroy
SessionSetMode
SessionPin
SessionUnpin
SessionRotate
SessionSearch
Fields
scope: Option<SearchScope>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.
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.
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
SessionSetModel
SessionRename
ClaudeConfig
Snapshot of Claude Code config (~/.claude/ + workdir .claude/)
for the focused session — agents, skills, MCP servers, hooks.
Daemon answers with ClaudeConfigResult.
SessionExport
Export a session as a portable ShareBundle.
Fields
SessionImport
Import a session bundle. The TUI typically uses the file
variant (operator pastes a path); the web pushes inline JSON.
Implementations§
Source§impl ClientMessage
impl ClientMessage
Sourcepub fn request_id(&self) -> &str
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
impl Clone for ClientMessage
Source§fn clone(&self) -> ClientMessage
fn clone(&self) -> ClientMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more