Expand description
The viewer: a read-only window onto this channel’s agents for a paired device (agentmux-mobile’s SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §4, §5, §13.2, §13.3).
What it adds next to the LAN routes, and why each part exists:
- a credential that is not public: a per-device viewer token, handed out
once against a pairing code shown on this screen, stored hashed, and
revocable (
pairing,storage::viewer_devices). Never thelan_key(anyone on the network has it) and never the instanceauth_key. - encryption on the wire: the viewer routes are served only on a TLS
listener whose self-signed certificate the device pins by the
fingerprint in the QR (
cert). The listener follows LAN discovery like the other LAN listeners (lan::listeners), on its own port of the LAN port range. - the feed itself: an agent’s transcript, a bounded snapshot then live
appends (
feed, the route inserver::http_viewer), with what a device is never shown from it taken out on the host (filter).
Modules§
- audit
- The Audit’s rows for what a paired device does on this computer (docs/specs/SPEC_REMOTE_PANES_WATCH_AND_DRIVE_AN_AGENT_ON_ANOTHER_COMPUTER_2026_11_20.md §5.5, “Audit rows”).
- cert
- The viewer listener’s certificate: self-signed ECDSA P-256, made once and kept in this instance’s data directory, so its fingerprint (the one a paired device pinned from the QR) survives restarts. No CA is involved and nothing about the certificate itself is trusted; only the fingerprint is.
- client
- The paired-device side of the viewer: an HTTPS client that accepts exactly
one certificate, by the fingerprint the pairing link carried
(
cert::fingerprint), the way a paired phone does. Used by Tower to read another AgentMux machine’s processes (backend::tower::peers). - feed
- The server-side half of the live feed: a
FeedHubthat watches every publishedblockfileevent in-process (a broker observer, so no WebSocket route is involved) and hands each open feed the changes of the one file it follows: an agent’s transcript (output), or a terminal’s output (term, for the terminal feed insuper::terminal); plus the pure pieces of the feed’s wire (cursor, frame truncation, SSE framing) the route assembles. - filter
- What a paired device is never shown from an agent’s transcript, beyond the values srv holds secret
(
transcript::withhold, which runs first): docs/specs/SPEC_REMOTE_PANES_WATCH_AND_DRIVE_AN_AGENT_ON_ANOTHER_COMPUTER_2026_11_20.md §5.3. One step, run on every line a feed sends (its snapshot, a resume and each append): - origin
- Which user messages a paired device sent, so the transcript can say so (agentmux-mobile’s SPEC_SEND_FROM_THE_PHONE_2026_10_13 §5.3).
- pairing
- Pairing codes and viewer tokens (agentmux-mobile’s SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §13.2).
- panes
- The panes a paired device lists (
GET /agentmux/viewer/panes): every pane of every window and tab, in the order the desktop shows them, plus each agent’s shell drawer (a headless terminal named by the agent block’sterm:shellsubblockid, not in any tab). Names, types and whether they run; never a command line, a working directory or any content. - sends
- What each paired device has sent lately: a rate limit, and the
message_ids already taken, so a retry after a lost reply is answered from memory instead of delivered twice (agentmux-mobile’s SPEC_SEND_FROM_THE_PHONE_2026_10_13 §4, §5.2.1). Memory only: a restart forgets it, which a retry 10 minutes later would too. - signing
- A paired device’s key, and the signature its send requests carry (agentmux-mobile’s SPEC_SEND_FROM_THE_PHONE_2026_10_13 §4, §5.2.1).
- terminal
- The pure pieces of a paired device’s terminal feed
(
GET /agentmux/viewer/terminals/:block_id/feed, the route inserver::http_viewer_terminal): where a snapshot of a terminal’s output starts, and how each published append moves the feed’s byte cursor.
Structs§
- Feed
Lease - One open feed’s place under the caps. Dropping it frees the place;
tokenis cancelled when the device is revoked. - Viewer
Service - Watch
- A paired device watching an agent, since its earliest feed of that agent still open opened (unix ms).
Enums§
- Feed
Refused - Why a feed was refused.
Constants§
- LAST_
SEEN_ EVERY_ MS - A device’s
last_seen_msis written at most this often. - MAX_
FEEDS - Open feeds this srv serves in all; the next gets 503.
- MAX_
FEEDS_ PER_ DEVICE - Open feeds one device may hold; the next gets 503.
Functions§
- advertised_
viewer_ port - The viewer listener’s port while at least one viewer listener is bound.
Type Aliases§
- Watching
Hook - Called when who watches which agent, or who sent one a message, changes (srv publishes
ViewerWatchingChanged).