/** What a recognized wrapper chain before a command word changes about how that command runs. */ export type CommandPrefix = { /** The effective `env -C` directory of each `env` in the chain, outermost first. */ chdir: string[]; /** Assignments and `env -u` unsets the command sees. */ env: Record; /** Wrapper basenames, outermost first. */ wrappers: string[]; }; /** * Parses the words between a command segment's start and a command word. Returns null when they * are not a recognized wrapper chain, i.e. the command word is an argument rather than the * program the shell runs. Wrappers chain in any order (`nohup env -C /tmp gh`) and match by * basename (`/usr/bin/env`). */ export declare function parseCommandPrefix(prefixWords: readonly string[]): CommandPrefix | null; /** * Reads the wrapper chain that opens a simple command's words (redirections already removed) and * finds the command word it runs. Returns null when a wrapper's options are unrecognized or only * describe the command (`command -v gh`). */ export declare function readCommandPrefix(words: readonly string[]): { commandIndex: number; prefix: CommandPrefix; } | null; export declare function withoutRedirections(words: readonly string[]): string[] | null;