/**
 * Pick the best launch target from `where`'s match list on win32.
 *
 * `where npm` on a typical install returns BOTH the extensionless Unix wrapper
 * (e.g. `C:\Program Files\nodejs\npm`, a bash shell script) AND the `npm.cmd`
 * shim. The extensionless wrapper is NOT a win32 executable — handing it to a
 * spawn boundary ENOENTs (errno -4058). So:
 *   1. Prefer a directly-launchable `.exe`/`.com`.
 *   2. Otherwise take a `.cmd`/`.bat` shim (absolute → works for ConPTY, and for
 *      execFile once wrapped via buildWin32ExecFileSpawn).
 *   3. NEVER fall back to an extensionless match — return null so the caller can
 *      try other resolution strategies (global-bin scan) rather than emit a
 *      path that cannot be exec'd.
 */
export declare function selectWin32ExecutableMatch(matches: string[]): string | null;
/**
 * Resolve a launch command to an absolute executable path on Windows.
 *
 * node-pty's ConPTY backend resolves a bare/relative command against the
 * *calling process's* `Path` env var and — critically — does NOT apply PATHEXT.
 * So a provider command like `claude` never matches `claude.exe` and the native
 * layer throws `File not found:` (empty), which crashes the daemon. We resolve
 * it to an absolute `.exe` here (in the daemon process, which has the full PATH)
 * before the command ever reaches node-pty.
 *
 * No-op on non-Windows and when the command is already an existing absolute path
 * or cannot be resolved (caller keeps the original behaviour).
 */
export declare function resolveWin32Executable(command: string): string;
/**
 * Quote one argument for a cmd.exe command line using the standard
 * CommandLineToArgvW rules (the same algorithm Node uses internally): wrap in
 * double quotes only when needed, double up the backslashes that precede a
 * quote, and escape embedded quotes. We do per-argument quoting ourselves
 * (rather than `{ shell: true }`) because Node's shell mode joins argv with bare
 * spaces and applies NO quoting — any argument containing a space (a path, a
 * test name) would split. Inputs here are repo-mesh validation/bootstrap command
 * tokens (trusted config, not network data), so argv-quoting for spaces/quotes
 * is sufficient; we deliberately do not attempt full cmd.exe metacharacter
 * (& | < > ^ %) escaping.
 */
export declare function quoteWin32CmdArg(arg: string): string;
export interface Win32ExecFileSpawn {
    file: string;
    args: string[];
    /** Set when the args are pre-quoted for cmd.exe and must not be re-quoted. */
    windowsVerbatimArguments?: boolean;
}
/**
 * Build child_process.execFile/spawn parameters for an already-resolved command.
 *
 * On win32 a `.cmd`/`.bat` shim (what `npm`/`npx`/`tsc`/`vitest` resolve to)
 * cannot be launched by execFile directly — modern Node refuses it (CVE-2024-27980
 * mitigation) and CreateProcess cannot exec a batch file. So wrap it in
 * `cmd.exe /d /s /c "<quoted command line>"` with `windowsVerbatimArguments` so
 * our own per-argument quoting is preserved. `.exe`/`.com` (and every non-win32
 * platform, and any already-cmd.exe target) pass through unchanged — this is a
 * strict no-op off win32, guarding against regressions on linux/macOS.
 */
export declare function buildWin32ExecFileSpawn(resolvedCommand: string, args: string[]): Win32ExecFileSpawn;
/**
 * Convenience: resolve a bare command to an absolute win32 path AND build the
 * execFile spawn parameters (cmd.exe-wrapping a .cmd/.bat shim). Returns the
 * resolved command alongside the spawn spec so callers can still surface the
 * resolved path in diagnostics.
 */
export declare function resolveWin32ExecFileSpawn(command: string, args: string[]): Win32ExecFileSpawn & {
    resolvedCommand: string;
};
