Skip to main content

Module fs_handlers

Module fs_handlers 

Source
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.open for 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 from cursor. 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, publishing files:op to 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 as files:changed scoped 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_path is now new_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 🔒