/**
 * resolveNodeBinary — find a stable, currently-existing Node.js executable.
 *
 * Background:
 *   The native-module heal path spawns child processes with `process.execPath`
 *   as the executable target. That works UNTIL the underlying file disappears
 *   from disk — most commonly when Homebrew (or any package manager) updates
 *   Node while the server is still running. Brew swaps the
 *   /opt/homebrew/bin/node symlink and removes the previous Cellar directory.
 *   The running process keeps an open FD to the deleted binary so it continues
 *   executing normally, but any NEW `spawnSync(process.execPath, ...)` returns
 *   ENOENT — the file is gone from the filesystem.
 *
 *   Observed live on luna 2026-05-21: heal detected NODE_MODULE_VERSION
 *   mismatch correctly, then logged
 *   "rebuild failed (spawnSync /opt/homebrew/Cellar/node/25.6.1/bin/node ENOENT)"
 *   even though `node --version` from a fresh shell still worked — Homebrew
 *   had moved Node forward and removed the original Cellar path the process
 *   was launched from.
 *
 * Strategy:
 *   1. Try `process.execPath` first (cheapest, most likely correct).
 *   2. If it's ENOENT, try `fs.realpathSync(process.execPath)` — if execPath
 *      was a symlink at startup, the underlying target might still exist.
 *   3. Otherwise fall back to a list of known-stable absolute paths in order:
 *      - the bundled agent Node at <agentStateDir>/bin/node (passed in)
 *      - /opt/homebrew/bin/node (macOS Homebrew's stable symlink)
 *      - /usr/local/bin/node, /usr/bin/node
 *   4. Final fallback: `which node` from PATH.
 *
 * Returns the first existing-and-executable absolute path, or null when
 * none of the candidates resolve. Callers that get null should NOT silently
 * proceed — the heal cannot continue without a working Node, and the failure
 * mode is operator-visible (DegradationReporter event with a recovery hint).
 *
 * Spec / origin: heal-execpath-staleness fix (Luna self-heal failure, 2026-05-21).
 */
export interface ResolveOptions {
    /** Optional path to the agent's bundled Node (e.g. <stateDir>/bin/node). */
    agentBundledNode?: string;
    /** Override the in-process execPath. For testing only. */
    execPathOverride?: string;
    /** Override the platform string. For testing only. */
    platformOverride?: NodeJS.Platform;
    /** Override fs.existsSync. For testing only. */
    existsSyncOverride?: (p: string) => boolean;
    /** Override the `which`/`where` lookup. For testing only. */
    whichOverride?: () => string | null;
}
/**
 * Result of a resolution attempt. Includes the source so callers can log
 * which fallback fired (useful when investigating why heal needed help).
 */
export interface ResolvedNodeBinary {
    /** Absolute path to the resolved Node executable. */
    path: string;
    /** Which strategy produced this path. */
    source: 'execPath' | 'execPath-realpath' | 'agent-bundled' | 'homebrew' | 'usr-local' | 'usr-bin' | 'which';
}
/**
 * Resolve a stable Node binary path. Returns the first viable candidate;
 * null only when every strategy fails (rare — usually means Node was
 * completely uninstalled mid-session).
 */
export declare function resolveStableNodeBinary(opts?: ResolveOptions): ResolvedNodeBinary | null;
/**
 * Convenience: returns just the path string, or null. Use the full
 * resolver when you need to log which fallback fired.
 */
export declare function resolveStableNodeBinaryPath(opts?: ResolveOptions): string | null;
//# sourceMappingURL=resolveNodeBinary.d.ts.map