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,
},
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: set
fields are pinned, unset fields resolve to the host’s defaults. There
is no separate restart op — a client keeps the request it sent and
re-sends it (optionally patched) for /clear semantics.
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. reply is what the user did: answered, skipped, or asked to
talk instead (QuestionReply).
SlashCommand
ResumeSession
Continue a saved conversation from its persisted snapshot: what the
host persisted is restored — the system instructions included — and
everything the snapshot does not pin resolves like a fresh session
from the host’s current defaults.
unattended is the resuming client’s declaration, with the meaning
of SessionRequest::unattended; absent means false.
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 — its model context and its
visible history — to input to: how it stood just before that input
was applied, the input and everything after it 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 an ad-hoc “thinking phrase” prediction for the in-progress
draft. Runs off the conversation critical path on a cheap model and
answers with Evt::Ambient. req_id lets the client discard stale
results when a newer request supersedes this one.
AmbientSuggestion
Request an ad-hoc next-prompt suggestion from the last exchange, shown as
input ghost text. Like Op::AmbientPhrase it runs off the critical
path on a cheap model and answers with Evt::Ambient. The client carries
the context (so this stays a client-only feature — headless never fires
it) and a monotonic req_id to drop stale results.