import { McpClient } from './client.js';
import type { McpToolSchema } from './client.js';
import type { McpServerConfig } from './config.js';
import type { HookDispatcher } from '../hooks/dispatcher.js';
import type { McpDecisionRecord, QuarantineReason, SchemaFreshness } from '../runtime/mcp/types.js';
import type { RuntimeEventBus } from '../runtime/events/index.js';
import type { ConfigManager } from '../config/manager.js';
import type { McpConfigRoots } from './config.js';
import { type SandboxSessionRegistry } from '../runtime/sandbox/session-registry.js';
export interface RegisteredTool {
    /** Fully-qualified tool name: mcp:<server>:<tool> */
    qualifiedName: string;
    serverName: string;
    toolName: string;
    description: string;
}
export declare class McpRegistry {
    private clients;
    private permissions;
    private freshness;
    private runtimeBus;
    private sandboxConfigManager;
    private sandboxSessions;
    private sandboxSessionByServer;
    private readonly hookDispatcher;
    constructor(options: {
        readonly hookDispatcher: Pick<HookDispatcher, 'fire'>;
        readonly sandboxSessions: SandboxSessionRegistry;
    });
    setRuntimeBus(runtimeBus: RuntimeEventBus | null): void;
    setSandboxRuntime(configManager: ConfigManager, sessions: SandboxSessionRegistry): void;
    /**
     * connectAll — Load config from .goodvibes/mcp.json and connect to all servers.
     * Errors on individual servers are logged but do not abort the whole startup.
     */
    connectAll(roots: McpConfigRoots): Promise<void>;
    /**
     * connectServer — Connect a single MCP server by config.
     * Exposed for programmatic use (testing, dynamic registration).
     */
    connectServer(serverConfig: McpServerConfig): Promise<void>;
    /**
     * listAllTools — Return all registered tools (name + description) from all connected servers.
     * Only loads tool names and descriptions — full schemas are NOT fetched here.
     */
    listAllTools(): Promise<RegisteredTool[]>;
    /**
     * getToolSchema — Fetch full JSON schema for a qualified tool name.
     * Triggers lazy schema load and caches within McpClient.
     */
    getToolSchema(qualifiedName: string): Promise<McpToolSchema | null>;
    /**
     * callTool — Execute a tool by its qualified name.
     * Fetches the full schema on first use.
     */
    callTool(qualifiedName: string, args: Record<string, unknown>): Promise<unknown>;
    /**
     * disconnectAll — Stop all connected MCP server processes.
     */
    disconnectAll(): Promise<void>;
    /**
     * getClient — Get the McpClient for a given server name (for advanced use).
     */
    getClient(serverName: string): McpClient | undefined;
    /** Connected server names. */
    get serverNames(): string[];
    /**
     * listServers — Return status info for all known servers (connected or not).
     */
    listServers(): Array<{
        name: string;
        connected: boolean;
    }>;
    listServerSecurity(): Array<{
        name: string;
        connected: boolean;
        role: import('../runtime/mcp/types.js').McpServerRole;
        trustMode: import('../runtime/mcp/types.js').McpTrustMode;
        allowedPaths: string[];
        allowedHosts: string[];
        schemaFreshness: SchemaFreshness;
        quarantineReason?: QuarantineReason | undefined;
        quarantineDetail?: string | undefined;
        quarantineApprovedBy?: string | undefined;
    }>;
    listServerSandboxBindings(): Array<{
        name: string;
        sessionId?: string | undefined;
        profileId?: 'mcp-shared' | 'mcp-per-server' | undefined;
        state?: import('../runtime/sandbox/types.js').SandboxSessionState | undefined;
        backend?: import('../runtime/sandbox/types.js').SandboxResolvedBackend | import('../runtime/sandbox/types.js').SandboxVmBackend | undefined;
        startupStatus?: 'verified' | 'planned' | 'failed' | undefined;
    }>;
    setServerTrustMode(serverName: string, mode: import('../runtime/mcp/types.js').McpTrustMode): void;
    setServerRole(serverName: string, role: import('../runtime/mcp/types.js').McpServerRole): void;
    listRecentSecurityDecisions(limit?: number): McpDecisionRecord[];
    quarantineSchema(serverName: string, reason: QuarantineReason, detail?: string): void;
    approveSchemaQuarantine(serverName: string, operatorId: string): void;
    private _connectServer;
    private _resolveSandboxProcessSpec;
    private _selectSandboxProfile;
    private _requiresDedicatedMcpSandbox;
    private _handleClientNotification;
    private _handleClientServerRequest;
    private _handleClientUnhandledResponse;
    /**
     * Parse mcp:<server>:<tool> qualified name.
     * Returns null if the name doesn't match the expected format.
     */
    private _parseQualifiedName;
    private _emitPolicyUpdate;
}
//# sourceMappingURL=registry.d.ts.map