import { type ResultValue } from "../runtime/index.js"; import type { AgencyFunction } from "../runtime/agencyFunction.js"; type McpServerConfig = Record; export type McpServers = Record; export declare function _isMcpAvailable(): boolean; /** Read the project agency.json mcpServers block. Hardened: readMcpConfig uses * zod .parse which THROWS on a malformed block, and an Agency `catch` only * intercepts Failure Results (not thrown JS), so a bad agency.json would crash * startup. We swallow to {} with a warning instead. */ export declare function _readProjectMcpConfig(cwd: string): Promise>; export type McpLoadResult = { tools: AgencyFunction[]; status: Record; }; /** Project wins over global on name collision. Merges into a NULL-PROTOTYPE * target: server names are user-controlled (agency.json / settings.json), and * a key like "__proto__" — which the config schema's name regex permits — * must become a plain data key, never mutate a prototype. */ export declare function _mergeMcpServers(global: McpServers, project: McpServers): McpServers; export declare function _loadMcpToolsForServer(server: string, merged: McpServers, onOAuthRequired?: (d: unknown) => void | Promise): Promise; /** Load every configured server and report per-server status. Returns flat * tools plus a { server -> "connected" | "unavailable" } map for `/mcp`. */ export declare function _loadMcpToolsWithStatus(merged: McpServers, onOAuthRequired?: (d: unknown) => void | Promise): Promise; export declare function _loadMcpTools(merged: McpServers, onOAuthRequired?: (d: unknown) => void | Promise): Promise; /** Validate an mcpServers map through the package schema. success() when valid, * failure(message) otherwise — including a clear message when the package is * absent or too old to expose the validator. */ export declare function _validateMcpServers(servers: McpServers): Promise; /** The mcpServers map from a config file. Lenient: a missing or unparseable * file reads as no servers (used by `list`, which must never crash). */ export declare function _readMcpServersFromFile(file: string): McpServers; /** Validate `config`, then add/overwrite it in `file`, preserving every other * top-level key (null-prototype servers map). Creates the file if absent; * never overwrites an existing-but-unparseable file. */ export declare function _addMcpServer(name: string, config: McpServerConfig, file: string): Promise; /** Remove one server from `file`. success(true) if it existed and was removed, * success(false) if it was not present, failure() if the file is unparseable. */ export declare function _removeMcpServer(name: string, file: string): Promise; export {};