Skip to main content

ClientFrame

Enum ClientFrame 

Source
pub enum ClientFrame {
    Hello {
        pubkey: String,
        token: String,
        agent: String,
    },
    HelloInit {
        proto: u32,
        agent: String,
        pubkey: String,
        wid: String,
    },
    HelloProof {
        wid: String,
        proof: Vec<u8>,
    },
    Resume {
        pubkey: String,
        agent: String,
    },
    ResumeProof {
        envelope: SignedEnvelope,
    },
    Envelope {
        envelope: SignedEnvelope,
    },
    AudioStreamStart {
        sample_rate: u32,
    },
    AudioChunk {
        data: String,
    },
    AudioStreamEnd,
    ChannelQuery {
        op: String,
        channel_id: Option<String>,
        since_seq: Option<u64>,
    },
}
Expand description

Frames the phone sends to the Mac endpoint.

Variants§

§

Hello

Pairing / auth handshake. token is the one-time token from the QR code; pubkey is the phone’s multibase Ed25519 public key, which the Mac records as a paired device on success. agent is the canonical agent name the phone wants to talk to (e.g. "mur").

Fields

§pubkey: String
§token: String
§agent: String
§

HelloInit

Enrollment step 1 (proto ≥ 2): the phone announces intent WITHOUT sending the token. wid is the pairing-window id from the QR; pubkey is the phone’s Ed25519 key to enroll. The daemon replies ServerFrame::PairChallenge.

Fields

§proto: u32
§agent: String
§pubkey: String
§

HelloProof

Enrollment step 3: proof of token possession. proof is HMAC-SHA256(token, transcript) — the token itself is never transmitted.

Fields

§proof: Vec<u8>
§

Resume

Reconnect by paired KEY, no enrollment token (the steady-state auth). The phone announces its pubkey; the daemon replies ServerFrame::Challenge with a fresh per-connection nonce, which the phone signs back in a ClientFrame::ResumeProof. Distinct from Hello so single-use enrollment windows never gate reconnects.

Fields

§pubkey: String
§agent: String
§

ResumeProof

Proof for a Resume: a SignedEnvelope whose payload is exactly the challenge nonce bytes, signed by the device key. The daemon-issued nonce makes a captured proof non-replayable on a new connection.

Fields

§

Envelope

A signed A2A request destined for the agent (text-only path).

Fields

§

AudioStreamStart

Phone begins a voice utterance. The Mac clears its audio accumulator and prepares for incoming chunks at sample_rate Hz, mono f32.

Fields

§sample_rate: u32
§

AudioChunk

One chunk of raw PCM (f32 LE, sample_rate Hz mono, standard base64). Authenticated by the connection (paired at Hello); no per-chunk sig.

Fields

§data: String
§

AudioStreamEnd

Phone finished speaking. Mac should run STT on the accumulated audio, forward to the agent, and stream TTS audio back.

§

ChannelQuery

Pull channel data. op ∈ “list” | “events”. For “events”, channel_id is required and since_seq (inclusive) enables catch-up. Authenticated by the paired connection (like the audio frames).

Fields

§channel_id: Option<String>
§since_seq: Option<u64>

Trait Implementations§

Source§

impl Debug for ClientFrame

Source§

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

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

impl<'de> Deserialize<'de> for ClientFrame

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 ClientFrame

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> 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> 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> Same for T

Source§

type Output = T

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