/** * Operation-as-tool: creates a ToolHandler that executes a ContractSpec operation. * * One contract → REST, GraphQL, MCP, agent tool. When an agent tool has * operationRef, this module provides the handler that delegates to * OperationSpecRegistry.execute. */ import type { OperationRef } from '@contractspec/lib.contracts-spec/agent'; import type { OperationSpecRegistry } from '@contractspec/lib.contracts-spec/operations/registry'; import type { ToolHandler } from '../types'; /** * Create a ToolHandler that executes a ContractSpec operation. * * @param registry - OperationSpecRegistry with the operation registered and handler bound * @param operationRef - Reference to the operation (key, optional version) * @returns ToolHandler that delegates to registry.execute * * @example * ```typescript * const handler = createOperationToolHandler(opsRegistry, { key: 'knowledge.search', version: '1.0.0' }); * toolHandlers.set('search_knowledge', handler); * ``` */ export declare function createOperationToolHandler(registry: OperationSpecRegistry, operationRef: OperationRef): ToolHandler;