/**
 * MCP client types — config and connection interfaces.
 *
 * 0 internal imports — any layer can import from here.
 */
import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
import type { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
import type { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
export interface McpConfig {
    mcpServers: Record<string, McpServerConfig>;
}
export interface McpStdioServerConfig {
    /** Command to spawn the server */
    command: string;
    /** Arguments to the command */
    args?: string[];
    /** Environment variables merged onto the default env (non-sensitive values only) */
    env?: Record<string, string>;
    /** Name of a /connect connection whose fields are injected as env vars (secrets stay in OS keychain) */
    connection?: string;
    /** Working directory for the server process (default: cwd) */
    cwd?: string;
    /** Deprecated alias for startupTimeoutMs. Kept for config compatibility. */
    timeout?: number;
    /** Startup/connect timeout in ms (default: 30000) */
    startupTimeoutMs?: number;
    /** Per-tool-call inactivity timeout in ms (default: 600000 / 10 minutes) */
    toolCallTimeoutMs?: number;
    /**
     * Whether MCP progress notifications reset the inactivity timeout.
     * Default: true.
     */
    resetToolCallTimeoutOnProgress?: boolean;
    /**
     * Optional absolute wall-clock cap for a single MCP tool call.
     * When omitted, no max total timeout is enforced beyond the inactivity timeout.
     */
    maxToolCallTotalTimeoutMs?: number;
}
export interface McpOAuthConfig {
    providerId?: string;
    providerName?: string;
    clientId?: string;
    clientSecret?: string;
    redirectUrl?: string;
    scope?: string;
    resource?: string;
    resourceMetadataUrl?: string;
}
export interface McpHostedServerConfig {
    transport: 'streamable_http';
    url: string;
    /** Static headers to include on every request. */
    headers?: Record<string, string>;
    /** Connection name whose fields are injected as HTTP headers. */
    connection?: string;
    /** OAuth configuration for hosted MCP login via /login. */
    oauth?: McpOAuthConfig;
    /** Deprecated alias for startupTimeoutMs. Kept for config compatibility. */
    timeout?: number;
    /** Startup/connect timeout in ms (default: 30000) */
    startupTimeoutMs?: number;
    /** Per-tool-call inactivity timeout in ms (default: 600000 / 10 minutes) */
    toolCallTimeoutMs?: number;
    resetToolCallTimeoutOnProgress?: boolean;
    maxToolCallTotalTimeoutMs?: number;
}
export type McpServerConfig = McpStdioServerConfig | McpHostedServerConfig;
export type McpAuthStatus = 'unsupported' | 'not_logged_in' | 'configured' | 'oauth';
export type McpFailureKind = 'auth_required' | 'connect_failed';
export declare function isHostedServerConfig(config: McpServerConfig): config is McpHostedServerConfig;
export declare function isStdioServerConfig(config: McpServerConfig): config is McpStdioServerConfig;
export type McpTransport = StdioClientTransport | StreamableHTTPClientTransport;
export interface McpRequestPolicy {
    timeoutMs: number;
    resetTimeoutOnProgress: boolean;
    maxTotalTimeoutMs?: number;
}
export interface McpConnection {
    name: string;
    client: Client;
    transport: McpTransport;
    tools: McpToolInfo[];
    requestPolicy: McpRequestPolicy;
    reconnect?: () => Promise<McpConnection | null>;
}
export interface McpToolInfo {
    name: string;
    description?: string;
    parameterNames: string[];
    inputSchema: Record<string, unknown>;
}
export interface McpServerStatus {
    name: string;
    status: 'connected' | 'failed';
    transport: 'stdio' | 'streamable_http';
    authStatus: McpAuthStatus;
    failureKind?: McpFailureKind;
    oauthProviderId?: string;
    oauthProviderName?: string;
    toolCount: number;
    toolNames: string[];
    error?: string;
}
export interface McpManager {
    tools: unknown[];
    /** Summary string: "github (7 tools), postgres (4 tools)" */
    statusLine: string;
    /** Directory containing the global mcp.json used by this manager. */
    globalConfigDir: string;
    /** Per-server status for the /mcp command */
    servers: McpServerStatus[];
    shutdown(): void;
}
//# sourceMappingURL=types.d.ts.map