Documentation
¶
Overview ¶
Package watch turns external edits to trace files (Obsidian, VS Code, Finder drags, iCloud sync, etc.) into first-class mutation events. It runs as a goroutine under `noema serve` on both the stdio and http transports, watching the cortex's traces/, archive/traces/, and trash/traces/ directories with fsnotify and dispatching to existing Cortex mutation methods so events, vector clocks, and the SQL write path are shared with MCP-initiated mutations. Federation propagation is still HTTP-only (peers need a network endpoint), but external-edit events land in the local log under stdio too and flow outward the next time an HTTP serve runs on this cortex.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher observes the three trace directories and reconciles external filesystem changes into Cortex mutation events. Lifecycle mirrors federation.Syncer: construct, Start, Stop (cancels context and waits for the goroutine to drain).
func New ¶
New creates a Watcher for the given cortex. An empty cfg is equivalent to the defaults (enabled=true, debounce=300ms); callers that want to gate on the enabled bit should check cfg.WatchEnabled() before calling.