pub enum Response {
Show 22 variants
Sessions(Vec<TearSession>),
Session(TearSession),
Window {
session: SessionId,
window: TearWindow,
},
Pane(TearPane),
SessionId(SessionId),
WindowId(WindowId),
PaneId(PaneId),
PaneSnapshot(PaneSnapshot),
PaneBytes(Vec<u8>),
PaneClosed(PaneId),
ConfigYaml(String),
CastJson(String),
RecordingStatus {
enabled: bool,
events: u32,
},
Blocks(Vec<Block>),
Block(Block),
BlocksStatus {
total: u32,
in_progress: bool,
},
SubscriberCount(u32),
Freio {
sessions: Vec<(SessionId, Freio)>,
braked: Vec<PaneId>,
unbrakable: Vec<PaneId>,
},
ConfigChanged(String),
Hello(DaemonHello),
Ok,
Err(WireError),
}Expand description
Reply shape for every Request variant. The daemon always
emits exactly one Response per Request — there is no streaming
or multi-frame reply at this layer (subscription / event streams
will land in a separate Notification type in Phase 2).
Variants§
Sessions(Vec<TearSession>)
Session(TearSession)
Window
Pane(TearPane)
SessionId(SessionId)
WindowId(WindowId)
PaneId(PaneId)
PaneSnapshot(PaneSnapshot)
PaneBytes(Vec<u8>)
Pushed by the daemon after a successful Subscribe — one frame per PTY chunk. Bytes are exactly what the PTY master reader delivered; consumers feed them into their own vte parser (or into a tear-core PaneGrid client-side).
PaneClosed(PaneId)
Pushed by the daemon when the subscribed pane is destroyed. Subscribers should disconnect after observing this.
ConfigYaml(String)
Reply to Request::GetConfig — the daemon’s current live
TearConfig serialised as YAML (the same on-disk format
operators author at ~/.config/tear/tear.yaml). Wire stays
in tear-types; deserialization back to a typed TearConfig
happens in tear-client / consumer code which already
depends on tear-config. YAML over the wire (vs typed CBOR)
avoids the cycle tear-types ↔ tear-config and keeps the
daemon’s config inspectable with any text tool.
CastJson(String)
Reply to Request::ExportPaneRecording — asciinema v2
.cast (JSON-lines) string ready to write to disk or pipe
to asciinema play.
RecordingStatus
Reply to Request::PaneRecordingStatus.
Blocks(Vec<Block>)
Reply to Request::PaneBlocksList.
Block(Block)
Reply to Request::PaneBlockAt.
BlocksStatus
Reply to Request::PaneBlocksStatus.
SubscriberCount(u32)
Reply to Request::PaneSubscriberCount — number of
currently-attached byte-stream subscribers for that pane.
Includes the requester if it has an outstanding subscribe.
Freio
Reply to Request::SetFreio / Request::GetFreio.
Fields
unbrakable: Vec<PaneId>★ Panes the brake could NOT reach, because their provenance is unknown (a tmux-backend pane, a pane from a pre-yurai daemon).
Never elided and never empty-by-convention. An operator who
pressed a panic button must be told what it did not stop;
silence here would let them believe everything halted. This is
the honest cost of not braking Unknown panes — see
crate::session::TearSession::admits.
ConfigChanged(String)
Pushed by the daemon on every live-config replace, to
every connection that issued Request::SubscribeConfigChange.
Payload is the new config as YAML — same shape as
Response::ConfigYaml. The first frame after subscription
is Response::Ok; subsequent frames are ConfigChanged
until the connection is dropped.
Hello(DaemonHello)
Reply to Request::Hello — the daemon’s own version plus
the wire names of every capability it implements.
Adding a Response variant is safe in a way adding a
Request variant is not: only a new daemon emits this, and
only in reply to a probe an old client never sends. The
asymmetry is why the negotiation could be added at all
without a flag day.