export type RuntimeStreamKind = 'exec' | 'logs';
export type RuntimeStreamState = 'open' | 'complete' | 'failed' | 'cancelled';
export interface RuntimeStreamChunk {
    cursor: number;
    stream: 'stdout' | 'stderr' | 'system';
    data: string;
    at: string;
}
export interface RuntimeStreamSnapshot {
    id: string;
    workloadId: string;
    kind: RuntimeStreamKind;
    state: RuntimeStreamState;
    chunks: RuntimeStreamChunk[];
    cursor: number;
    reset: boolean;
    droppedBytes: number;
    createdAt: string;
    updatedAt: string;
    error?: string;
}
export interface RuntimeStreamRegistryOptions {
    maxBufferBytes?: number;
    ttlMs?: number;
    now?: () => Date;
}
/**
 * Bounded, reconnectable runtime output. Cursors are monotonically increasing
 * chunk IDs: clients can reconnect with their last cursor, and receive a reset
 * signal when backpressure already evicted older chunks.
 */
export declare class RuntimeStreamRegistry {
    private readonly records;
    private readonly maxBufferBytes;
    private readonly ttlMs;
    private readonly now;
    constructor(options?: RuntimeStreamRegistryOptions);
    create(kind: RuntimeStreamKind, workloadId: string): RuntimeStreamSnapshot;
    signal(id: string): AbortSignal | undefined;
    append(id: string, data: string, stream?: RuntimeStreamChunk['stream']): RuntimeStreamSnapshot | undefined;
    read(id: string, workloadId: string, after?: number): RuntimeStreamSnapshot | undefined;
    close(id: string, state?: Exclude<RuntimeStreamState, 'open'>, error?: string): RuntimeStreamSnapshot | undefined;
    cancel(id: string, workloadId: string): RuntimeStreamSnapshot | undefined;
    subscribe(id: string, workloadId: string, listener: (snapshot: RuntimeStreamSnapshot) => void): (() => void) | undefined;
    sweep(): number;
    clear(): void;
    private snapshot;
    private publish;
}
