Skip to main content

Module http_viewer_attachments

Module http_viewer_attachments 

Source
Expand description

GET /agentmux/viewer/agents/:name/attachments/:id?at=<gen:line>: one attachment a person sent the agent, for a paired device showing that message (docs/specs/SPEC_REMOTE_PANES_WATCH_AND_DRIVE_AN_AGENT_ON_ANOTHER_COMPUTER_2026_11_20.md §2 “Attachments and images”).

Only an attachment the feed names: at is the line of the agent’s transcript (the feed’s numbering) whose attachment list (<attached_files>, in a person’s message) names id, and the host reads that line again, vetted as the feed’s are, before serving anything. Images and text only, at most 5 MiB, the bytes alone: an image as the copy the agent was sent, a text file as itself, a document as its text version. Never a path, never another kind of file, and nothing derived on demand.

Structs§

AttachmentQuery 🔒

Constants§

MAX_ATTACHMENT_BYTES 🔒
The most an attachment served to a device may be (an image’s send copy is never larger, attachments::process::SEND_MAX_BYTES).

Functions§

attachment_lists 🔒
Each <attached_files> list in text: every one, not only the first (a person may quote a list before the one the writer appends, as viewer::filter allows for). A list ends at its close, or at the next list’s open when it has no close, so a quoted list left open doesn’t take in the person’s own words after it.
handle_viewer_attachment 🔒
The attachment, as Content-Type and bytes; 404 for an agent that isn’t this channel’s or is hidden, an id the line at at doesn’t name, or one no longer stored; 409 gen_changed; 415 not_viewable; 413 too_large. A computer’s read is signed as its feed open is (http_viewer_computers::refuse_unsigned_open), over the path and the query, so the attachment and line asked for are the ones signed for; its token alone reads nothing.
is_fingerprint 🔒
Whether fp has the shape store::fingerprint gives (v<version>-e<edge>), so a line can’t name another path.
named_attachment 🔒
Whether line, a transcript line as a device is shown it, is a person’s message whose attachment list names id: None when it doesn’t, else the fingerprint the list’s path for it carries (<id>.<fp>.send.<ext>), if any, so the copy the message was sent is the one served even after the send edge changed. A tool’s output or the agent’s own words that happen to hold the id don’t count.
refuse 🔒
serve 🔒
Attachment id from store as a device is given it (see served_as), derived under the fingerprint fp.
served_as 🔒
Which stored file a device is given for the attachment meta describes, and as what type: None for a kind it isn’t given.