import type { MCPClient } from '../mcp/mcp-client.js';
import type { TuneConfig } from '../types/config.js';
import type { CustomToolApprovalPolicy } from '../types/custom-tools.js';
import type { AISDKCoreTool, DevelopmentMode, MCPInitResult, MCPServer, MCPTool, StreamingFormatter, ToolEntry, ToolFormatter, ToolHandler, ToolValidator } from '../types/index.js';
/**
 * Filter knob for tool access methods. Default behavior hides scoped
 * skill tools; pass `forSkill` to opt back in for tools owned by that
 * skill (typically by its own subagent).
 */
export interface ToolVisibilityOptions {
    forSkill?: string;
}
/**
 * Manages built-in tools, MCP tools, and file-based custom tools.
 * Single authority for tool availability, filtering, and approval policy.
 */
export declare class ToolManager {
    private registry;
    private mcpClient;
    private customTools;
    constructor();
    /**
     * Initialize MCP servers and register their tools
     */
    initializeMCP(servers: MCPServer[], onProgress?: (result: MCPInitResult) => void): Promise<MCPInitResult[]>;
    /**
     * Load file-based custom tools from `.nanocoder/tools/` (project) and
     * the personal tools directory. Project tools override personal ones.
     * Custom tools whose name collides with a built-in or already-registered
     * MCP tool are skipped with an error. Returns a per-tool load summary so
     * callers can surface counts/errors at startup.
     */
    initializeCustomTools(projectRoot?: string): {
        loaded: string[];
        errors: Array<{
            file: string;
            error: string;
        }>;
    };
    /**
     * Get the list of tool names available given the current mode and tune config.
     * This is the single authority used by both prompt building and runtime.
     */
    getAvailableToolNames(tuneConfig?: TuneConfig, developmentMode?: DevelopmentMode, disabledTools?: string[], model?: string): string[];
    getAllTools(opts?: ToolVisibilityOptions): Record<string, AISDKCoreTool>;
    getFilteredTools(allowedToolNames: string[], opts?: ToolVisibilityOptions): Record<string, AISDKCoreTool>;
    /**
     * Drop scoped tools unless the caller opts in by passing the owning
     * skill's name. Tools without `scoped` set (built-ins, MCP, custom
     * tools, single-file skill tools) pass through untouched.
     */
    private applyVisibility;
    private filterByNames;
    getToolRegistry(): Record<string, ToolHandler>;
    getToolHandler(toolName: string): ToolHandler | undefined;
    getToolFormatter(toolName: string): ToolFormatter | undefined;
    getToolValidator(toolName: string): ToolValidator | undefined;
    getStreamingFormatter(toolName: string): StreamingFormatter | undefined;
    isReadOnly(toolName: string): boolean;
    hasTool(toolName: string): boolean;
    /**
     * Register a skill-provided tool. Wraps the registry call so the
     * registrar doesn't have to reach through `ToolManager` into
     * `ToolRegistry`. The entry's `ownerSkill` tag is preserved.
     */
    registerSkillTool(entry: ToolEntry): void;
    /**
     * Unregister a previously-registered skill-provided tool. Returns true
     * if the tool was found and removed.
     */
    unregisterSkillTool(toolName: string): boolean;
    /**
     * Return the tool entry's `ownerSkill` tag, if any. Used by callers
     * (e.g. `/tools`, scoped-visibility filters) to attribute a tool back
     * to the skill that registered it.
     */
    getOwnerSkill(toolName: string): string | undefined;
    isCustomTool(toolName: string): boolean;
    getCustomToolInfo(toolName: string): {
        approval: CustomToolApprovalPolicy;
        readOnly: boolean;
        source: 'personal' | 'project';
        filePath: string;
        subscribe?: import('../types/skills.js').SkillTrigger[];
    } | undefined;
    getCustomToolNames(): string[];
    getMCPToolInfo(toolName: string): {
        isMCPTool: boolean;
        serverName?: string;
    };
    disconnectMCP(): Promise<void>;
    getToolEntry(toolName: string): ToolEntry | undefined;
    getToolNames(): string[];
    getToolCount(): number;
    getConnectedServers(): string[];
    getServerTools(serverName: string): MCPTool[];
    getServerInfo(serverName: string): {
        name: string;
        transport: string;
        url?: string;
        toolCount: number;
        connected: boolean;
        description?: string;
        tags?: string[];
        autoApprovedCommands?: string[];
    } | undefined;
    getMCPClient(): MCPClient | null;
}
//# sourceMappingURL=tool-manager.d.ts.map