Expand description
The generic fs.* RPC family behind the Files pane.
Thin handlers over backend::fs_ops: each runs its filesystem work on a
blocking thread (spawn_blocking, or the trash thread for fs.trash /
fs.restore), never on an async worker, because on macOS the first
access to a protected folder blocks the calling thread while a privacy
prompt is up (spec §9.1.1 fact 10).
Reads serve any path the user can read, as the editor’s do. Mutations go
through fs_ops::ProtectedPaths instead of the editor’s home-only rule
(spec §9, “Security”).
Copy and move (fs.op.*) are jobs rather than calls: fs.op.start
answers once the request is validated, and the work reports through
files:op events (fs_ops::jobs).
Spec: docs/specs/SPEC_FILE_BROWSER_PANE_2026_10_01.md §6.3, §7, §9.
Functions§
- asks_
first_ 🔒message - The answer of
fs.openfor a file a container agent can write, until the person has said yes:[asks-first:<agent id>]and then the sentence the person reads. A window turns it into the confirm that names the agent. - blocking 🔒
- Run blocking filesystem work off the async runtime.
- fs_
agent_ 🔒folder fs.agent_folder→ whether a path is in a folder a container agent can write. A window asks before it opens a linked file itself: such a file is opened by srv, as a read-only copy.- fs_
create 🔒 fs.create.- fs_
delete 🔒 fs.delete→ PERMANENT. The UI confirms first (spec §7.3).- fs_
git_ 🔒status fs.git_status→ the markers for a listed folder’s entries. Never an error: outside a repository, or if git fails, the pane shows none.- fs_list 🔒
fs.list→ one page of a folder. The first page opens it; later pages continue fromcursor. Spec §6.3. A request naming an SSH connection runs on that host, through its helper (fs_ops::remote, spec §6.3 of the remote terminals spec).- fs_
op_ 🔒cancel fs.op.cancel.- fs_
op_ 🔒resolve fs.op.resolve→ touches only the op’s in-memory controls, so it answers at once, on the async thread.- fs_
op_ 🔒start fs.op.start→ validate, answer with an op id, then work on the op’s own thread, publishingfiles:opto the block.- fs_
places 🔒 fs.places→ home, known folders, drives and WSL distros. Known folders are named, never read (spec §9.1.5).- fs_
rename 🔒 fs.rename.- fs_
restore 🔒 fs.restore→ undo of fs.trash; the paths are the original locations.- fs_
trash 🔒 fs.trash→ the OS Trash, on the single trash thread (spec §7.3).- fs_
unwatch 🔒 fs.unwatch.- fs_
watch 🔒 fs.watch→ live updates for a listed folder, published asfiles:changedscoped to the block. Spec §6.3.- op_
results 🔒 - Pair each requested path with its outcome, in request order.
- open_
or_ 🔒reveal_ bound fs.open/fs.reveal: a confined pane hands nothing to another program, and a file a container agent can write is opened only once the person has said yes (confirmed). Showing a file in the file manager asks nothing.- publish_
renamed 🔒 - Tells every window that
old_pathis nownew_path, so documents open on it follow (the Editor’s tabs). Nothing is sent for a name that didn’t change. - register_
fs_ 🔒browsing - register_
fs_ handlers - register_
fs_ 🔒jobs - register_
fs_ 🔒mutations - remote_
of 🔒