export { buildWin32CmdShimInvocation, type Win32CmdShimInvocation, } from '@wrongstack/core/utils'; /** * Check whether a file path or command names a Windows batch / cmd shim * (`.cmd` or `.bat`), case-insensitively. */ export declare function isWinCmdShim(filePath: string): boolean; /** * On Windows, Node.js `spawn()` without a shell does NOT resolve .cmd/.bat * extensions through PATHEXT — it only auto-resolves .exe. Most Node.js CLI * tools (npx, pnpm, biome, tsc, vitest, etc.) ship as .cmd wrappers on * Windows. This function resolves the command name to its full path so spawn * can find it without relying on shell-mode argument concatenation. * * On non-Windows, returns the command unchanged. */ export declare function resolveWin32Command(cmd: string): string; /** * Resolve a PowerShell binary by name. `pickShell` in `_shell-pick.ts` * already decides whether the user wants `'pwsh'` (PowerShell 7+) or * `'powershell'` (Windows PowerShell 5.1). This helper turns that decision * into a real on-disk path. * * Order: * 1. If `cmd` is `pwsh` and a `pwsh.exe` exists on PATH → return that. * 2. If `cmd` is `pwsh` and only `powershell.exe` exists → fall back to * that (the alternative is a cryptic ENOENT for the user). * 3. Symmetric for `powershell`: prefer `powershell.exe`, fall back to * `pwsh.exe` if installed and the legacy binary is missing. * 4. Anything else → delegate to `resolveWin32Command` (handles `.cmd` * shims a sysadmin might drop in place, etc.). * * Returns the original command on ENOENT — `spawn()` will surface a clean * ENOENT and the user sees "PowerShell not installed", which is the right * diagnostic. We never throw from here. */ export declare function resolvePowerShell(cmd: string): string; /** * Throw if any argument contains a cmd.exe command-injection metacharacter. * Call this ONLY on the Windows `.cmd`/`.bat` shim path. A no-op for safe args. */ export declare function assertSafeWin32ShellArgs(args: readonly unknown[]): void; //# sourceMappingURL=_win32-resolve.d.ts.map