import { execFileSync, execSync } from "node:child_process";
import { existsSync } from "node:fs";
import { platform } from "node:os";
export interface FindExecutableDependencies {
    execSync: typeof execSync;
    execFileSync: typeof execFileSync;
    existsSync: typeof existsSync;
    platform: typeof platform;
    shell: string | undefined;
}
/**
 * On Unix we first try `$SHELL -lic "which <name>"` so that rc-file PATH
 * additions (asdf, nvm, homebrew, nix, etc.) are visible — exactly as if the
 * user opened a terminal and typed the command.  If that fails (e.g. the login
 * shell itself errors) we fall back to a plain `which`.
 *
 * On Windows we augment the daemon PATH with machine/user registry PATH values
 * and return the first `where.exe` match. Launch-time execution decides whether
 * the resolved path needs `cmd.exe` semantics (for example npm shims under
 * nvm4w such as `C:\nvm4w\nodejs\codex`).
 */
export declare function findExecutable(name: string, dependencies?: FindExecutableDependencies): string | null;
export declare function isCommandAvailable(command: string): boolean;
/**
 * When spawning with `shell: true` on Windows, the command is passed to
 * `cmd.exe /d /s /c "command args"`. The `/s` strips outer quotes, so a
 * command path with spaces (e.g. `C:\Program Files\...`) is split at the
 * space. Wrapping it in quotes produces the correct `"C:\Program Files\..." args`.
 */
export declare function quoteWindowsCommand(command: string): string;
/**
 * `spawn(..., { shell: true })` on Windows also passes argv through `cmd.exe`.
 * Any argument containing spaces must be quoted or it will be split before the
 * child process sees it.
 */
export declare function quoteWindowsArgument(argument: string): string;
export declare function resolveShellEnv(): Record<string, string>;
//# sourceMappingURL=executable.d.ts.map