Expand description
Which files an agent may upload into a browser pane (docs/specs/SPEC_AGENT_DRIVEN_BROWSER_PANES_2026_10_07.md §5.3): only files inside its own workspace, so a page (or a tricked agent) can’t use an upload field to carry off anything else on the machine.
Structs§
- Upload
File 🔒 - A file ready to hand to the page: its name, a content type from its extension, and its bytes.
Constants§
- MAX_
UPLOAD_ 🔒BYTES - At most this many bytes in one upload, all files together. Bigger files
are for the user to pick (
BrowserHandoff). - MAX_
UPLOAD_ 🔒FILES - At most this many files per upload.
Functions§
- agent_
workspace 🔒 - The workspace the agent on
block_idwas launched in, if srv started it as a host agent. - canonical 🔒
canonicalizewithout Windows’\\?\verbatim prefix, which the browser doesn’t expect in a file path.- check_
upload_ 🔒paths - Check
paths(absolute, or relative to the workspace) and return their canonical forms: each must be an existing file insideworkspaceafter resolving..and symlinks. - handle_
path 🔒 - launch_
workspaces 🔒 - mime_
for 🔒 - A content type for the file, from its extension, as a browser’s own file picker would give it. An extension not known here gets no type at all (empty), as the picker gives one it doesn’t know, rather than a forced generic one a page might reject.
- read_
upload_ 🔒files - Read the files
check_upload_pathsapproved. Each is opened once, and the check is repeated on the open handle: the file it really refers to must be a regular file inside the workspace. The bytes are read from that same handle and the page is given the bytes, never a path, so replacing a checked file with a link afterwards changes nothing. - record_
launch_ 🔒workspace - Remember the workspace the agent on
block_idwas started in: theAGENTMUX_AGENT_WORKDIRsrv just put in its spawn env (host agents only; a container agent has none). Called by every spawn path right afteragent_handlers::input::carry_agent_workdir_env.