/** * MCP domain state, tracks all MCP server connections, their lifecycle * state, and available tools per server. */ /** States for the MCP server lifecycle machine. */ export type McpServerLifecycleState = 'configured' | 'connecting' | 'connected' | 'degraded' | 'auth_required' | 'reconnecting' | 'disconnected'; /** A tool registered by an MCP server. */ export interface McpRegisteredTool { /** Fully qualified tool name ("__"). */ qualifiedName: string; /** MCP server that provides this tool. */ serverName: string; /** Tool name on the server. */ toolName: string; /** Tool description. */ description: string; /** Whether this tool is currently callable (server is connected). */ available: boolean; } /** Health and connection record for a single MCP server. */ export interface McpServerRecord { /** Server name (from MCP config). */ name: string; /** Server display name or label. */ displayName: string; /** Current lifecycle state. */ status: McpServerLifecycleState; /** Transport type used by this server. */ transport: 'stdio' | 'sse' | 'http'; /** Number of tools registered by this server. */ toolCount: number; /** Qualified names of all tools from this server. */ toolNames: string[]; /** Number of successful tool calls to this server. */ callCount: number; /** Number of failed tool calls to this server. */ errorCount: number; /** Epoch ms of connection establishment. */ connectedAt?: number | undefined; /** Epoch ms of last tool call. */ lastCallAt?: number | undefined; /** Last error message. */ lastError?: string | undefined; /** Number of reconnect attempts. */ reconnectAttempts: number; /** Runtime trust mode for this server. */ trustMode: import('../../mcp/types.js').McpTrustMode; /** High-level role used for coherence evaluation. */ role: import('../../mcp/types.js').McpServerRole; /** Allowed filesystem scope. */ allowedPaths: string[]; /** Allowed network host scope. */ allowedHosts: string[]; /** Current schema freshness state. */ schemaFreshness: import('../../mcp/types.js').SchemaFreshness; /** Active quarantine reason when schema execution is blocked. */ quarantineReason?: import('../../mcp/types.js').QuarantineReason | undefined; /** Human-readable quarantine detail. */ quarantineDetail?: string | undefined; /** Operator id that approved the last quarantine override. */ quarantineApprovedBy?: string | undefined; } /** * McpDomainState, all MCP server connections and tool registry. */ export interface McpDomainState { /** Monotonic revision counter; increments on every mutation. */ revision: number; /** Timestamp of last mutation (Date.now()). */ lastUpdatedAt: number; /** Subsystem that triggered the last mutation. */ source: string; /** All MCP servers keyed by server name. */ servers: Map; /** Names of servers currently in 'connected' state. */ connectedServerNames: string[]; /** All registered MCP tools keyed by qualifiedName. */ tools: Map; /** Total number of available (callable) tools. */ availableToolCount: number; /** Total MCP tool calls this session. */ totalCalls: number; /** Total MCP tool call failures. */ totalErrors: number; } /** * Returns the default initial state for the MCP domain. */ export declare function createInitialMcpState(): McpDomainState; //# sourceMappingURL=mcp.d.ts.map