import { type JsonRpcStdioOptions, type ProgressNotification } from "./json-rpc-stdio.js"; /** One tool as advertised by an MCP server's tools/list. */ export interface McpToolDescriptor { name: string; description?: string; /** Plain JSON Schema — passed through verbatim as a pi tool's parameters. */ inputSchema: unknown; annotations?: { title?: string; readOnlyHint?: boolean; [k: string]: unknown; }; } /** The shape of an MCP tools/call result. */ export interface McpCallResult { content: Array<{ type: string; text?: string; [k: string]: unknown; }>; isError?: boolean; } /** Server identity from the initialize handshake. */ export interface McpServerInfo { name?: string; title?: string; version?: string; } /** The minimal MCP surface synthesizeTools() consumes. Injectable for tests. */ export interface McpSession { /** Server identity captured during initialize (undefined before handshake). */ readonly serverInfo?: McpServerInfo; initialize(): Promise; listTools(): Promise; callTool(name: string, args: Record, signal?: AbortSignal, onProgress?: (p: ProgressNotification) => void): Promise; close(): Promise; } /** McpSession backed by a spawned stdio child (e.g. `grove serve`). */ export declare class StdioMcpSession implements McpSession { private readonly client; private initialized; serverInfo?: McpServerInfo; constructor(opts: JsonRpcStdioOptions); initialize(): Promise; listTools(): Promise; callTool(name: string, args: Record, signal?: AbortSignal, onProgress?: (p: ProgressNotification) => void): Promise; close(): Promise; }