import { ToolResult } from '../types/index.js';
import { SelfHealingEngine } from '../utils/self-healing.js';
import { Disposable } from '../utils/disposable.js';
/**
 * Bash Tool
 *
 * Executes shell commands with comprehensive security measures:
 * - Blocked dangerous patterns (rm -rf /, fork bombs, etc.)
 * - Protected paths (~/.ssh, ~/.aws, /etc/shadow, etc.)
 * - User confirmation for commands (unless session-approved)
 * - Self-healing: automatic error recovery for common failures
 * - Process isolation via spawn with process group management
 * - Graceful termination with SIGTERM before SIGKILL
 *
 * Security modes are controlled by SandboxManager configuration.
 * Self-healing can be disabled via --no-self-heal flag.
 */
export declare class BashTool implements Disposable {
    private currentDirectory;
    private confirmationService;
    private sandboxManager;
    private selfHealingEngine;
    private selfHealingEnabled;
    private runningProcesses;
    constructor();
    /**
     * Clean up resources - kill any running processes
     */
    dispose(): void;
    /**
     * Validate command for dangerous patterns
     *
     * Security checks performed (in order):
     * 1. Control characters - blocks terminal manipulation
     * 2. ANSI escape sequences - blocks display manipulation
     * 3. Shell bypass features - blocks process substitution, here-strings, etc.
     * 4. Base command blocklist - blocks known dangerous commands
     * 5. Blocked command patterns - blocks known dangerous patterns
     * 6. Protected paths - blocks access to sensitive directories
     * 7. Sandbox manager validation - additional runtime checks
     */
    private validateCommand;
    /**
     * Filter environment variables to only include safe ones
     * This prevents credential leakage to child processes
     *
     * Security measures:
     * - Only allowlisted variable names are passed through
     * - Values containing shell metacharacters are sanitized
     * - Values that look like secrets are excluded
     */
    private getFilteredEnv;
    /**
     * Execute a command with streaming output.
     * Yields each line of stdout/stderr as it arrives.
     * Validates and confirms the command before execution.
     */
    executeStreaming(command: string, timeout?: number): AsyncGenerator<string, ToolResult, undefined>;
    /**
     * Execute a command using spawn with process group isolation (safer than exec)
     * Inspired by mistral-vibe's robust process handling
     */
    private executeWithSpawn;
    /**
     * Execute a shell command
     *
     * Validates command safety, requests user confirmation, and executes
     * via spawn with process isolation. Failed commands trigger self-healing
     * attempts if enabled.
     *
     * Special handling for `cd` commands to update working directory state.
     *
     * @param command - Shell command to execute
     * @param timeout - Maximum execution time in ms (default: 30000)
     * @returns Command output or error message; test output is parsed and structured
     *
     * @example
     * // Simple command
     * await bash.execute('ls -la');
     *
     * // With custom timeout (2 minutes)
     * await bash.execute('npm install', 120000);
     */
    execute(command: string, timeout?: number): Promise<ToolResult>;
    /**
     * Enable or disable self-healing
     */
    setSelfHealing(enabled: boolean): void;
    /**
     * Check if self-healing is enabled
     */
    isSelfHealingEnabled(): boolean;
    /**
     * Get self-healing engine for configuration
     */
    getSelfHealingEngine(): SelfHealingEngine;
    getCurrentDirectory(): string;
    /**
     * Escape shell argument to prevent command injection
     */
    private escapeShellArg;
    /**
     * List files in a directory (wrapper for `ls -la`)
     *
     * @param directory - Directory path to list (default: current directory)
     * @returns Formatted directory listing or error
     */
    listFiles(directory?: string): Promise<ToolResult>;
    /**
     * Find files matching a pattern (wrapper for `find -name -type f`)
     *
     * @param pattern - Glob pattern to match (e.g., "*.ts", "package.json")
     * @param directory - Directory to search in (default: current directory)
     * @returns List of matching file paths or error
     */
    findFiles(pattern: string, directory?: string): Promise<ToolResult>;
    /**
     * Search for a pattern in files using ripgrep
     *
     * Uses @vscode/ripgrep for ultra-fast searching. Results are limited
     * to 100 matches for performance.
     *
     * @param pattern - Regex pattern to search for
     * @param files - File or directory to search in (default: current directory)
     * @returns Matching lines with file paths and line numbers, or error
     */
    grep(pattern: string, files?: string): Promise<ToolResult>;
}
