import type { Readable, Writable } from 'node:stream';
import type { HitlDeliveryAdapter, HitlPromptEnvelope } from './hitl.js';
import type { JsonValue } from './types.js';
export interface CliHitlAdapterOptions {
    /** Override stdin — useful for tests. Defaults to `process.stdin`. */
    input?: Readable;
    /** Override stdout — useful for tests. Defaults to `process.stdout`. */
    output?: Writable;
    /** Override stderr. Defaults to `process.stderr`. */
    errorOutput?: Writable;
    /**
     * Override the operator id surfaced to the audit log. Defaults to
     * `process.env.USER ?? process.env.USERNAME ?? 'unknown-operator'`.
     */
    operatorId?: string;
}
export declare class CliHitlDeliveryAdapter implements HitlDeliveryAdapter {
    readonly name = "cli";
    readonly operatorId: string;
    private readonly input;
    private readonly output;
    constructor(opts?: CliHitlAdapterOptions);
    collect(envelope: HitlPromptEnvelope, ctx: {
        taskId?: string;
        contextId?: string;
        signal?: AbortSignal;
    }): Promise<JsonValue>;
    private render;
    /**
     * Read JSON from `this.input` until either:
     *   - a balanced JSON value parses cleanly (success), or
     *   - the stream ends (returns null), or
     *   - the abort signal fires (throws HitlAdapterAborted).
     *
     * Allows the operator to type a multi-line JSON object — we accumulate
     * lines and try parsing at each newline boundary.
     */
    private readJsonFromStdin;
}
export declare class HitlAdapterAborted extends Error {
    constructor(message: string);
}
export declare class HitlAdapterParseError extends Error {
    constructor(message: string);
}
//# sourceMappingURL=hitl-cli.d.ts.map