import { type ToolCallResult } from './mcp-client.js';
import type { ToolDef } from './provider-base.js';
/** Exponential backoff for the Nth consecutive reconnect failure. First
 *  attempt (failures=0) waits `base`; each subsequent failure doubles
 *  until `cap`. Exported for unit tests. */
export declare function computeReconnectCooldownMs(failures: number, base?: number, cap?: number): number;
/**
 * Build McpClient instances from config. Idempotent — repeated calls
 * fully replace the previous state (any open connections are closed
 * first via closeAll).
 */
export declare function loadFromConfig(cfg: {
    mcpServers?: unknown;
}): Promise<void>;
/**
 * Connect every registered client. Failures are recorded in
 * `state.unhealthy` so a broken server doesn't poison the startup
 * sequence. Returns a summary so callers (cli.ts boot log) can print
 * something useful.
 */
export declare function connectAll(): Promise<{
    ok: string[];
    failed: Record<string, string>;
    toolCount: number;
}>;
/** All tools across every connected client. Safe to call before
 *  connectAll (returns []). The order is insertion order of the
 *  mcpServers config — useful for the web UI listing. */
export declare function getAllTools(): ToolDef[];
/** Look up which server owns a given namespaced tool name. */
export declare function getOwningServer(callName: string): string | null;
/**
 * Dispatch a tool call to the right client. Returns a "tool unknown"
 * error result rather than throwing; the agent loop converts that into
 * a `{role:'tool', isError:true}` message so the model can recover.
 */
export declare function callToolByName(callName: string, args: Record<string, unknown>, opts?: {
    signal?: AbortSignal;
}): Promise<ToolCallResult>;
/**
 * Snapshot for cli.ts boot log + future web UI. Reports server count,
 * total advertised tools, and which servers are unhealthy.
 */
export declare function describeRegistry(): {
    servers: Array<{
        name: string;
        connected: boolean;
        toolCount: number;
        error?: string;
    }>;
    totalTools: number;
};
/**
 * Close every client connection. Idempotent — safe to call from
 * graceful shutdown paths even when nothing is connected.
 */
export declare function closeAll(): Promise<void>;
/** Test-only: clear without close. Use only in test setups where the
 *  real clients were never instantiated. */
export declare function _resetRegistry(): void;
//# sourceMappingURL=mcp-registry.d.ts.map