pub enum DeviceBound {
Show 28 variants
SessionWelcome(SessionWelcome),
SessionRevoke(SessionRevoke),
DeviceSnapshot(Empty),
ServiceList(Empty),
ServiceAction(ServiceActionRequest),
ServiceLogs(ServiceLogsRequest),
BundleList(Empty),
AgentProviders(Empty),
AgentTurnStart(AgentTurnStart),
AgentTurnCancel(AgentTurnCancel),
AgentApprovalResolve(AgentApprovalResolve),
TerminalSpawn(TerminalSpawnRequest),
TerminalShell(Empty),
TerminalSessions(Empty),
TerminalAttach(TerminalAttachRequest),
TerminalInput(TerminalInput),
TerminalResize(TerminalResize),
TerminalDetach(TerminalDetach),
TerminalKill(TerminalKillRequest),
Repositories(Empty),
GithubRuns(GithubRunsRequest),
GithubRunJobs(GithubRunJobsRequest),
GithubPulls(GithubPullsRequest),
GithubPull(GithubPullRequestRef),
Linear(LinearRequest),
AgentUsage(Empty),
Errors(ErrorsRequest),
Timeline(TimelineRequest),
}Expand description
One frame travelling platform → daemon.
Adjacently tagged, so type and payload in the envelope are the enum’s
own discriminant and content rather than a second hand-written mapping that
could drift from it.
Variants§
SessionWelcome(SessionWelcome)
The relay’s answer to the daemon’s hello: the negotiated version, and how much of the protocol this session may use.
SessionRevoke(SessionRevoke)
The device has been revoked. Advisory only — the socket closing is the revocation, and a daemon that ignores this must still be unable to act.
DeviceSnapshot(Empty)
Sanitized machine snapshot: name, platform, daemon version, presence.
ServiceList(Empty)
Registered service names, descriptions, kinds, ports and runtime states.
ServiceAction(ServiceActionRequest)
start, stop or restart on one exactly-named registered service.
ServiceLogs(ServiceLogsRequest)
Bounded, redacted recent logs for one exactly-named registered service.
BundleList(Empty)
Registered bundle names and states. Read-only: there is no bundle mutation in the v1 allowlist.
AgentProviders(Empty)
Which agent providers are installed, and what they can do.
AgentTurnStart(AgentTurnStart)
Start or resume one agent turn in the daemon’s selected workspace.
AgentTurnCancel(AgentTurnCancel)
Cancel an active turn.
AgentApprovalResolve(AgentApprovalResolve)
Allow or deny one pending mutating tool request.
TerminalSpawn(TerminalSpawnRequest)
Start a new agent terminal on the machine. v2.
TerminalShell(Empty)
Start a plain shell on the machine. v2.
Its own frame rather than a flag on the spawn above, so an older daemon that never heard of it cannot be handed one by accident — and so the capability that gates it gates exactly one thing.
TerminalSessions(Empty)
Which agent terminals are running and could be mirrored. v2.
TerminalAttach(TerminalAttachRequest)
Begin mirroring one agent terminal. v2.
TerminalInput(TerminalInput)
Keystrokes for a mirrored terminal. v2.
TerminalResize(TerminalResize)
The viewport changed size. v2.
TerminalDetach(TerminalDetach)
Stop mirroring. The PTY keeps running; only the mirror ends. v2.
TerminalKill(TerminalKillRequest)
End a session: the PTY closes and the agent in it stops.
The one thing on this surface that destroys work. Detaching leaves the agent running because a phone walking away should not stop it; this is the opposite, and it is a separate frame with a capability of its own so a machine can offer every other terminal command without offering this one. It names a session the machine reported, like an attach — never a pid, and never a signal to send.
Repositories(Empty)
The repositories this machine has registered, so a phone can say which one it is asking about.
GithubRuns(GithubRunsRequest)
Recent GitHub Actions runs for the selected repository.
GithubRunJobs(GithubRunJobsRequest)
The jobs inside one run — which step went red.
GithubPulls(GithubPullsRequest)
Pull requests on the selected repository.
GithubPull(GithubPullRequestRef)
One pull request by number.
Linear(LinearRequest)
AgentUsage(Empty)
What Claude and Codex have spent, and how full their rate-limit windows are.
Errors(ErrorsRequest)
The deduped error inbox.
Timeline(TimelineRequest)
What the runtime did, across every service.
Implementations§
Source§impl DeviceBound
impl DeviceBound
Sourcepub const KINDS: &'static [&'static str]
pub const KINDS: &'static [&'static str]
Every accepted type, in the order the union declares them.
This is the allowlist. A name absent from it is refused with
ErrorCode::UnknownCommand, whatever its payload looks like.
pub fn kind(&self) -> &'static str
Sourcepub fn mutating(&self) -> bool
pub fn mutating(&self) -> bool
Whether this frame can change the state of the user’s machine.
Drives two rules that must not be decided case by case at the call site:
a mutation is never automatically retried, and no mutation routes in
super::version::SessionMode::Degraded.
Sourcepub fn required_capability(&self) -> Option<&'static str>
pub fn required_capability(&self) -> Option<&'static str>
The capability a daemon must advertise for this frame to be routable, or
None for the control frames, which are part of every session.
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.
Two failures, kept apart on purpose: a name outside Self::KINDS is
ErrorCode::UnknownCommand, and a known name whose body does not fit
is ErrorCode::MalformedFrame. A phone told “unknown command” should
stop sending it; a phone told “malformed” has a bug to fix.
Trait Implementations§
Source§impl Clone for DeviceBound
impl Clone for DeviceBound
Source§fn clone(&self) -> DeviceBound
fn clone(&self) -> DeviceBound
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more