Usage
WatcherBuilder accepts roots, include/exclude globs, recursion, batch thresholds, queue settings, and debounce/coalescing values.
Construct the watcher
WatcherBuilder accepts roots, include/exclude globs, recursion, batch thresholds, queue settings, and debounce/coalescing values. build() returns a Watcher or a configuration/OS watcher error. Roots must exist for the underlying filesystem watcher.
use agentfs_watch::WatcherBuilder;
let watcher = WatcherBuilder::new()
.roots(["."])
.include_globs(["**/*.rs"])
.exclude_globs(["**/target/**"])
.batch_max_items(64)
.batch_max_ms(500)
.build()?;Current stream lifecycle limit
into_stream(self) returns a receiver wrapper by moving out self.rx; it does not retain the RecommendedWatcher field. The remaining watcher owner is dropped during this conversion, so this path must not be documented as a functioning continuous OS watch subscription. The lifecycle needs repair before relying on ongoing events through that adapter.
For the separate AgentFS API, see FSWatcher. Exact watcher declarations. Source: local/agentfs-watch/src/lib.rs.