/** * Dependency-free shell decomposition for argv-based policy rules. Tokens are * parsed for matching only: quotes and escapes are handled, variables are not * expanded, and nothing is ever executed. * * Pipeline signatures contain command base names only (e.g. `curl | sh`), so a * URL argument containing slashes cannot defeat the vendored `curl*|*sh` * baseline rule. `args` is an ordered prefix match; `anyArg` sees every * argument token and redirect target across pipe stages. * @module dsh-sensitive-guard/policy/argv */ export interface CommandSegment { command: string; args: string[]; } export interface ParsedArgv { /** First command word after sudo/env/builtin prefixes are stripped. */ command: string; /** First command's argument tokens, ordered (redirects excluded). */ args: string[]; /** Command base names across pipe stages, joined into a normalized signature. */ pipeline: string; /** Every argument token across stages, options and redirect targets included. */ anyTokens: string[]; /** Non-option argument and redirect-target tokens, used as path evidence. */ pathTokens: string[]; /** `bash -c`/`sh -c` payloads, recursively parsed (depth-capped). */ nested: ParsedArgv[]; } /** Base name of a command word; accepts both slash styles for testability. */ export declare function commandBasename(word: string): string; /** Parse one shell command line. Safe for untrusted input; never executes. */ export declare function parseCommand(input: string, options?: { maxDepth?: number; }): ParsedArgv; /** The parsed argv plus every recursively parsed `bash -c` payload. */ export declare function flattenArgvs(parsed: ParsedArgv): ParsedArgv[]; //# sourceMappingURL=argv.d.ts.map