/** * Splits a complex bash command into individual simple commands by shell operators (&&, ||, ;, |, &). * Correctly handles quotes, escaped characters, and subshells. */ export declare function splitBashCommand(command: string): string[]; /** * Removes inline environment variable assignments (e.g., VAR=val cmd -> cmd). */ export declare function stripEnvVars(command: string): string; /** * Removes redirections (e.g., echo "data" > output.txt -> echo "data"). */ export declare function stripRedirections(command: string): string; /** * Checks if a bash command contains any write redirections (>, >>, &>, 2>, >|). */ export declare function hasWriteRedirections(command: string): boolean; /** * Checks if a bash command contains any heredocs (<<, <<-). */ export declare function hasHeredoc(command: string): boolean; /** * Checks if a bash command is a heredoc write operation (e.g., cat < file). */ export declare function isBashHeredocWrite(command: string): boolean; /** * Blacklist of dangerous commands that should not be safely prefix-matched * and should not have persistent permissions. */ export declare const DANGEROUS_COMMANDS: string[]; /** * Registry of commands and their expected subcommand depth for smart prefix extraction. * For example, 'git: 2' means 'git commit' is a valid prefix, but 'git' alone is not. * Multi-word keys can be used for more specific rules. */ export interface ToolRule { depth: number; scopeFlags?: string[]; } export declare const TOOL_RULES: Record; /** * Registry of dangerous subcommands for specific tools. */ export declare const DANGEROUS_SUBCOMMANDS: Record; /** * Checks if a find command is dangerous (e.g., contains -exec, -delete, etc.). */ export declare function isDangerousFind(command: string): boolean; /** * Extracts a "smart prefix" from a bash command based on common developer tools. * Returns null if the command is blacklisted or cannot be safely prefix-matched. */ export declare function getSmartPrefix(command: string): string | null;