import { type BusEvent } from '../orgrt/types.js'; export declare const FOLLOW_INTERVAL_MS = 500; /** Incremental line reader: each call returns the complete lines appended to * `file` since the previous call, reading only the new bytes. A trailing * line without its newline yet is a mid-append partial write — it is held * back until it parses as JSON (or its newline arrives). */ export declare function createLineTail(file: string): () => string[]; /** True once `run` can gain no more events. runtime.json records the run as * stopped/crashed only after its bus is sealed; when runtime.json is about a * newer run (or absent), the run's own terminal `org-stopped` status event — * which every stop path emits — is the signal. */ export declare function isRunClosed(cwd: string, org: string, run: string, stopSeen: boolean): boolean; /** Parsed tail of one run's bus.jsonl: `read()` returns new events (corrupt * lines skipped), `closed()` reports whether the run has ended. */ export declare function tailRun(cwd: string, org: string, run: string): { read: () => BusEvent[]; closed: () => boolean; }; export type FollowEnd = 'closed' | 'signal' | 'consumer-gone' | 'orphaned'; /** Run `drain` every interval until: the parent process changes (we were * re-parented, so our consumer is gone), stdout errors (EPIPE) or closes, * SIGINT/SIGTERM/SIGHUP arrives, or `closed()` reports the run has ended * (after one final drain). Every listener is removed when it stops. */ export declare function followUntilDone(drain: () => void, closed: () => boolean, intervalMs?: number): Promise; //# sourceMappingURL=org-follow.d.ts.map