Skip to main content

Module jekt_files

Module jekt_files 

Source
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§

InlineTarget 🔒
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.
PartFile 🔒
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§

SEEN_LAN 🔒
TRANSFERS 🔒
Transfers a receiver takes at once; another waits for the sender’s retry.

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 target names 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, or wan-verified with 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 files is in the store at the size the manifest says. With derive, 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/inject checks 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 sets candidate_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 url takes files for target: its agent answer lists the feature (spec §3.4). None when 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 it None for a text-only jekt.
prepare_for 🔒
prepare with 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. Err says 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: false when 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 target names, 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 🔒
answer with 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.

Type Aliases§

ByteStream 🔒