pub struct TerminalFrame {Show 13 fields
pub sequence: u64,
pub size: TerminalSize,
pub cursor_row: u16,
pub cursor_column: u16,
pub contents: String,
pub formatted: Vec<u8>,
pub scrollback_formatted: Vec<Vec<u8>>,
pub alternate_screen: bool,
pub mouse_protocol_enabled: bool,
pub mouse_protocol_encoding: TerminalMouseProtocolEncoding,
pub produced_at_unix_ms: u64,
pub screen_state: PtyScreenState,
pub bracketed_paste: Option<bool>,
}Fields§
§sequence: u64§size: TerminalSize§cursor_row: u16§cursor_column: u16§contents: String§formatted: Vec<u8>§scrollback_formatted: Vec<Vec<u8>>§alternate_screen: bool§mouse_protocol_enabled: bool§mouse_protocol_encoding: TerminalMouseProtocolEncoding§produced_at_unix_ms: u64Unix-epoch milliseconds when this frame’s screen state was
materialized – the one instant PtyEventPublisher::snapshot turns
live terminal state into a frame. Every hop after that (the shell’s
ObservationEnvelope, the c2 relay, the harness’s terminal ring
buffer, the operator wire) carries this value through unchanged; none
of them may recompute, refresh, or zero it, because the whole point
of the field is to let something 200ms downstream in a ring buffer
still answer “how stale am I”. #[serde(default)] so a peer that
predates this field decodes it as 0 – “age unknown” – instead of a
fabricated timestamp. Diffing this value across two hosts also mixes
in their clock skew, not just transit time, so a consumer comparing
it against wall-clock time must say so rather than presenting the
gap as pure network/queue latency.
screen_state: PtyScreenStateThe screen classification at the instant THIS frame’s screen was
materialized – stamped once at the node from the same snapshot that
produced contents/formatted, and carried through every hop
unchanged like produced_at_unix_ms; no hop may recompute it against
its own (possibly staler) copy of the screen. #[serde(default)] so a
peer that predates this field decodes it as Unknown – “not
classified” – rather than a fabricated Ready; defaulting to
Unknown and not Ready is the entire point of that default.
bracketed_paste: Option<bool>Whether bracketed-paste mode was enabled on the PTY at the instant
THIS frame’s screen was materialized, read straight off the same
vt100::Screen snapshot that produced contents/formatted –
Some(true) means the terminal application has turned the mode on
(a paste is delivered to it as one bracketed block instead of
keystrokes), Some(false) means it explicitly has not, and None
means this frame predates the field or the value was never sampled.
None is not a claim that the mode is off; a caller that needs to
know must treat None the same as PtyScreenState::Unknown –
absence of information, not a fabricated default.
skip_serializing_if is load-bearing the same way it is on
HarnessRuntimeTerminalFrameV1::screen_state: the key must be
ABSENT from the JSON, not null, so a peer that predates this field
decodes it as None rather than a fabricated Some(false).