import type { LauncherFileSystem, ProcessSpec, ProcessState } from "./types.js";
export interface ManagedProcessRecord {
    spec: ProcessSpec | null;
    state: ProcessState | null;
    daemonPid: number | null;
}
export interface StartManagedProcessOptions {
    baseDir: string;
    spec: ProcessSpec;
    fs?: LauncherFileSystem;
    pollIntervalMs?: number;
    startupTimeoutMs?: number;
    spawnDaemon: (id: string) => Promise<number | null>;
    isPidRunning?: (pid: number) => boolean;
    signalProcess?: (pid: number, signal: NodeJS.Signals) => void;
}
export interface StopManagedProcessOptions {
    baseDir: string;
    id: string;
    fs?: LauncherFileSystem;
    force?: boolean;
    pollIntervalMs?: number;
    stopTimeoutMs?: number;
    isPidRunning?: (pid: number) => boolean;
    signalProcess?: (pid: number, signal: NodeJS.Signals) => void;
    stopRuntimeArtifacts?: (input: {
        record: ManagedProcessRecord;
        force: boolean;
    }) => Promise<void>;
}
export interface RestartManagedProcessOptions extends Omit<StopManagedProcessOptions, "force"> {
    startupTimeoutMs?: number;
    spawnDaemon: (id: string) => Promise<number | null>;
}
export interface ListManagedProcessesOptions {
    baseDir: string;
    fs?: LauncherFileSystem;
    isPidRunning?: (pid: number) => boolean;
}
export interface ReadManagedLogsOptions {
    baseDir: string;
    id: string;
    fs?: LauncherFileSystem;
    lines?: number;
    stream?: "stdout" | "stderr";
}
export interface FollowManagedLogsOptions extends ReadManagedLogsOptions {
    pollIntervalMs?: number;
    signal?: AbortSignal;
}
export interface RemoveManagedProcessOptions {
    baseDir: string;
    id: string;
    fs?: LauncherFileSystem;
    isPidRunning?: (pid: number) => boolean;
    removeRuntimeArtifacts?: (input: {
        record: ManagedProcessRecord;
    }) => Promise<void>;
}
export interface RunManagedProcessOptions {
    baseDir: string;
    id: string;
    fs?: LauncherFileSystem;
    pollIntervalMs?: number;
    signal?: AbortSignal;
}
export declare function startManagedProcess(options: StartManagedProcessOptions): Promise<ManagedProcessRecord>;
export declare function stopManagedProcess(options: StopManagedProcessOptions): Promise<ManagedProcessRecord | null>;
export declare function restartManagedProcess(options: RestartManagedProcessOptions): Promise<ManagedProcessRecord>;
export declare function listManagedProcesses(options: ListManagedProcessesOptions): Promise<ManagedProcessRecord[]>;
export declare function readManagedLogs(options: ReadManagedLogsOptions): Promise<string[]>;
export declare function followManagedLogs(options: FollowManagedLogsOptions): AsyncIterable<string>;
export declare function removeManagedProcess(options: RemoveManagedProcessOptions): Promise<void>;
export declare function runManagedProcess(options: RunManagedProcessOptions): Promise<void>;
