Expand description
Filesystem watcher for settings.json — detects saves and pushes updated config to all connected WebSocket clients in real time.
Functions§
- load_
settings_ from_ disk - Load settings.json from disk into the ConfigWatcher. Called once at startup so the backend has the user’s saved settings.
- merge_
settings_ into_ current - Merge new keys into the current in-memory SettingsType and return the result. Used by the setconfig handler to update in-memory state before the fs watcher fires.
- merge_
settings_ to_ disk - Merge a flat map of settings keys into
settings.jsonon disk. Existing keys not present innew_keysare preserved. The fs watcher will detect the write (~300ms) and broadcast the updated config. - reload_
and_ 🔒broadcast - resolve_
settings_ dir - Resolve the directory containing settings.json.
- spawn_
settings_ watcher - Spawn a filesystem watcher that monitors
settings.jsonand broadcasts config updates to all WebSocket clients on change.