/**
 * McpClient - Model Context Protocol Client for Ag-Bash
 */
import type { ExecutionLimits } from "../limits.js";
import type { CommandContext } from "../types.js";
/**
 * Minimal structural interface describing what McpClient needs from a Bash
 * instance.  Using a narrow interface avoids a circular import on the full
 * Bash class and decouples McpClient from private internals.
 */
interface McpBashLike {
    readonly limits: Required<ExecutionLimits>;
}
export interface McpTool {
    name: string;
    description?: string;
    inputSchema: Record<string, unknown>;
}
export interface McpServerConnection {
    id: string;
    name: string;
    type: "stdio" | "http";
    status: "connected" | "disconnected" | "error";
    tools: McpTool[];
    transport: McpTransport;
}
export interface McpTransport {
    init(): Promise<void>;
    send(message: unknown): Promise<unknown>;
    close(): void;
}
/** Security configuration for HttpTransport. */
export interface HttpTransportSecurityConfig {
    /** Allow requests to private/internal network addresses. Default: false. */
    allowPrivateNetworks?: boolean;
}
/** Error thrown when an SSRF-blocked URL is detected. */
export declare class McpTransportSecurityError extends Error {
    constructor(message: string);
}
/** Configuration options for StdioTransport. */
export interface StdioTransportOptions {
    /** Timeout in milliseconds for pending requests. Default: 30000 (30s). */
    requestTimeoutMs?: number;
}
export declare class McpClient {
    private connections;
    connectStdio(id: string, command: string, args: string[], cmdCtx: CommandContext, options?: StdioTransportOptions): Promise<McpServerConnection>;
    connectHttp(id: string, url: string, bash?: McpBashLike, securityConfig?: HttpTransportSecurityConfig): Promise<McpServerConnection>;
    private discoverTools;
    callTool(connectionId: string, toolName: string, args: Record<string, unknown>, bash?: McpBashLike): Promise<unknown>;
    listConnections(): McpServerConnection[];
    disconnect(id: string): void;
    /** Release all resources and disconnect all servers. */
    dispose(): Promise<void>;
}
export {};
