import type { FSWatcher } from "node:fs";
import type { LogChunk } from "./execution-env.js";
export interface LogStreamEnv {
    fs?: LogStreamFs;
}
export interface LogStreamFs {
    promises: {
        readFile(path: string): Promise<Buffer | string>;
        stat?(path: string): Promise<{
            mtimeMs: number;
        }>;
        lstat?(path: string): Promise<{
            isSymbolicLink(): boolean;
        }>;
    };
    watch?: (path: string, listener: () => void) => FSWatcher;
}
export declare function wrapForLogTee(argv: string[], jobId: string): string[];
export declare function streamLogFile(env: LogStreamEnv, jobId: string, opts: {
    sinceByte?: number;
    since?: Date;
    follow?: boolean;
}): AsyncIterable<LogChunk>;
export declare function waitForExit(env: LogStreamEnv, jobId: string, opts?: {
    signal?: AbortSignal;
}): Promise<{
    exitCode: number;
}>;
