/** * Process management for stdio-based MCP servers */ import { type ChildProcess } from 'node:child_process'; import { EventEmitter } from 'node:events'; import type { StdioServerConfig } from '../types/config.js'; import { type Logger } from '../utils/logger.js'; /** * Events emitted by the process manager */ export interface ProcessManagerEvents { /** Process started successfully */ started: (pid: number) => void; /** Process exited */ exited: (code: number | null, signal: string | null) => void; /** Process error occurred */ error: (error: Error) => void; /** Data received on stderr */ stderr: (data: string) => void; } /** * Manages a single stdio process for an MCP server */ export declare class ProcessManager extends EventEmitter { private config; private logger; private process; private shutdownTimeoutMs; constructor(serverName: string, config: StdioServerConfig, shutdownTimeoutMs?: number, logger?: Logger); /** * Starts the process */ start(): Promise; /** * Stops the process gracefully, with force kill fallback */ stop(): Promise; /** * Forces the process to stop immediately */ forceStop(): void; /** * Gets the current process (if running) */ getProcess(): ChildProcess | null; /** * Gets the process ID (if running) */ getPid(): number | undefined; /** * Checks if the process is running */ isRunning(): boolean; /** * Gets the stdin stream for writing to the process */ getStdin(): NodeJS.WritableStream | null; /** * Gets the stdout stream for reading from the process */ getStdout(): NodeJS.ReadableStream | null; } //# sourceMappingURL=process-manager.d.ts.map