Skip to main content

BackendCommand

Enum BackendCommand 

Source
pub enum BackendCommand {
Show 15 variants Authenticated { session_token: String, user_id: String, refresh_interval_secs: u32, protocol: Option<ProtocolAccept>, device_status: Option<DeviceStatus>, org_policies: Option<OrgPolicies>, }, SendInput { command_id: String, agent_id: String, content: String, }, SlashCommand { command_id: String, agent_id: String, command: String, args: Vec<String>, }, CancelOperation { command_id: String, agent_id: String, }, Subscribe { agent_id: String, }, Unsubscribe { agent_id: String, }, SpawnAgent { command_id: String, model: Option<String>, working_directory: Option<String>, }, RequestSync, Ping { timestamp: i64, }, Disconnect { reason: String, }, AuthenticationFailed { error: String, }, AttachmentUpload { command_id: String, agent_id: String, attachment_id: String, filename: String, mime_type: String, size: u64, compressed: bool, compression_algorithm: Option<CompressionAlgorithm>, chunks_total: u32, }, AttachmentChunk { attachment_id: String, chunk_index: u32, data: String, is_final: bool, }, PermissionResponse { request_id: String, approved: bool, remember_for_session: bool, always_allow: bool, }, AttachmentComplete { attachment_id: String, checksum: String, },
}
Expand description

Messages FROM Backend TO CLI

Variants§

§

Authenticated

Authenticated - here’s your session token and negotiated protocol

Fields

§session_token: String

Session token for subsequent requests.

§user_id: String

Authenticated user ID.

§refresh_interval_secs: u32

Interval in seconds between heartbeats.

§protocol: Option<ProtocolAccept>

Negotiated protocol (optional for backward compatibility)

§device_status: Option<DeviceStatus>

Device allowlist status returned by backend.

§org_policies: Option<OrgPolicies>

Organization-level policies (enforced client-side, verified server-side).

§

SendInput

Send input to an agent

Fields

§command_id: String

Unique command identifier.

§agent_id: String

Target agent ID.

§content: String

Input content to send.

§

SlashCommand

Execute slash command on agent

Fields

§command_id: String

Unique command identifier.

§agent_id: String

Target agent ID.

§command: String

Slash command name.

§args: Vec<String>

Command arguments.

§

CancelOperation

Cancel current operation

Fields

§command_id: String

Unique command identifier.

§agent_id: String

Target agent ID.

§

Subscribe

Subscribe to agent stream

Fields

§agent_id: String

Agent ID to subscribe to.

§

Unsubscribe

Unsubscribe from agent stream

Fields

§agent_id: String

Agent ID to unsubscribe from.

§

SpawnAgent

Spawn new agent

Fields

§command_id: String

Unique command identifier.

§model: Option<String>

Model to use for the new agent.

§working_directory: Option<String>

Working directory for the new agent.

§

RequestSync

Request full sync of all agents

§

Ping

Ping to check connection health

Fields

§timestamp: i64

Timestamp for round-trip measurement.

§

Disconnect

Disconnect (server closing)

Fields

§reason: String

Reason for disconnection.

§

AuthenticationFailed

Authentication failed

Fields

§error: String

Error message describing the failure.

§

AttachmentUpload

Start of an attachment upload

Fields

§command_id: String

Unique command identifier.

§agent_id: String

Target agent ID.

§attachment_id: String

Unique ID for this attachment

§filename: String

Original filename

§mime_type: String

MIME type (e.g., “text/plain”, “image/png”)

§size: u64

Total size in bytes (uncompressed)

§compressed: bool

Whether the data is compressed

§compression_algorithm: Option<CompressionAlgorithm>

Compression algorithm used (if compressed)

§chunks_total: u32

Total number of chunks

§

AttachmentChunk

A chunk of attachment data

Fields

§attachment_id: String

Attachment ID this chunk belongs to

§chunk_index: u32

Chunk index (0-based)

§data: String

Base64-encoded data

§is_final: bool

Whether this is the final chunk

§

PermissionResponse

Response to a permission request from the remote user

Fields

§request_id: String

The request_id from the original PermissionRequest.

§approved: bool

Whether the tool execution was approved.

§remember_for_session: bool

Remember this decision for the rest of the session.

§always_allow: bool

If true, always allow this tool (no future prompts).

§

AttachmentComplete

Attachment upload complete - verify checksum

Fields

§attachment_id: String

ID of the completed attachment.

§checksum: String

SHA-256 checksum of the complete (uncompressed) file

Trait Implementations§

Source§

impl Clone for BackendCommand

Source§

fn clone(&self) -> BackendCommand

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BackendCommand

Source§

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

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

impl<'de> Deserialize<'de> for BackendCommand

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 Serialize for BackendCommand

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

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,