import type { MCPClient } from './types.js'; import type { ToolRegistry } from '../tool/registry.js'; /** MCP 工具名前缀,用于与 builtin/skill 等工具区分 */ export declare const MCP_TOOL_PREFIX = "mcp_"; /** * 将名称中的非安全字符替换为下划线,确保可安全用于工具名拼接 */ export declare function sanitizeForToolName(name: string): string; /** * 构建带命名空间的 MCP 工具名 * * - 连接器工具:`mcp_{connectorId}_{serverName}_{toolName}` * - 独立工具:`mcp_{serverName}_{toolName}` * * 命名空间从根源上解决多 MCP 服务器工具名冲突问题。 */ export declare function buildMCPToolName(toolName: string, serverName: string, connectorId?: string): string; /** * 将 MCP 服务的远程工具批量注册到 ToolRegistry * * 工具名自动添加命名空间前缀 `mcp_[{connectorId}_]{serverName}_{toolName}`, * 避免多 MCP 服务器间工具名冲突。调用 MCP 服务时使用原始名字。 * * @param connectorId 连接器 ID(公有 MCP 服务器传 undefined,连接器私有传连接器 ID) */ export declare function registerMCPTools(registry: ToolRegistry, mcpClient: MCPClient, serverName: string, connectorId?: string, serverId?: number | string, /** * 该服务器的工具定义(来自配置/toolDefinitions)。 * 工具的展示名取自其自身定义:优先 toolDef.label,否则 toolDef.name(用户配置的中文名), * 再回退到 MCP 协议的 Tool.title,最后回退到原始名。 * 这样展示名完全由工具定义决定,无需在 prompt-builder 里硬编码映射。 */ toolDefinitions?: ReadonlyArray<{ name?: string; label?: string; }>): Promise; //# sourceMappingURL=client.d.ts.map