/**
 * Tool bridge for converting between ContractSpec and Claude Agent SDK tool formats.
 *
 * Provides bidirectional conversion:
 * - ContractSpec AgentToolConfig → Claude Agent SDK tool
 * - Claude Agent SDK tool → ContractSpec AgentToolConfig
 */
import type { AgentToolConfig } from '../../spec/spec';
import type { ToolHandler, ToolExecutionContext } from '../../types';
import type { ExternalToolDefinition } from '../types';
/**
 * Claude Agent SDK tool definition.
 * Based on Anthropic's tool format.
 */
export interface ClaudeAgentTool {
    /** Tool name */
    name: string;
    /** Tool description */
    description: string;
    /** Input schema in JSON Schema format */
    input_schema: {
        type: 'object';
        properties?: Record<string, unknown>;
        required?: string[];
        additionalProperties?: boolean;
    };
    /** Whether tool requires confirmation before execution */
    requires_confirmation?: boolean;
    /** Tool category for organization */
    category?: string;
}
/**
 * Claude Agent SDK tool result.
 */
export interface ClaudeAgentToolResult {
    /** Tool call ID this result corresponds to */
    tool_use_id: string;
    /** Result content */
    content: string | ClaudeAgentToolResultContent[];
    /** Whether the tool execution failed */
    is_error?: boolean;
}
/**
 * Claude Agent SDK tool result content block.
 */
export interface ClaudeAgentToolResultContent {
    type: 'text' | 'image';
    text?: string;
    source?: {
        type: 'base64';
        media_type: string;
        data: string;
    };
}
/**
 * Convert a ContractSpec AgentToolConfig to Claude Agent SDK tool format.
 *
 * @param tool - ContractSpec tool configuration
 * @param handler - Tool handler function
 * @param context - Partial execution context to inject
 * @returns Claude Agent SDK tool definition with execute function
 */
export declare function specToolToClaudeAgentTool(tool: AgentToolConfig, handler: ToolHandler, context: Partial<ToolExecutionContext>): ClaudeAgentTool & {
    execute: (input: unknown) => Promise<unknown>;
};
/**
 * Convert multiple ContractSpec tools to Claude Agent SDK format.
 */
export declare function specToolsToClaudeAgentTools(tools: AgentToolConfig[], handlers: Map<string, ToolHandler>, context: Partial<ToolExecutionContext>): (ClaudeAgentTool & {
    execute: (input: unknown) => Promise<unknown>;
})[];
/**
 * Convert a Claude Agent SDK tool to ContractSpec AgentToolConfig.
 * This enables importing tools defined in Claude Agent SDK format.
 *
 * @param claudeTool - Claude Agent SDK tool definition
 * @param execute - Optional execute function to wrap
 * @returns ContractSpec tool config and optional handler
 */
export declare function claudeAgentToolToSpecTool(claudeTool: ClaudeAgentTool, execute?: (input: unknown) => Promise<unknown>): {
    config: AgentToolConfig;
    handler?: ToolHandler;
};
/**
 * Convert multiple Claude Agent SDK tools to ContractSpec format.
 */
export declare function claudeAgentToolsToSpecTools(claudeTools: (ClaudeAgentTool & {
    execute?: (input: unknown) => Promise<unknown>;
})[]): {
    configs: AgentToolConfig[];
    handlers: Map<string, ToolHandler>;
};
/**
 * Convert ContractSpec tool to ExternalToolDefinition format.
 */
export declare function specToolToExternalTool(tool: AgentToolConfig, handler?: ToolHandler, context?: Partial<ToolExecutionContext>): ExternalToolDefinition;
/**
 * Extract tool call info from Claude Agent SDK response.
 */
export declare function extractToolCalls(response: {
    content?: {
        type: string;
        id?: string;
        name?: string;
        input?: unknown;
    }[];
}): {
    toolCallId: string;
    toolName: string;
    args: unknown;
}[];
