Expand description
POST /agentmux/viewer/agents/:name/input: a paired device sends a
message to an agent, as the user (agentmux-mobile’s
SPEC_SEND_FROM_THE_PHONE_2026_10_13 §4, §5). The one viewer route that
changes anything, so it asks for more than the token:
- the owner’s grant for this device (Settings › Paired devices, Can send);
- a signature by the key the device made at pairing, over method, path,
time and body (
viewer::signing), fresh within a minute; - a
message_id, so a retry is delivered once (viewer::sends), and at most 30 sends a minute.
The agent gets a plain user turn, delivered the way a Swarm broadcast is:
a running agent reads it at its next step, mid-turn included; an idle or
stopped one starts a turn. The stored record says which device sent it
(viewer::origin), for the desktop pane’s note and the phone’s own
“Sending…” line.
Structs§
Constants§
- MAX_
INPUT_ 🔒BODY - The largest request body: a message at
MAX_MESSAGE_LENGTHbytes, JSON escaped, with room to spare.
Functions§
- check_
signed 🔒 - Whether
body, sent topath, is signed bykeywithin a minute of this computer’s clock: else the refusal’s reason and text. - deliver 🔒
- Deliver
texttoblock_idas the user’s turn, the way a Swarm broadcast is (app_api::fleet::deliver_broadcast_turn). - delivery_
refusal 🔒 - Why delivery failed, for the phone:
startingandneeds_loginpass;not_runningmeans nothing will take it until the agent is opened. - forgotten 🔒
- A message that was not delivered: nothing is stored for it, and its Audit row says it failed. (A delivered one’s
row is written when its line is stored,
audit::note_landed.) - handle_
viewer_ 🔒input POST /agentmux/viewer/agents/:name/input:{message, message_id}, signed;202 {message_id, state}. See the module comment and the spec’s §5.2.1 for every refusal.- refuse 🔒
- settle 🔒
- After a delivery from
devicetoagent: the send ledger learns how it went (a failed one may be retried); a delivered one shows the device as driving the agent on the host, and a failed one’s origin is forgotten.