import { type InvokeOptions, type OperationSpec, type SuperDocClientOptions } from './transport-common.js';
/**
 * Builds the argv passed to `spawn` for `superdoc host --stdio`. Propagates
 * `requestTimeoutMs` to the host via `--request-timeout-ms`, since the SDK
 * option alone cannot raise the host's 30s per-invoke ceiling otherwise.
 *
 * Exported for unit testing.
 */
export declare function buildHostSpawnArgs(prefixArgs: readonly string[], options: {
    requestTimeoutMs?: number;
}): string[];
/**
 * Computes the JS-side watchdog timeout for a single JSON-RPC request.
 *
 * The watchdog must outlive the host-side `cli.invoke` ceiling so the host's
 * structured `RequestTimeout` JSON-RPC frame wins the race against the SDK's
 * own abort. Three cases:
 *
 * 1. A per-call `InvokeOptions.timeoutMs` is supplied → widen above it.
 * 2. The client set `requestTimeoutMs` → widen above that.
 * 3. Neither is set → widen above the host's compiled-in default so the
 *    default-config case doesn't race at 30s (which previously surfaced the
 *    old "Host watchdog timed out" string instead of the host's structured
 *    TIMEOUT error).
 *
 * Exported for unit testing.
 */
export declare function resolveJsWatchdogTimeout(watchdogTimeoutMs: number, requestTimeoutMs: number | undefined, timeoutMsOverride: number | undefined): number;
/**
 * Transport that communicates with a long-lived CLI host process over JSON-RPC stdio.
 */
export declare class HostTransport {
    private readonly cliBin;
    private readonly env?;
    private readonly startupTimeoutMs;
    private readonly shutdownTimeoutMs;
    private readonly requestTimeoutMs?;
    private readonly watchdogTimeoutMs;
    private readonly maxQueueDepth;
    private readonly defaultChangeMode?;
    private readonly user?;
    private child;
    private stdoutReader;
    private readonly pending;
    private nextRequestId;
    private connecting;
    private stopping;
    constructor(options: {
        cliBin: string;
    } & SuperDocClientOptions);
    connect(): Promise<void>;
    dispose(): Promise<void>;
    invoke<TData = unknown>(operation: OperationSpec, params?: Record<string, unknown>, options?: InvokeOptions): Promise<TData>;
    private ensureConnected;
    private startHostProcess;
    private assertCapabilities;
    private resolveWatchdogTimeout;
    private sendJsonRpcRequest;
    private onStdoutLine;
    private mapJsonRpcError;
    private handleDisconnect;
    private cleanupProcess;
}
//# sourceMappingURL=host.d.ts.map