pub enum ClientEvent {
Runtime(RuntimeEvent),
Gap {
session_id: String,
from: u64,
to: u64,
},
Other(Value),
Closed {
reason: String,
},
}Expand description
An event frame coming from Runtime. Protocol events are decoded as RuntimeEvent; host
extension events go to Other.
Delivery promise: every journaled frame of a session (outbound / acpNotification /
acpAgentRequest carrying session_id + sequence)
is delivered to subscribers in journal order, exactly once. Runtime drops events and sends
lagged when the stdio host cannot keep up,
and a slow ws connection is disconnected; here gaps are detected by sequence number, refilled
first via sessionEvents, and only then are later frames delivered.
A span that is gone from the journal too is reported as Gap, never pretending to be
continuous.
Variants§
Runtime(RuntimeEvent)
Gap
A span that cannot be refilled: the journal has lost from..=to and nothing of it was
delivered; the app should reload this session.
Other(Value)
Closed
Read side ended: the peer exited or stdin hit EOF. Afterwards every request errors; a
module receiving this should wrap up.