/// import { EventEmitter } from 'node:events'; /** * Bidirectional StdioTransport for child processes * This class handles both server (receiving requests) and client (sending requests) functionality * over a single stdio channel with proper message routing. * * Usage in child process: * ```typescript * const transport = new ChildStdioTransport(); * * // Register methods that parent can call * transport.registerMethod('ping', async () => 'pong'); * * // Make requests to parent * const result = await transport.request('getTime'); * ``` */ export declare class ChildStdioTransport extends EventEmitter { private readonly server; private readonly client; private readonly logger; private readonly messageBuffer; private name?; private initialized; constructor(); /** * Set a name for this transport (used in logging) */ setName(name: string): void; /** * Initialize the bidirectional transport * This should be called once after setting up all methods */ initialize(): Promise; /** * Register a method that the parent can call * @param method - Method name * @param handler - Method handler function */ registerMethod(method: string, handler: (params: TParams) => Promise | TResult): void; /** * Send a request to the parent process * @param method - Method name * @param params - Method parameters * @param options - Request options * @returns Promise resolving to the response */ request(method: string, params?: TParams, options?: { timeout?: number; }): Promise; /** * Send a notification to the parent process (no response expected) * @param method - Method name * @param params - Method parameters */ notify(method: string, params?: TParams): Promise; /** * Get transport statistics */ getStats(): { serverMethods: number; pendingRequests: number; initialized: boolean; }; /** * Close the transport and cleanup resources */ close(): Promise; /** * Set up stdio communication handlers */ private setupStdioCommunication; /** * Handle incoming message and route to appropriate handler */ private handleIncomingMessage; /** * Send a message to the parent process */ private sendMessage; /** * Set up event handlers */ private setupEventHandlers; } //# sourceMappingURL=ChildStdioTransport.d.ts.map