import type { AIProviderName, ToolUtilities } from "../../types/index.js";
import type { NeuroLink } from "../../neurolink.js";
import type { Tool } from "../../types/index.js";
/**
 * Build an argument validator for an external MCP tool's JSON Schema, in the
 * shape the AI SDK's `jsonSchema()` wrapper expects. Returns undefined when
 * the schema can't be compiled (exotic dialect) — the tool then keeps the
 * previous declarative-only behaviour instead of failing registration.
 *
 * The error message is written for the MODEL (it is fed back verbatim as the
 * tool-error text): it names the offending fields and restates the contract
 * (required properties + types) so the retry can succeed on the first attempt.
 */
export declare function buildMCPSchemaValidator(toolName: string, schema: Record<string, unknown>): Promise<((value: unknown) => {
    success: true;
    value: unknown;
} | {
    success: false;
    error: Error;
}) | undefined>;
/**
 * ToolsManager class - Handles all tool management operations
 */
export declare class ToolsManager {
    private readonly providerName;
    private readonly directTools;
    private readonly neurolink?;
    private readonly utilities?;
    protected mcpTools?: Record<string, Tool>;
    protected customTools?: Map<string, unknown>;
    protected toolExecutor?: (toolName: string, params: unknown, options?: Record<string, unknown>) => Promise<unknown>;
    protected sessionId?: string;
    protected userId?: string;
    constructor(providerName: AIProviderName, directTools: Record<string, unknown>, neurolink?: NeuroLink | undefined, utilities?: ToolUtilities | undefined);
    /**
     * BZ-666: Wrap tool execute with output truncation to prevent
     * context overflow when large results flow into the AI SDK accumulator.
     *
     * Passes the AI-SDK second argument (execution options: abortSignal,
     * toolCallId, messages) through to the inner execute — the native loops
     * provide an abortSignal there, and dropping it at this wrapper made
     * every tool uncancellable (deadline overshoot / ghost executions).
     */
    private wrapExecuteWithTruncation;
    /**
     * BZ-666: Apply generateToolOutputPreview to tool results to prevent
     * context overflow when large results flow into the AI SDK accumulator.
     */
    private truncateToolResult;
    /**
     * Set session context for MCP tools
     */
    setSessionContext(sessionId?: string, userId?: string): void;
    private emitToolEvent;
    /**
     * Set up tool executor for a provider to enable actual tool execution
     * @param sdk - The NeuroLinkSDK instance for tool execution
     * @param functionTag - Function name for logging
     */
    setupToolExecutor(sdk: {
        customTools: Map<string, unknown>;
        executeTool: (toolName: string, params: unknown) => Promise<unknown>;
    }, functionTag: string): void;
    /**
     * Get all available tools - direct tools are ALWAYS available
     * MCP tools are added when available (without blocking)
     */
    getAllTools(): Promise<Record<string, Tool>>;
    /**
     * Get direct tools (built-in agent tools)
     */
    getDirectTools(): Record<string, unknown>;
    /**
     * Get MCP tools
     */
    getMCPTools(): Record<string, Tool> | undefined;
    /**
     * Get custom tools
     */
    getCustomTools(): Map<string, unknown> | undefined;
    /**
     * Process direct tools with event emission wrapping
     */
    private processDirectTools;
    /**
     * Process custom tools from setupToolExecutor
     */
    private processCustomTools;
    /**
     * Process MCP tools integration
     */
    private processMCPTools;
    /**
     * Process external MCP tools
     */
    private processExternalMCPTools;
    /**
     * Create a custom tool from tool definition
     */
    private createCustomToolFromDefinition;
    /**
     * Create an external MCP tool
     */
    private createExternalMCPTool;
}
