Skip to main content

DeviceBound

Enum DeviceBound 

Source
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

Source

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.

Source

pub fn kind(&self) -> &'static str

Source

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.

Source

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.

Source

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.

Source

pub fn payload(&self) -> Value

The payload half of the envelope.

Trait Implementations§

Source§

impl Clone for DeviceBound

Source§

fn clone(&self) -> DeviceBound

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceBound

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DeviceBound

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for DeviceBound

Source§

fn eq(&self, other: &DeviceBound) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DeviceBound

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DeviceBound

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.