import { ProxyClient } from "./proxy-client.js";
import { LocalProxy } from "./local-proxy.js";
/** Common interface for LocalProxy and ProxyClient */
export interface ProxyLike {
    callTool(toolName: string, toolInput?: Record<string, unknown>): Promise<unknown>;
}
export declare function getLocalProxyInstance(): LocalProxy | null;
export declare function setLocalProxyInstance(proxy: LocalProxy): void;
/**
 * Get the appropriate proxy for a given alias.
 * In local mode: returns a wrapper around the shared LocalProxy that
 *   routes calls through the specific caller alias's routes.
 * In remote mode: returns a cached ProxyClient for the alias.
 */
export declare function getProxy(alias: string): ProxyLike | null;
/**
 * Get a ProxyClient for a specific key alias (remote mode).
 * Creates and caches the client on first call. Returns null if keys
 * are missing or client creation fails.
 */
export declare function getProxyClient(alias: string): ProxyClient | null;
/**
 * Check whether the proxy is configured (mcpConfigDir set with appropriate mode config).
 */
export declare function isProxyConfigured(): boolean;
/**
 * Get all configured aliases that have valid key files.
 */
export declare function getConfiguredAliases(): string[];
/**
 * Remove a cached client, forcing a fresh ProxyClient on next getProxyClient() call.
 */
export declare function resetClient(alias: string): void;
/**
 * Clear all cached clients and failed aliases.
 */
export declare function resetAllClients(): void;
/**
 * Handle proxy mode switching at runtime.
 *
 * When switching to "local": creates and starts a LocalProxy instance.
 * When switching away from "local": stops and clears the LocalProxy.
 * Always resets cached remote ProxyClient instances.
 */
export declare function switchProxyMode(newMode: string | undefined): Promise<void>;
/**
 * @deprecated Use getProxyClient(alias) instead
 */
export declare function getSharedProxyClient(): ProxyClient | null;
export interface ConnectionTestResult {
    /** "unreachable" | "handshake_failed" | "connected" */
    status: "unreachable" | "handshake_failed" | "connected";
    /** Human-readable detail */
    message: string;
    /** Number of routes discovered (only when connected) */
    routeCount?: number;
}
/**
 * Test connectivity to a remote proxy server.
 *
 * 1. Health check — is the server reachable?
 * 2. Full handshake — are keys valid and authorized?
 * 3. List routes — can we make authenticated requests?
 */
export declare function testRemoteConnection(url: string, alias: string): Promise<ConnectionTestResult>;
//# sourceMappingURL=proxy-singleton.d.ts.map