/** * @file `execBin` — spawn a binary with PATH resolution, wrapper-script * unwrapping, and Windows shell handling. Order of operations: * * 1. If the input looks like an absolute or relative path, `resolveRealBinSync` * it directly so we can spawn the underlying script rather than a * wrapper. * 2. Otherwise treat it as a binary name and: * * - Hit `binPathCache`. If valid (`existsSync`), use the cached path; if stale, * evict. * - Fall through to `whichReal` for a fresh PATH search; cache the result on * success. * * 3. Spawn under `windowsShellOption` so `.cmd` wrappers work on Windows while a * real `.exe` is exec'd directly; POSIX bypasses the shell entirely since * direct `execve` is faster. * 4. On not-found, throw a typed `ENOENT` error with operator guidance — far * more useful than a bare "command not found". */ import type { SpawnOptions } from '../process/spawn/types.js'; /** * Execute a binary with the given arguments. * * @example * ;```typescript * await execBin('pnpm', ['install']) * await execBin('/usr/local/bin/node', ['script.js'], { cwd: '/tmp' }) * ``` */ export declare function execBin(binPath: string, args?: string[] | undefined, options?: SpawnOptions | undefined): Promise<{ cmd: string; args: string[] | readonly string[]; code: number; signal: NodeJS.Signals | null; stdout: string | Buffer; stderr: string | Buffer; }>;