/**
 * Destructive Command Detector
 *
 * Static analysis module that scans shell command strings for patterns known to
 * cause irreversible or high-impact side effects (data loss, permission
 * escalation, infrastructure destruction).
 *
 * This is a PRE-EXECUTION defense layer. It runs before any command is handed to
 * the interpreter and returns a structured warning when a destructive pattern is
 * matched. The caller decides how to surface the warning (block, prompt, log).
 *
 * Design constraints:
 * - Zero external dependencies (pure RegExp matching)
 * - Returns the FIRST matching warning, checking critical severity before high
 * - Case-insensitive matching for SQL keywords; case-sensitive for everything else
 * - No false-negative guarantees — this is a best-effort heuristic layer
 */
import type { ScriptNode } from "../ast/types.js";
export interface DestructiveWarning {
    /** Broad category of the matched pattern. */
    category: "git" | "file" | "database" | "container" | "system";
    /** Human-readable description of what was matched. */
    pattern: string;
    /** Impact severity — critical patterns can cause total data loss. */
    severity: "high" | "critical";
}
/**
 * Scan a shell command string for destructive patterns.
 *
 * Returns the first matching {@link DestructiveWarning} (critical severity
 * patterns are checked before high severity patterns), or `null` if no
 * destructive pattern is detected.
 *
 * @param command - The raw command string to analyze.
 */
export declare function detectDestructiveCommand(command: string): DestructiveWarning | null;
/**
 * A destructive finding produced by the AST analyzer. Mirrors
 * {@link DestructiveWarning} but adds the offending command name and a stable
 * machine-readable code for typed agent consumption.
 */
export interface DestructiveAstFinding {
    category: DestructiveWarning["category"];
    /** Human-readable description of what was matched. */
    pattern: string;
    severity: DestructiveWarning["severity"];
    /** The resolved command name responsible for the finding (e.g. "rm"). */
    command: string;
    /** Stable machine code (e.g. "DESTRUCTIVE_RM_ROOT", "FORK_BOMB"). */
    code: string;
}
/**
 * Analyze a PARSED bash AST for destructive commands.
 *
 * This is the structural counterpart to {@link detectDestructiveCommand}. It
 * walks the tree — simple commands, their argument WordPart shapes, command
 * substitutions, compound bodies, and pipeline structure — so that:
 *   - obfuscated targets (command substitution, IFS expansion) ARE caught;
 *   - dangerous strings sitting in an `echo`/`grep` ARGUMENT are NOT caught.
 *
 * Returns the FIRST finding (all current findings are critical), or null.
 *
 * @param ast - The parsed script AST.
 * @param rawScript - The original source text, used ONLY as a structural
 *   backstop for the dense fork-bomb one-liner. Never used for path matching.
 */
export declare function analyzeDestructiveAst(ast: ScriptNode, rawScript?: string): DestructiveAstFinding | null;
