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:
Planck.Headless.Config.skills_dirs!/0— skill content directoriesPlanck.Headless.Config.teams_dirs!/0— team definition directories- Parent directories of
Planck.Headless.Config.config_files!/0andPlanck.Headless.Config.env_files!/0— so config and API-key changes are also detected
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
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Start the file watcher under its supervisor.