import { type IOType } from "node:child_process";
import { type Stream } from "node:stream";
import type { Transport, TransportSendOptions } from "@modelcontextprotocol/sdk/shared/transport.js";
import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
export type DetachedStdioServerParameters = {
    command: string;
    args?: string[];
    env?: Record<string, string>;
    stderr?: IOType | Stream | number;
    cwd?: string;
};
/**
 * MCP's SDK stdio transport cannot request `detached: true`, so closing it only
 * kills the direct child. Sources like `lark-cli event` may leave grandchildren
 * alive; this transport owns an isolated process group and tears it down on close.
 */
export declare class DetachedStdioClientTransport implements Transport {
    private readonly readBuffer;
    private readonly serverParams;
    private readonly stderrStream;
    private childProcess;
    onclose?: () => void;
    onerror?: (error: Error) => void;
    onmessage?: <T extends JSONRPCMessage>(message: T) => void;
    constructor(server: DetachedStdioServerParameters);
    start(): Promise<void>;
    get stderr(): Stream | null;
    get pid(): number | null;
    close(): Promise<void>;
    send(message: JSONRPCMessage, _options?: TransportSendOptions): Promise<void>;
    private processReadBuffer;
}
//# sourceMappingURL=detached-stdio-client-transport.d.ts.map