import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import type { Logger } from "@onenomad/przm-cortex-core"; /** * Spawn a stdio MCP server bin as a subprocess and connect a Client to it. * Used for both Engram and Persona — they're CLI-installable MCP servers, * not libraries. * * `command` is resolved against PATH by the OS. On Windows, global npm bins * are installed as `.cmd` wrappers; Node's spawn handles them when PATH * includes the npm global bin dir, which it does after `npm install -g`. */ export interface McpSubprocessOptions { command: string; args?: string[]; env?: Record; /** Friendly id for logs. */ id: string; logger: Logger; } export interface McpSubprocess { client: Client; close(): Promise; } export declare function connectMcpSubprocess(opts: McpSubprocessOptions): Promise; /** * Call a tool on a subprocess MCP server and parse its JSON text response. * Every tool we use returns `content: [{ type: "text", text: "" }]` — * this helper extracts + parses that. */ export declare function callJsonTool(client: Client, name: string, args: Record, opts?: { timeoutMs?: number; }): Promise; //# sourceMappingURL=mcp-subprocess.d.ts.map