import { ChatCompletionFunctionTool } from "openai/resources.js";
import type { ToolPlugin, ToolResult, ToolContext } from "../tools/types.js";
import { Container } from "../utils/container.js";
import type { Logger, McpServerConfig, McpConfig, McpTool, McpServerStatus } from "../types/index.js";
export interface McpManagerCallbacks {
    onServersChange?: (servers: McpServerStatus[]) => void;
}
export interface McpManagerOptions {
    callbacks?: McpManagerCallbacks;
    logger?: Logger;
}
/**
 * Expand environment variables in a string value.
 * Supports ${VAR} and ${VAR:-default} patterns.
 */
export declare function expandEnvVars(value: string): string;
/**
 * Walk an MCP config and expand env vars in all string fields.
 */
export declare function resolveMcpConfig(config: McpConfig): McpConfig;
export declare class McpManager {
    private container;
    private config;
    private servers;
    private connections;
    private configPath;
    private workdir;
    private callbacks;
    constructor(container: Container, options?: McpManagerOptions);
    /**
     * Initialize MCP manager with working directory and optionally auto-connect
     */
    initialize(workdir: string, autoConnect?: boolean): Promise<void>;
    ensureConfigLoaded(): Promise<McpConfig | null>;
    loadConfig(): Promise<McpConfig | null>;
    saveConfig(config: McpConfig): Promise<boolean>;
    getConfig(): McpConfig | null;
    getAllServers(): McpServerStatus[];
    getServer(name: string): McpServerStatus | undefined;
    updateServerStatus(name: string, updates: Partial<McpServerStatus>): void;
    addServer(name: string, config: McpServerConfig): boolean;
    removeServer(name: string): boolean;
    connectServer(name: string): Promise<boolean>;
    disconnectServer(name: string): Promise<boolean>;
    getAllConnectedTools(): McpTool[];
    executeMcpTool(toolName: string, args: Record<string, unknown>, context?: ToolContext): Promise<{
        success: boolean;
        content: string;
        serverName?: string;
        images?: Array<{
            data: string;
            mediaType?: string;
        }>;
    }>;
    private executeToolOnConnection;
    cleanup(): Promise<void>;
    /**
     * Get all currently available MCP tools as plugins
     */
    getMcpToolPlugins(): ToolPlugin[];
    /**
     * Get all currently available MCP tools as OpenAI function tools
     */
    getMcpToolsConfig(): ChatCompletionFunctionTool[];
    /**
     * Execute an MCP tool by name (registry version)
     */
    executeMcpToolByRegistry(name: string, args: Record<string, unknown>, context: ToolContext): Promise<ToolResult>;
    /**
     * Check if a tool name belongs to an MCP tool
     */
    isMcpTool(name: string): boolean;
}
//# sourceMappingURL=mcpManager.d.ts.map