Planck.Headless.Watcher (Planck.Headless v0.1.3)

Copy Markdown View Source

Watches the configured skill, team, and config directories for file changes and calls ResourceStore.reload/0 so running agents pick up updated skill descriptions and configuration without restarting.

Event source vs debounce

FileSystem (backed by inotify on Linux, FSEvents on macOS, and ReadDirectoryChangesW on Windows) delivers OS-level file events — no polling. However, editors typically emit several events per save (write, chmod, rename) in quick succession, especially those that use atomic saves. A 300ms debounce timer is used so those bursts collapse into a single ResourceStore.reload/0 call: each new event cancels the pending timer and starts a fresh one; the reload fires only after 300ms of silence.

Watched paths

Directories are derived from Config at startup:

Only directories that exist on disk are passed to FileSystem; missing ones are silently skipped. If no directories exist the watcher starts in a no-op mode.

Summary

Functions

Returns a specification to start this module under a supervisor.

Start the file watcher under its supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()

Start the file watcher under its supervisor.