Skip to main content

Module browser_chooser

Module browser_chooser 

Source
Expand description

The page’s file chooser, answered from the agent’s workspace (docs/specs/SPEC_BROWSER_WEB_TERMINAL_TYPING_2026_10_23.md §6).

A pane an agent drives never shows the OS file dialog: the host takes the chooser the page opens and asks here what to do with it. On a page a grant with the uploads power covers, the host keeps the chooser for 30 seconds, and set_files with chooser: true puts files in it. Everywhere else it is cancelled at once, as before, and the agent is told to use set_files on the control’s own reference.

The files come through the same door as any upload (browser_uploads): only files in the agent’s own workspace, links and .. resolved, never a directory, 25 MB in all. The grant lifts no part of that.

Constants§

HELD_SECONDS 🔒
How long the host keeps a chooser. Said to the agent; the host holds the clock.
NOTICE_SECONDS 🔒
How long the person’s notice about a cancelled chooser stays up if they don’t dismiss it.

Functions§

fill 🔒
set_files with chooser: true: the files go into the chooser the page last opened in block_id. own is the calling agent’s own block, whose workspace the files come from.
held_reason 🔒
What the agent reads about a chooser the host is keeping.
holds 🔒
Should the host keep the chooser agent’s pane target just showed on page? Only when the agent holds the uploads power on that site and the pane isn’t paused. A folder chooser never.
notice_payload 🔒
What the pane’s notice carries: the kind of chooser the page asked for. The words are the frontend’s.
tell_person 🔒
The host cancelled a chooser the page opened in a pane the agent drives, and nobody would see why: put a notice over the pane for the person (nothing waits on it), taken down after a while.