import type { ClientToBroker } from '../../../core/runtime/broker-protocol.js'; import type { Picker } from './pickers.js'; /** One configured MCP server, joined against the adapter's tool cache. */ export interface McpServerRow { name: string; /** 'http' | 'sse' | 'stdio' — the config's `type`, or inferred (url → http, command → stdio). */ transport: string; /** The connection target: the url (http) or the command line (stdio). */ target: string; /** Cached tool count, or null when the server has no cache entry (never connected). */ toolCount: number | null; /** True when a cache entry exists but its configHash no longer matches the * current config — the adapter treats that cache as a miss, so the tool * count is stale. Always false when toolCount is null. */ stale: boolean; } /** Read + merge the adapter's config sources (see file header) and join the * tool cache into display rows. Returns [] when nothing is configured. */ export declare function readMcpServers(home?: string, cwd?: string): McpServerRow[]; /** The hint shown when no source configures any server — lists the same * sources readMcpServers actually reads (mirroring the adapter). */ export declare const MCP_EMPTY_STATE_HINT = "No MCP servers configured \u2014 add one to ~/.config/mcp/mcp.json, ~/.pi/agent/mcp.json, /.mcp.json, or /.pi/mcp.json"; /** Enter on a row: bridge the right adapter action to the engine via a * `prompt` frame. Never connected → OAuth kick-off; connected before → * reconnect, falling back to auth-start (the re-auth path — expired OAuth * still shows as cached, so reconnect must always be reachable). */ export declare function startMcpServerAction(row: McpServerRow, send: (frame: ClientToBroker) => void, notify: (message: string) => void): void; /** Build the /mcp status panel as an inline picker. Enter on any row acts: * never-connected → OAuth kick-off, cached → reconnect/re-auth (see * startMcpServerAction). Status reflects the CACHE — "cached" means the * server connected before under this config, not that it is connected now. */ export declare function buildMcpPicker(rows: McpServerRow[], send: (frame: ClientToBroker) => void, close: () => void, notify: (message: string) => void): Picker;