pub enum RuntimeEvent {
Wire {
agent_id: String,
outbound: bool,
lines: Vec<String>,
},
Inbound {
agent_id: String,
lines: Vec<String>,
},
Outbound {
agent_id: String,
line: String,
session_id: Option<String>,
sequence: Option<u64>,
},
Stderr {
agent_id: String,
line: String,
},
Exit {
agent_id: String,
},
RunStates {
sessions: Vec<SessionRunState>,
},
AcpNotification {
agent_id: String,
method: String,
params: Value,
session_id: Option<String>,
sequence: Option<u64>,
},
AcpAgentRequest {
agent_id: String,
id: Value,
method: String,
params: Value,
session_id: Option<String>,
sequence: Option<u64>,
},
}Variants§
Wire
stdio protocol diagnostics; params of outbound providers/set and auth/login are redacted. The engine receives the raw secret params; observers and replay records never see them.
Inbound
ACP frames output by the agent (agent -> app), batched every 16ms, each already carrying the
_alwithRuntime envelope.
Outbound
A frame the app sent to the agent. Frames entering the session journal carry session_id
and sequence (see AcpNotification).
Stderr
Exit
The agent process has been reaped. There is never a second process running under the same
agentId (start rejects while it is alive),
so this event is unambiguous: receiving it means “my agent is gone”.
RunStates
Fields
sessions: Vec<SessionRunState>AcpNotification
ACP notification from the agent (session/update etc.), already unframed by Runtime;
coexists with the same frame in inbound.
Frames that entered the session journal carry session_id and sequence (same number as
the same frame in sessionEvents):
the client uses it to detect missed frames (a sequence gap) and refill via sessionEvents.
Frames not journaled have neither field.
Fields
AcpAgentRequest
ACP request from the agent (session/request_permission, elicitation/create, fs/*…),
the app answers with acpRespond using the same id. Sequence fields as in
AcpNotification.