/** * Shared Windows shell-wrapper helpers for host-native command execution. * * Host CLIs frequently ship .cmd/.bat wrappers (VS Code's `code.cmd`, Cursor's * `cursor.cmd`), which Windows cannot launch directly — a shell must run them. * `child_process` `shell: true` concatenates arguments unescaped (Node DEP0190) * and cmd.exe re-parses the raw command line, so quoting cannot make hostile * arguments safe. Every command surface in this repo therefore shares the same * two-layer contract: * * 1. Fail closed: arguments containing cmd.exe metacharacters are refused * before any shell sees them (see `containsShellMetaCharacters`). * 2. Execute wrappers through PowerShell with every token single-quoted as a * literal (`buildWindowsPowerShellCommand`), preserving argv boundaries * while never enabling shell interpretation. */ /** * Returns true when a value contains characters that cmd.exe interprets in * wrapper command lines regardless of quoting. */ export declare function containsShellMetaCharacters(value: string): boolean; /** * Returns whether an executable path is a Windows shell wrapper (.cmd / * .bat) that must be invoked through a shell. */ export declare function isWindowsShellWrapperPath(executablePath: string, platform?: NodeJS.Platform): boolean; /** * Builds the PowerShell invocation that runs a Windows .cmd/.bat wrapper with * every token preserved as a literal. `&` is the call operator; each * executable/argument is wrapped in single quotes with embedded quotes * doubled, so spaces, apostrophes, operators, and redirection characters in * arguments are data, never syntax. */ export declare function buildWindowsPowerShellCommand(executable: string, args: string[]): string; /** * Wraps a value in a PowerShell single-quoted literal, doubling embedded * single quotes so the literal cannot terminate early. */ export declare function quotePowerShellLiteral(value: string): string;