/** * OS Process Management Utilities * Tools for identifying and terminating conflicting serial port owners. * * Provides: * - registerPioMonitorPid: Records a PID to the workspace for crash resumption. * - unregisterPioMonitorPid: Removes a PID from the file tracker. * - killPioMonitorByPort: Safely terminates a tracked PID using tree-kill. */ import type { TaskRecord } from "./command-registry.js"; /** * Records a given process ID belonging to a started serial monitor. */ export declare function registerPioMonitorPid(port: string, pid: number, projectDir?: string, rootCommandId?: string, logFile?: string, taskId?: string, commandDesc?: string): Promise; /** * Removes the recorded PID tracking for a specific port. */ export declare function unregisterPioMonitorPid(port: string, projectDir?: string): Promise; /** * Target-kills a stray or explicitly stopped monitor process via tree-kill. */ export declare function killPioMonitorByPort(port: string, projectDir?: string): Promise; /** * OS-level check to verify if a PID is actively running PlatformIO/Python. */ export declare function isPidAlive(pid: number): boolean; /** * Reads the raw track-list of active monitor daemon PIDs for a specific workspace. */ export declare function getActiveMonitorPids(projectDir?: string): Record; /** * Checks if a build is currently tracked and actively running. */ export declare function isBuildActive(projectDir?: string): boolean; export declare function registerBuildPid(pid: number, projectDir?: string): Promise; export declare function unregisterBuildPid(projectDir?: string): Promise; /** * Terminates one process only after proving it belongs to the selected task. * * @param task - Persisted task record containing PID and hardware scope. * @param projectDir - Owning project directory. * @returns Whether a live tracked process was terminated. */ export declare function killTrackedTaskProcess(task: TaskRecord, projectDir?: string): Promise; /** * Wipes out all stray tracked processes across serial instances and builds. * Specifically used by emergency reset routines to return the system to a clean state. */ export declare function killAllTrackedProcesses(projectDir?: string): Promise; /** * Scans the command history and forcefully terminates any task that is marked as 'running' * but no longer has an active matching OS-level process. */ export declare function sweepGhostTasks(projectDir?: string): Promise; //# sourceMappingURL=process-manager.d.ts.map