Expand description
Files sent with a jekt (docs/specs/SPEC_JEKT_FILE_TRANSFER_2026_10_05.md):
whether a request’s files belong to it (§3.3), what the agent gets for
them (§6), and how they travel to another instance (§4).
On the sender’s instance the files are already in its attachment store:
the sender’s MCP uploaded them before sending (§3.1). Another instance on
the same machine or the LAN gets them in the same request as the jekt,
after it, at POST /agentmux/reactive/inject-files; it checks the jekt
before reading a single file byte.
Structs§
- Inline
Target 🔒 - Where inline files may go: a persistent Claude agent that is running or starting, so its stdin takes the image blocks. A target that would have to be started gets a turn with the text alone, so it gets the list alone.
- Part
File 🔒 - A file in
incoming/that is removed when dropped, unless taken.
Enums§
- Destination 🔒
- Where the files of a jekt must be put for its target to open them.
- Found 🔒
- What preparing a jekt’s files could learn of the agent it is for.
Constants§
- CONTAINER_
NOT_ 🔒RUNNING - HEADER_
TIMEOUT 🔒 - How long the request in front of the files may take to arrive.
- MAX_
REQUEST_ 🔒JSON - The inject request in front of the files is small (a 10 KB message and its signatures); anything longer is refused before it is read.
- PANE_
UNREADABLE 🔒 - SEEN_
FOR 🔒 - How long a LAN files jekt’s msgid is remembered, so a captured request can’t be delivered twice: longer than any signature’s freshness window.
- TRAILING_
WAIT 🔒 - How long to wait for a byte after the last file before taking the body as ended.
- TRANSFER_
TIMEOUT 🔒 - The longest a forward with files may take: the bytes go with it.
Statics§
Functions§
- check 🔒
- Why a request’s files can’t be accepted at all, before anything is delivered: they’re malformed, the msgid doesn’t bind them, or they would have to come from another instance. The text is for the sender.
- check_
manifest 🔒 - A request’s manifest is well formed, within the limits of the tier it arrived on, and its msgid binds it. Nothing has been read or written yet.
- defined_
as_ 🔒container - Whether
targetnames an agent defined on this instance as a container agent. - derives_
on_ 🔒receipt - Whether a file received with this jekt may be read for a type, preview or
text when it arrives or is delivered: only when the sender is proven for
this message (the marker’s
host-verified,channel-verified,lan-verified, orwan-verifiedwith an approved instance). Any other file is stored as it came and read only when someone opens it. - destination_
for 🔒 - destination_
for_ 🔒block - destination_
name 🔒 - destination_
of 🔒 - Where a target’s files must be put. A container agent is never given the host store’s paths because something couldn’t be looked up: a target that is a container agent, or might be, is refused with a reason that says so (the sender’s answer then counts the files as not delivered), and only a target known to be a host agent, or one this instance knows nothing of, is sent the store’s own paths.
- entry_
takes 🔒 - Whether a same-machine candidate can take this jekt: any can take a text
jekt; one with files only if its registry entry advertises them. A
candidate passed over for that sets
too_old. - files_
present 🔒 - Whether each of
filesis in the store at the size the manifest says. Withderive, anything stored under an older fingerprint is derived again; without it the file is only measured, never read. - files_
too_ 🔒old_ text - Why files were refused: the target runs an AgentMux that can’t take them, and which version fixes that.
- found_
for 🔒 - handle_
reactive_ 🔒inject_ files POST /agentmux/reactive/inject-files: a jekt from another instance on this machine (full key) or a LAN peer (lan_key), with its files after it (spec §4). The jekt is checked as/agentmux/reactive/injectchecks one, before any file byte is read; then each file is streamed into the store, hashed as it goes, and the jekt is delivered with the ones that arrived intact. It is never forwarded on.- inject_
here 🔒 - Deliver on this instance, settling the inline budget for the attempt.
- inline_
target 🔒 - lan_
peer_ 🔒takes - Whether the LAN peer found for this jekt can take it. A jekt with files
needs the peer to advertise them (else
too_old; a probe that went unanswered setscandidate_seen, so the sender is told to try again), and must be within the LAN’s limits, or it is refused outright: no other route is left for it. - no_
route 🔒 - The answer for a jekt with files that no instance on this machine or the LAN took: held for an agent defined here that isn’t running, otherwise refused with the reason. Files don’t go through the relay yet (spec §8).
- nothing_
delivered 🔒 - What the agent gets when none of a jekt’s files can be delivered: the reason, no list.
- peer_
accepts_ 🔒files - Whether the LAN peer at
urltakes files fortarget: its agent answer lists the feature (spec §3.4).Nonewhen the question went unanswered (unreachable, an error status, a body that isn’t JSON), which says nothing about the peer’s build. - prepare 🔒
- Put what the agent gets for this jekt’s files in
req.files_delivery: the list, a line saying they were withheld, or (for a msgid that binds files when none came) a line saying they didn’t arrive. Leaves itNonefor a text-only jekt. - prepare_
for 🔒 preparewith the attachment store and the target’s file destination given.- read_
files 🔒 - Take the jekt’s files off the body: into the store, or (
withheld) read past unstored.Errsays why the message is refused. - read_
request 🔒 - receive 🔒
- refused 🔒
- An answer that ends the sender’s search: the files were refused for a reason no other candidate would change.
- release 🔒
- Give a claim back after a delivery that failed, so the sender may retry.
- reserve 🔒
- Claim this LAN files jekt’s msgid for one delivery, under one lock so two
copies arriving at once can’t both pass:
falsewhen it was delivered here before or is being delivered now. - sender_
verified 🔒 - Whether this jekt’s sender is proven for this message, by the same rule
that relaxes
ESCALATE(Handler::deliver_audited): one check verified and none failed. - settle 🔒
- After a delivery attempt: give back the inline budget it was charged when it wasn’t delivered (refused, rate-limited, retried later), so only a delivered jekt counts against the session the user’s own attachments use.
- store_
files 🔒 - Stream each file into the store, keeping the ones whose bytes match their hash and size. A file that doesn’t is dropped, and the list says it didn’t arrive; a stream that ends early leaves the rest missing.
- target_
block 🔒 - The block of the agent
targetnames, as a delivery finds it. - transfer_
body 🔒 - The body of a forward with files: the request’s JSON length (u32, big-endian), the JSON, then each file’s bytes in manifest order, read from this instance’s store.
- transfer_
stream 🔒 - with_
count 🔒 answerwith how many files the agent got, when the jekt had files.- withheld_
reason 🔒 - Why trust rules out delivering a jekt’s files (§6.4), or
None.