pub enum AgentEvent {
Ready {
capabilities: AgentCapabilities,
},
SessionStarted {
session: SessionId,
},
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>,
},
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
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.
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