import type { TerminalProcessSnapshot } from "./terminal-agent-adapter.js"; export { parseProcessElapsedSeconds } from "./terminal-process-facts.js"; export interface ProcessCommandResult { status: number | null; stdout: string; stderr: string; error?: Error; } export type TerminalProcessInventoryDiagnosticLog = (event: string, fields: Readonly>) => void; export interface TerminalProcessIncarnation { processUuid: string; processBirth: string; evidence: "process_birth"; } /** * Exact operating-system process incarnation for a selected agent PID. * * This deliberately does not depend on a Codex/Claude identity resolver. The * same probe is used when List advertises physical authority and when Send * revalidates that authority under the terminal lock. */ export declare function terminalProcessIncarnationForPid(pid: number, injectedProcessBirthForPid?: (pid: number) => string): TerminalProcessIncarnation; export interface TerminalProcessSource { /** * True only when an empty result comes from one complete, integrity-checked * operating-system process inventory and may therefore prove PID absence. * User-supplied/static discovery snapshots deliberately omit this marker. */ readonly completeInventoryAuthority?: true; listProcessSnapshots(isCandidate?: (snapshot: TerminalProcessSnapshot) => boolean, options?: { includeCwd?: boolean; includeAncestors?: boolean; }): Promise; } export declare class StaticTerminalProcessSource implements TerminalProcessSource { private readonly snapshots; constructor(snapshots: readonly TerminalProcessSnapshot[]); listProcessSnapshots(isCandidate?: (snapshot: TerminalProcessSnapshot) => boolean, options?: { includeCwd?: boolean; includeAncestors?: boolean; }): Promise; } export declare class SystemTerminalProcessSource implements TerminalProcessSource { readonly completeInventoryAuthority: true; private readonly runCommand; private readonly diagnosticLog?; constructor(options?: { runCommand?: (command: string, args: string[]) => ProcessCommandResult; diagnosticLog?: TerminalProcessInventoryDiagnosticLog; }); listProcessSnapshots(isCandidate?: (snapshot: TerminalProcessSnapshot) => boolean, options?: { includeCwd?: boolean; includeAncestors?: boolean; }): Promise; } export declare function parsePsProcessSnapshots(output: string): TerminalProcessSnapshot[]; export declare function parseLsofCwdMap(output: string): Map; export declare function runProcessCommand(command: string, args: string[]): ProcessCommandResult; /** * Best-effort liveness for an already-selected process. A zombie still owns a * PID but cannot perform work, so it is not a live application owner. */ export declare function isProcessAlive(pid: number): boolean;