import type { ToolContext, ToolPlugin, ToolResult } from "../tools/types.js";
import { PermissionManager } from "./permissionManager.js";
import { ChatCompletionFunctionTool } from "openai/resources.js";
import type { PermissionMode } from "../types/index.js";
import { Container } from "../utils/container.js";
import type { SubagentConfiguration } from "../utils/subagentParser.js";
import type { SkillMetadata } from "../types/skills.js";
export interface ToolManagerOptions {
    container: Container;
    /** Optional list of tool names to enable */
    tools?: string[];
}
/**
 * Tool Manager
 *
 * Manages tool registration and execution with optional permission system integration.
 * Supports both built-in tools and MCP (Model Context Protocol) tools.
 */
declare class ToolManager {
    private toolsRegistry;
    private tools?;
    private container;
    constructor(options: ToolManagerOptions);
    private get mcpManager();
    /**
     * Register a new tool
     */
    register(tool: ToolPlugin): void;
    /**
     * Initialize built-in tools. Can be called with dependencies for tools that require them.
     *
     * This method can be called multiple times safely. When called without dependencies,
     * it registers basic tools (Bash, Read, Write, TaskCreate, etc.). When called with
     * dependencies, it also registers tools that require managers (Agent, Skill).
     *
     * @param deps Optional dependencies for advanced tools
     * @param deps.subagentManager SubagentManager instance for Agent tool
     * @param deps.skillManager SkillManager instance for Skill tool
     *
     * @example
     * ```typescript
     * // Initialize basic tools only
     * toolManager.initializeBuiltInTools();
     *
     * // Initialize all tools including those requiring dependencies
     * toolManager.initializeBuiltInTools({
     *   subagentManager: mySubagentManager,
     *   skillManager: mySkillManager
     * });
     * ```
     */
    initializeBuiltInTools(): void;
    /**
     * Check if a tool should be enabled based on tools configuration and permission rules
     */
    private shouldEnableTool;
    /**
     * Execute a tool by name with the provided arguments and context
     *
     * Enhances the context with permission-related fields before execution:
     * - permissionMode: The current permission mode (default or bypassPermissions)
     * - canUseToolCallback: Custom permission callback if provided
     * - permissionManager: The PermissionManager instance for permission checks
     *
     * @param name - Name of the tool to execute
     * @param args - Arguments to pass to the tool
     * @param context - Execution context for the tool
     * @returns Promise resolving to the tool execution result
     */
    execute(name: string, args: Record<string, unknown>, context: ToolContext): Promise<ToolResult>;
    list(): ToolPlugin[];
    getToolsConfig(options?: {
        availableSubagents?: SubagentConfiguration[];
        availableSkills?: SkillMetadata[];
        workdir?: string;
        isSubagent?: boolean;
    }): ChatCompletionFunctionTool[];
    /**
     * Get the list of registered tool plugins
     */
    getTools(): ToolPlugin[];
    /**
     * Get the current permission mode
     */
    getPermissionMode(): PermissionMode;
    /**
     * Set the permission mode
     * @param mode - The new permission mode
     */
    setPermissionMode(mode: PermissionMode): void;
    /**
     * Get the permission manager
     */
    getPermissionManager(): PermissionManager | undefined;
    /**
     * Get the task manager
     */
    getTaskManager(): import("../services/taskManager.js").TaskManager | undefined;
}
export { ToolManager };
//# sourceMappingURL=toolManager.d.ts.map