.tasks/core/WATCH-000-filesystem-watcher.md
The sd-fs-watcher crate provides a platform-agnostic filesystem watcher that serves as the foundation for Spacedrive's real-time file monitoring. It handles platform-specific quirks internally and emits normalized events to higher-level services.
The watcher is designed to be storage-agnostic - it has no knowledge of databases, libraries, or locations. It just watches paths and emits events.
Key Components:
The watcher is consumed by higher-level services in sd-core:
These services filter events by scope and route to appropriate storage adapters.
crates/fs-watcher/src/lib.rs - Public APIcrates/fs-watcher/src/watcher.rs - Core FsWatcher implementationcrates/fs-watcher/src/event.rs - FsEvent typescrates/fs-watcher/src/config.rs - WatchConfig and filterscrates/fs-watcher/src/error.rs - Error typescrates/fs-watcher/src/platform/ - Platform-specific implementations