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").
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.
HelloProof
Enrollment step 3: proof of token possession. proof is
HMAC-SHA256(token, transcript) — the token itself is never transmitted.
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.
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: SignedEnvelopeEnvelope
A signed A2A request destined for the agent (text-only path).
Fields
envelope: SignedEnvelopeAudioStreamStart
Phone begins a voice utterance. The Mac clears its audio accumulator and
prepares for incoming chunks at sample_rate Hz, mono f32.
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.
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).