/**
 * In-process child watchdog.
 *
 * Spawns a small standalone Node child process whose only job is to
 * detect that the main agent's event loop has stopped writing to its
 * heartbeat file, and SIGKILL the parent if it has. pm2 then auto-
 * restarts the agent.
 *
 * Why a separate child process (rather than a worker_thread, a
 * setInterval, or an OS-level cron):
 *
 *  - worker_threads share the parent's event loop scheduler for some
 *    primitives (and in any case can't kill the parent if the parent
 *    is wedged inside synchronous native code).
 *  - setInterval inside the same process won't fire when the event
 *    loop is blocked — which is exactly the failure mode we want to
 *    recover from.
 *  - cron / launchd would work, but `crontab` itself triggers a one-
 *    time macOS SecurityAgent prompt on Sequoia ("Terminal would like
 *    to administer your computer"), and the spawnSync we used to
 *    install the entry blocked the agent's startup for 13+ minutes
 *    on the first install. A child process spawned from inside the
 *    running agent doesn't need any new OS permission.
 *
 * The child is implemented via `node -e <inline script>` so it has
 * zero on-disk footprint, ships inside the bundle automatically, and
 * is identical between dev (tsx) and production (esbuild bundle).
 */
interface WatchdogOptions {
    /**
     * Maximum heartbeat staleness before the parent is killed, in
     * milliseconds. Defaults to 15 minutes, sized for the 5-minute idle
     * heartbeat cadence in `HeartbeatManager`.
     */
    thresholdMs?: number;
    /**
     * How often the child polls the heartbeat file. Default 60 s — fine-
     * grained enough that recovery is fast, coarse enough to be cheap.
     */
    intervalMs?: number;
}
/**
 * Start the child watchdog. Returns a stop() function the caller can
 * use during graceful shutdown to prevent the watchdog from killing
 * a parent that is about to exit cleanly anyway.
 *
 * Idempotent: calling twice returns the same handle and does not
 * spawn a second child.
 *
 * Disabled by default. Set the env var
 * `VISIONCLAW_ENABLE_HEARTBEAT_WATCHDOG=1` to opt in. While disabled,
 * this function returns a no-op handle without spawning anything.
 */
export declare function startHeartbeatWatchdog(opts?: WatchdogOptions): {
    stop: () => void;
    pid: number | null;
};
export {};
//# sourceMappingURL=heartbeat-watchdog.d.ts.map