Expand description
Filesystem-watcher subsystem for --watch DIR mode.
Boots a debounced recursive watcher on the configured directory and
invokes a caller-supplied callback when files change. Downstream
binaries register callbacks to drive whatever rebuild they need —
kglite-mcp-server, for example, wires this to code_tree::build()
against the watched directory and atomic-swaps the active graph.
mcp-methods’s binary on its own does not own a rebuild target; it logs change events at INFO level and forwards them to any registered callback. When no callback is set the watcher still runs, so the change events show up in stderr.
Structs§
- Watch
Handle - Active watcher handle. Drop to stop watching.
Constants§
- DEFAULT_
DEBOUNCE - Default debounce window — short enough to feel responsive, long enough to coalesce noisy editor saves and IDE temp-file dance.
Functions§
- watch
- Spawn a recursive debounced watcher on
dir.
Type Aliases§
- Change
Handler - Callback invoked on a debounced file-change event.