export interface ProcessNode { pid: number; ppid: number; image: string; } export interface KillTreeOptions { /** Image names (case-insensitive) to keep alive, with their subtrees. */ excludeImages?: string[]; /** Grace period (ms) before escalating to a force kill. 0 = force at once. */ graceMs?: number; /** Optional sink for the "kept alive" / degraded warnings. */ log?: (message: string) => void; } export interface KillTreeResult { /** PIDs we asked the OS to terminate (root included). */ kill: number[]; /** Browser PIDs deliberately left running. */ kept: ProcessNode[]; /** True when the tree could not be enumerated (root-only fallback). */ degraded: boolean; } /** Browser images the bridge never terminates (the human closes them). */ export declare const DEFAULT_EXCLUDE_IMAGES: string[]; /** Parse `Get-CimInstance Win32_Process | ConvertTo-Json` output. */ export declare function parseWindowsProcessJson(raw: string): ProcessNode[]; /** Parse `ps -Ao pid=,ppid=,comm=` output. */ export declare function parsePosixProcessList(raw: string): ProcessNode[]; /** * Pure selector: the root plus every descendant, minus excluded images and * their subtrees. Split out so the safety rule is unit-testable. */ export declare function selectProcessesToKill(nodes: ProcessNode[], rootPid: number, excludeImages?: string[]): { kill: number[]; kept: ProcessNode[]; }; /** Enumerate every process on this machine (null when unsupported/unavailable). */ export declare function listProcessTree(): ProcessNode[] | null; /** * Kill a process and its descendants, but never a browser. * * @returns which PIDs were killed / deliberately kept, and whether the tree * could not be enumerated (root-only fallback). */ export declare function killTreeExcept(rootPid: number, opts?: KillTreeOptions): KillTreeResult;