import type { AgentToolConfig } from '@contractspec/lib.contracts-spec/agent'; /** * Tool consumer for external agents. * * Enables external agent SDKs to consume ContractSpec tools: * - Create MCP servers exposing tools * - Export tools for specific SDK formats * - Bridge tool execution */ import type { ToolExecutionContext, ToolHandler } from '../types'; import type { ToolConsumer, ToolConsumerConfig, ToolExportFormat, ToolServer, ToolServerConfig } from './types'; /** * ContractSpec tool consumer for external agents. */ export declare class ContractSpecToolConsumer implements ToolConsumer { private readonly tools; private readonly locale?; constructor(config: ToolConsumerConfig); /** * Create an MCP server exposing the tools. */ createToolServer(config?: Partial): ToolServer; /** * Export tools for a specific SDK format. */ exportToolsForSDK(format: ToolExportFormat): unknown[]; /** * Create a bridged handler for a specific SDK. */ createBridgedHandler(toolName: string, _format: ToolExportFormat): ((args: Record) => Promise) | undefined; /** * Get all tools. */ getTools(): AgentToolConfig[]; /** * Get a specific tool. */ getTool(name: string): AgentToolConfig | undefined; /** * Check if a tool exists. */ hasTool(name: string): boolean; /** * Execute a tool. */ executeTool(name: string, args: Record, context?: ToolExecutionContext): Promise; /** * Add a tool. */ addTool(config: AgentToolConfig, handler?: ToolHandler): void; /** * Remove a tool. */ removeTool(name: string): boolean; /** * Get tool count. */ getToolCount(): number; } /** * Create a new tool consumer. */ export declare function createToolConsumer(config: ToolConsumerConfig): ToolConsumer; /** * Create an MCP tool server from tools. */ export declare function createToolServer(config: ToolServerConfig): ToolServer; /** * Export tools to a specific SDK format. */ export declare function exportToolsForExternalSDK(tools: AgentToolConfig[], format: ToolExportFormat): unknown[];