Skip to main content

Module editor_file_watcher

Module editor_file_watcher 

Source
Expand description

Filesystem watcher for files open in editor/preview panes — detects external changes (an agent’s Edit/Write tool, another process, a second AgentMux window) and pushes a per-block “this file changed on disk” wake signal so panes can refresh instead of silently going stale.

Migrated onto the shared fs_watch::FsWatchPool (SPEC_SHARED_FS_WATCHER_FRAMEWORK_2026_08_07.md) — this module keeps only its own domain-specific bookkeeping (which block ids have which paths open, per-path debounce, and the EVENT_EDITOR_FILE_CHANGED publish shape). The actual notify construction, OS-level watch/unwatch, and recovery-on-failure now live in the pool, shared with every other watcher that migrates onto it (config_watcher_fs.rs already has; media_file_watcher.rs, below in the same PR, is the directory-mode sibling migrating alongside this one).

Spec: docs/specs/SPEC_EDITOR_LIVE_FILE_RELOAD_2026_07_18.md

Structs§

EditorFileWatcher

Constants§

EVENT_EDITOR_FILE_CHANGED
MPS event fired when a file open in at least one editor tab changes on disk. Scoped per-block (block:<id>) via MuxEvent::scopes, matching EVENT_CONTROLLER_STATUS/EVENT_BLOCK_ACTIVITY’s existing pattern — never a global broadcast, so panes on unrelated files aren’t notified. Payload is deliberately just the path (a wake signal, not content); the frontend re-fetches via the existing readeditorfile RPC.