export interface DetectBoundPortOptions {
    /**
     * When provided, a port only counts as "bound" if the listening process's
     * cwd equals this directory or is a descendant of it. Mismatches are
     * rejected so we don't point at an unrelated service on a shared port.
     */
    cwd?: string;
}
/**
 * Returns the first port from `candidates` that passes all checks. Returns
 * null if none do or `lsof` is unavailable.
 */
export declare function detectBoundPort(candidates: readonly number[], options?: DetectBoundPortOptions): Promise<number | null>;
/** PID of the process listening on `port`, or null if none. */
export declare function getListeningPid(port: number): Promise<number | null>;
/** Working directory of `pid`, or null if unknown. */
export declare function getProcessCwd(pid: number): Promise<string | null>;
/**
 * True if `child` equals `parent` or sits beneath it on disk. Both sides are
 * canonicalized via `fs.realpathSync` before comparison so symlinked install
 * dirs (common with macOS Conductor worktrees, iCloud Drive, Volumes) match
 * the canonical cwd that lsof reports for the listener.
 */
export declare function isSameOrDescendant(child: string, parent: string): boolean;
