pub enum Op {
Show 20 variants
StartSession(SessionRequest),
UpdateSession(SessionUpdate),
Interrupt,
UserInput(String),
ShellInput(String),
Steer(String),
ApprovalResponse {
turn_id: Id,
responses: Vec<ToolDecision>,
},
QuestionResponse {
turn_id: Id,
tool_use_id: String,
reply: QuestionReply,
},
SlashCommand {
name: String,
args: String,
},
ResumeSession {
session_id: Id,
unattended: bool,
tools: Option<Vec<String>>,
include_tools: Option<Vec<String>>,
exclude_tools: Option<Vec<String>>,
credential: Option<String>,
permission_mode: Option<PermissionMode>,
},
RegisterLocalProvider {
port: u16,
model: Option<ModelSpec>,
},
RestoreLocalProvider,
Compact {
instructions: Option<String>,
},
ContextReport,
RewindSession {
to: Id,
},
ForkSession {
at: Option<Id>,
},
Goal(GoalCommand),
AmbientPhrase {
draft: String,
req_id: u64,
},
AmbientSuggestion {
recent_user: String,
recent_agent: String,
req_id: u64,
},
Shutdown,
}Variants§
StartSession(SessionRequest)
Start a session from the request, replacing any running one; a start
that fails leaves the running session as it was. The new
conversation is empty unless the request asks for a rollover. There
is no restart op: for /clear, a client re-sends the request it
kept (optionally patched).
UpdateSession(SessionUpdate)
Interrupt
UserInput(String)
ShellInput(String)
Steer(String)
ApprovalResponse
QuestionResponse
Resolve the active turn’s pending question pause
(TurnPauseReason::Question). turn_id must be the paused turn and
tool_use_id must echo the pause’s; stale or mismatched responses are
dropped.
SlashCommand
ResumeSession
Continue a saved conversation from its persisted snapshot, system
instructions included. Everything the snapshot does not pin resolves
from the host’s current defaults, as for a fresh session.
unattended has the meaning of SessionRequest::unattended; absent
means false.
Fields
tools: Option<Vec<String>>Tool selection for this resume, with the same precedence as
SessionRequest::tools; absent uses current settings.
exclude_tools: Option<Vec<String>>Tools removed for this resume; wins over base and included tools.
credential: Option<String>A credential to pin for this resume, with the meaning of
SessionRequest::credential; absent uses configured precedence.
permission_mode: Option<PermissionMode>The permission mode for this resume, with the meaning of
SessionRequest::permission_mode; absent uses current settings.
RegisterLocalProvider
RestoreLocalProvider
Compact
Manually trigger conversation compaction on the active session.
instructions optionally steer the replacement summary — what to
emphasize or preserve. Ignored when the reduction needs no summary.
ContextReport
Request a per-category breakdown of the active session’s context-window
occupancy. Answered with Evt::ContextReport.
RewindSession
Rewind the active session’s conversation — model context and visible
history — to just before input to; that input and everything after
it are gone. to is a turn id as Evt::TurnStart reports it: for
a user’s input, the id of the op that submitted it. Answered with
Evt::SessionRewound. Refused with an Evt::Error, changing
nothing, while a turn runs or is queued, a goal is set, or
background jobs run, or when to cannot be restored: a turn from
before the session was resumed, or one whose earlier conversation a
compaction or provider switch has since rewritten. Starts no work
and undoes nothing outside the conversation.
ForkSession
Fork the active session’s conversation into a new saved session: the
conversation at input at, as Op::RewindSession to it would leave
it, or the current conversation when at is absent. The active
session must be idle and is left unchanged; the new session is not
started. Answered with Evt::SessionForked, or with an
Evt::Error that creates nothing.
Goal(GoalCommand)
Set, clear, or report a goal-driven execution loop on the active session. A set goal keeps the session working — re-running turns and judging the condition after each one — until it is met, judged unreachable, or cleared.
AmbientPhrase
Request a “thinking phrase” prediction for the in-progress draft,
outside the conversation. Answered with Evt::Ambient; req_id
lets the client discard a result a newer request superseded.
AmbientSuggestion
Request a next-prompt suggestion for input ghost text, outside the
conversation. The client supplies the last exchange and a monotonic
req_id to drop stale results. Answered with Evt::Ambient.