export interface SpawnResult { stdout: string; stderr: string; exitCode: number; } /** * Build a single cmd.exe-safe command line from (cmd, args). Follows the * canonical `CommandLineToArgvW` escaping rules so the child process sees * each arg verbatim: * 1. Double any run of backslashes that directly precedes a `"` or the * end of the string (so the closing `"` we add below isn't escaped). * 2. Escape each embedded `"` as `\"`. * 3. Wrap the whole arg in `"..."`. * Naive `s.replace(/"/g, '\\"')` is wrong for args like `a\"b` or `a\\` * because the preceding backslashes turn the intended escape into a real * backslash + unescaped quote, breaking out of the quoted context. * * Chose this shape because Node 22+'s DEP0190 deprecates * `spawn(cmd, args[], {shell:true})` (joining args without escaping), but * `spawn(, [], {shell:true})` stays supported. Inside * double quotes cmd.exe treats `&|<>^` literally, so no caret escaping is * needed for our hardcoded args. */ export declare function winCommandLine(cmd: string, args: string[]): string; /** * Spawn a command and resolve with its stdout/stderr/exit code. Unlike the * shared `spawnCommand` in src/utils.ts, this helper attaches an `error` * listener so that ENOENT (binary not on PATH) rejects the promise cleanly * instead of crashing the process. That matters for adapters that probe for * optional binaries (`copilot`, `gemini`, `codex`). */ export declare function safeSpawn(cmd: string, args?: string[]): Promise; //# sourceMappingURL=spawn-helper.d.ts.map