pub enum PlatformBound {
Show 29 variants
SessionHello(SessionHello),
SessionHeartbeat(Empty),
DeviceSnapshot(DeviceSnapshotResponse),
ServiceList(ServiceListResponse),
ServiceAction(ServiceActionResponse),
ServiceLogs(ServiceLogsResponse),
BundleList(BundleListResponse),
AgentProviders(AgentProvidersResponse),
AgentTurnAccepted(AgentTurnAccepted),
AgentTurnEvent(AgentEvent),
TerminalSpawned(TerminalSpawned),
TerminalSessions(TerminalSessionsResponse),
TerminalAttachAccepted(TerminalAttachAccepted),
TerminalOutput(TerminalOutput),
TerminalGeometry(TerminalGeometry),
TerminalAck(TerminalAck),
TerminalClosed(TerminalClosed),
TerminalKilled(TerminalKilled),
Repositories(RepositoriesResponse),
GithubRuns(GithubRunsResponse),
GithubRunJobs(GithubRunJobsResponse),
GithubPulls(GithubPullsResponse),
GithubPull(GithubPullResponse),
Linear(Box<LinearResponse>),
AgentUsage(AgentUsageResponse),
Errors(ErrorsResponse),
Timeline(TimelineResponse),
DeviceRetire(DeviceRetire),
CommandError(CommandErrorResponse),
}Expand description
One frame travelling daemon → platform.
Variants§
SessionHello(SessionHello)
The first frame on every socket. Until this arrives the connection has a credential but no identity, and routes nothing.
SessionHeartbeat(Empty)
Liveness, every super::limits::HEARTBEAT_INTERVAL. Missing them for
super::limits::PRESENCE_TIMEOUT marks the device offline, which
suspends routing rather than queueing.
DeviceSnapshot(DeviceSnapshotResponse)
ServiceList(ServiceListResponse)
ServiceAction(ServiceActionResponse)
ServiceLogs(ServiceLogsResponse)
BundleList(BundleListResponse)
AgentProviders(AgentProvidersResponse)
AgentTurnAccepted(AgentTurnAccepted)
The turn was accepted and has an id. Sent before any run event, so a phone always knows the run it is about to watch.
AgentTurnEvent(AgentEvent)
One sequenced event from a run.
TerminalSpawned(TerminalSpawned)
An agent terminal was started, and this is it. v2.
TerminalSessions(TerminalSessionsResponse)
The agent terminals that could be mirrored. v2.
TerminalAttachAccepted(TerminalAttachAccepted)
The mirror is open, and this is its id. v2.
TerminalOutput(TerminalOutput)
A coalesced chunk of what the terminal drew. v2.
TerminalGeometry(TerminalGeometry)
The mirrored session was resized on the machine. v2.
TerminalAck(TerminalAck)
A terminal command was carried out and had nothing to report. v2.
TerminalClosed(TerminalClosed)
The mirror ended. v2.
TerminalKilled(TerminalKilled)
The session was ended, and the agent in it stopped.
Repositories(RepositoriesResponse)
The repositories this machine has registered.
GithubRuns(GithubRunsResponse)
Recent GitHub Actions runs.
GithubRunJobs(GithubRunJobsResponse)
One run’s jobs.
GithubPulls(GithubPullsResponse)
Pull requests on the selected repository.
GithubPull(GithubPullResponse)
One pull request.
Linear(Box<LinearResponse>)
Boxed: the variant is ~1500 bytes against ~270 for the next largest, so
every PlatformBound on the socket would carry that width. Box is
transparent to serde, so the wire format is unchanged.
AgentUsage(AgentUsageResponse)
What the agents have spent.
Errors(ErrorsResponse)
The error inbox.
Timeline(TimelineResponse)
The runtime timeline.
DeviceRetire(DeviceRetire)
This machine is unpairing itself, and asks to be retired.
Device-initiated, and answers nothing. Every other frame in this union is either a reply or an event about work the platform asked for; this one is the machine saying it has thrown its own credential away and would like the row to go with it. Revocation stays the platform’s to perform and remains one-way — the device asks, it does not do.
Unsolicited rather than a reply to some device.retire.request, because
there is no version of this the platform initiates: the credential is
deleted on the machine by somebody standing at it.
Nothing depends on it arriving. An older platform does not know this name and refuses it, by the same fail-closed rule as any unknown frame, and the machine unpairs locally regardless. A retirement that did not land leaves exactly what leaving this frame out always left: a device row the owner can revoke from their phone.
CommandError(CommandErrorResponse)
A refusal. Always carries replyTo, because an error with nothing to
answer is a log line, not a frame.
Implementations§
Source§impl PlatformBound
impl PlatformBound
Sourcepub const KINDS: &'static [&'static str]
pub const KINDS: &'static [&'static str]
Every accepted type, in the order the union declares them.
pub fn kind(&self) -> &'static str
Sourcepub fn requires_reply_to(&self) -> bool
pub fn requires_reply_to(&self) -> bool
Whether this frame must name the request it answers.
Unsolicited frames — hello, heartbeat, run events — must not carry
replyTo, and answers must. Enforced rather than assumed, because a
response that arrives with no correlation is one the relay would have to
guess a destination for, and guessing means fanning a private answer to
the wrong browser.
Sourcepub fn parse(kind: &str, payload: Value) -> Result<Self, ProtocolError>
pub fn parse(kind: &str, payload: Value) -> Result<Self, ProtocolError>
Parse one frame’s type and payload. Same two-failure split as
super::device_bound::DeviceBound::parse.
Trait Implementations§
Source§impl Clone for PlatformBound
impl Clone for PlatformBound
Source§fn clone(&self) -> PlatformBound
fn clone(&self) -> PlatformBound
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more