pub enum AgentEvent {
Show 13 variants
Ready {
capabilities: AgentCapabilities,
},
SessionStarted {
session: SessionId,
},
ModesAvailable {
session: SessionId,
current: String,
available: Vec<SessionMode>,
},
ModeChanged {
session: SessionId,
mode: String,
},
MessageChunk {
session: SessionId,
text: String,
},
ThoughtChunk {
session: SessionId,
text: String,
},
ReadFileRequested {
session: SessionId,
request: ReadRequestId,
path: PathBuf,
},
ProposedEdit {
session: SessionId,
proposal: ProposalId,
path: PathBuf,
old_text: Option<String>,
new_text: String,
},
PermissionRequested {
session: SessionId,
request: PermissionRequestId,
summary: String,
command: Vec<String>,
terminal_spec: Option<TerminalSpec>,
edit: Option<ProposedEditDiff>,
},
TerminalRequest {
session: SessionId,
request: AgentTerminalRequestId,
operation: AgentTerminalOperation,
},
TerminalAttached {
session: SessionId,
terminal: TerminalId,
},
TurnEnded {
session: SessionId,
reason: StopReason,
},
Failed {
session: SessionId,
message: String,
},
}Expand description
What comes back from the agent.
Exhaustive on purpose, like FsEvent: adding a variant should break every loop that
has not decided what to do about it.
Variants§
Ready
The handshake completed. Emitted once, before any session, so it carries no
SessionId — capabilities belong to the agent connection, not to a session.
Fields
capabilities: AgentCapabilitiesSessionStarted
ModesAvailable
What the agent will let this session do, and which of those it started in (ADR-0015). Absent for agents that do not offer modes, which is most of them.
ModeChanged
The agent reports the session is now in mode. The agent’s account is the truth,
so this is what updates the client — not the response to our own request.
MessageChunk
Streamed assistant text.
ThoughtChunk
Streamed reasoning, rendered dimmer than the answer.
ReadFileRequested
The agent asked us for a file. We answer from the buffer if it is open.
ProposedEdit
A proposed edit, as whole-file before/after text — the shape ACP actually uses.
old_text is None when the agent is creating a new file.
Fields
proposal: ProposalIdPermissionRequested
A tool call awaiting approval. command is an argv array — we never interpolate
agent output into a shell string (ARCHITECTURE.md §9.4, §11).
Fields
request: PermissionRequestIdterminal_spec: Option<TerminalSpec>Present only when raw ACP input supplied an exact structured command.
edit: Option<ProposedEditDiff>The edit this permission would authorise, when the agent described one.
An agent that asks before editing is an agent whose edits can be reviewed, so this is what turns an “allow?” prompt into a diff (ADR-0016 §1).
TerminalRequest
TerminalAttached
TurnEnded
Failed
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more