/** * openlore gryph-watch * * Standalone Gryph behavioral observer. Runs as an independent background * process — lifetime decoupled from the MCP server session. Polls Gryph every * interval and writes behavioral signals to panic-state.json via CAS writes. * * Why a separate process: MCP-path Gryph polling only starts after the first * openlore tool call. Agents working exclusively via Bash/Edit/Read never * trigger that path. gryph-watch closes this gap by running continuously from * session start. * * Signals provided (standalone, without MCP tracker context): * repetitiveRetryBurst — low entropy + failing commands (no stale context needed) * * Signals requiring MCP tracker (not available here): * largePatchWhileStale — staleDepth unknown without EpistemicLease session * * Install via: openlore setup --hooks claude * Which installs a UserPromptSubmit hook: openlore gryph-watch & */ import { Command } from 'commander'; /** * Atomically claim the one-watcher-per-directory singleton. * * Uses `openSync(path, 'wx')` (atomic create-exclusive) so two concurrently launched watchers can * never both pass the check — exactly one wins the create, the other observes the winner's live, * fresh claim and stands down. This replaces the old `existsSync` + `writeFileSync` TOCTOU. * * Liveness is not inferred from `kill(pid, 0)` alone: a recycled PID (the old watcher's number now * belongs to an unrelated process) would otherwise suppress a legitimate watcher forever. The claim * carries a heartbeat — the PID-file mtime, refreshed every WATCHER_HEARTBEAT_MS by the live * watcher — and a claim whose heartbeat is older than WATCHER_STALE_MS is stolen even if its PID * still answers signal-0. A garbage/legacy-format or dead-PID claim is likewise stolen. * * Returns 'claimed' if this process now owns the singleton, 'held' if a live watcher already does. */ export declare function claimWatcherSingleton(pidPath: string, now?: number): 'claimed' | 'held'; export declare const gryphWatchCommand: Command; //# sourceMappingURL=gryph-watch.d.ts.map