import type { Transport, TransportSendOptions } from "./transport.js";
export declare function buildSubprocessEnv(inheritedEnv: Record<string, string | undefined>, serverEnv: Record<string, string>): Record<string, string>;
export declare class StdioTransport implements Transport {
    private command;
    private args;
    private env;
    private process;
    private messageHandlers;
    private notificationHandlers;
    private errorHandlers;
    private buffer;
    private closing;
    constructor(command: string, args: string[], env: Record<string, string>);
    get pid(): number | undefined;
    connect(): Promise<void>;
    private processBuffer;
    send(message: string, options?: TransportSendOptions): Promise<void>;
    onMessage(handler: (raw: string) => void): void;
    onNotification(handler: (method: string, params: unknown) => void): void;
    onError(handler: (err: Error) => void): void;
    close(): Promise<void>;
}
