/**
 * olam kg watch <workspace> — opt-in pristine watcher.
 *
 * Phase C2 of olam-kg-service (plan ~/.claude/plans/olam-kg-service.md).
 *
 * Runs `graphify <workspacePath> --watch --update --graph <pristinePath>/graph.json`
 * as a managed subprocess against the operator's workspace clone so the
 * pristine KG stays fresh as host-side commits land. Off by default;
 * operator opts in per workspace.
 *
 * Single-instance enforcement via PID file at
 * `~/.olam/kg/<workspace>/.watch.pid`. Reclaim stale PIDs (process gone
 * but file remains) silently. Reject when an active PID still owns the
 * file.
 *
 * Lifecycle:
 *   1. CLI process spawns graphify in the FOREGROUND (`detached: false`)
 *      so the operator's terminal owns it; Ctrl-C kills both cleanly.
 *   2. SIGINT/SIGTERM on this process → forwarded to graphify; subprocess
 *      exits; CLI removes PID file; CLI exits.
 *   3. graphify exiting on its own → CLI removes PID file + exits with
 *      graphify's status code.
 *
 * Risk T7 mitigation: workspace name regex-validated via @olam/core's
 * `validateWorkspaceName`; `--graph` path resolved via `kgPristinePath`
 * (which asserts the resolved path stays under `~/.olam/kg/`). All
 * subprocess invocations use argv arrays (no shell interpolation).
 */
import type { Command } from 'commander';
import { spawn } from 'node:child_process';
interface KgWatchOptions {
    readonly cwd?: string;
}
export interface RunKgWatchDeps {
    /** Spawn factory; injectable for tests so we don't fork real graphify. */
    readonly spawnImpl?: typeof spawn;
    /** Resolve workspace cwd; defaults to process.cwd(). */
    readonly cwd?: string;
    /** Suppresses signal-handler registration during tests. */
    readonly registerSignalHandlers?: boolean;
}
interface RunResult {
    readonly exitCode: number;
    readonly pidWritten: boolean;
}
export declare function runKgWatch(workspaceArg: string | undefined, opts: KgWatchOptions, deps?: RunKgWatchDeps): Promise<RunResult>;
export declare function registerKgWatchCommand(kg: Command): void;
export {};
//# sourceMappingURL=kg-watch.d.ts.map