Skip to main content

Module editor_handlers

Module editor_handlers 

Source

Modules§

agent_config 🔒
writeagentconfig, moved out of register_editor_handlers unchanged as named steps: write an agent’s config files atomically into its working directory.
file_io 🔒
The editor’s file RPCs (read, write, list, reveal, create, delete; a rename is fs.rename), moved out of register_editor_handlers unchanged as named functions. Each mutation takes the user’s home folder as a parameter, so a test can point it at a temp dir; the registration passes dirs::home_dir().
scratch 🔒
The scratch file service (createscratchfile, movescratchfile), moved out of register_editor_handlers unchanged as named functions. Spec: docs/specs/SPEC_EDITOR_WIDGET_DEFAULT_UX_2026_06_14.md. Each takes the user’s home folder as a parameter, so a test can point it at a temp dir.

Statics§

SCRATCH_SESSION_TOKEN 🔒

Functions§

editor_may_change 🔒
The editor changes files only under the user’s home folder (an allowlist). A WSL distro’s file through \\wsl.localhost counts when it is under a distro user’s home folder (remote::wsl_fs::in_home): the same rule, in the distro. Its /mnt/<letter> is a Windows drive and never counts here.
home_or 🔒
The user’s home folder, or the command’s own message when there is none.
in_a_distro_home 🔒
inject_global_bundles 🔒
Prepend Global Memory, then agent_block (the agent’s picked bundles, format_agent_bundle_block), into the BUNDLE_SECTION_HEADING section of a CLAUDE.md string, mirroring the injection done by write_agent_config_files in the agent.open RPC path. If the file has no such section, a new one is inserted before # Available Skills (or at the end of the file).
is_a_home 🔒
A home folder itself, the user’s or a distro user’s: never renamed or deleted.
list_drives 🔒
register_agent_config 🔒
register_editor_handlers
register_file_io 🔒
Reading, writing and listing for the editor pane, and the roots its file tree starts from.
register_scratch 🔒
register_tree_mutations 🔒
The file tree’s context-menu mutations, each confined to the user’s home folder.
register_watchers 🔒
Live-reload watching of editor files (spec: docs/specs/SPEC_EDITOR_LIVE_FILE_RELOAD_2026_07_18.md) and live-update watching of Media panes pointed at a directory (docs/specs/SPEC_MEDIA_PANE_2026_07_26.md). Both watchers always exist since the move onto the shared FsWatchPool (SPEC_SHARED_FS_WATCHER_FRAMEWORK_2026_08_07.md): a construction-time failure degrades into FsWatchPool::health()’s degraded_paths, so there’s nothing to check here.
scratch_session_token 🔒