import type { SpawnSyncOptionsWithStringEncoding, SpawnSyncReturns } from 'node:child_process';
export declare const isWindows: boolean;
/**
 * Finds the full path of a binary by searching PATH (and PATHEXT on Windows).
 * Returns the resolved path, or null if not found.
 * Uses only Node.js fs — no `which` / `where` subprocess.
 */
export declare function findBin(name: string): string | null;
export declare function commandExists(name: string): boolean;
/**
 * True when a CLI attempt failed in a way that may succeed with the next argv list
 * (e.g. unsupported flags, or a model id the current install cannot use).
 */
export declare function shouldRetryAgentCliAttempt(stderr: string, stdout: string): boolean;
/**
 * Parses an npm-generated .cmd shim to extract the target Node.js script path.
 * npm shims contain a line like:
 *   "%_prog%"  "%dp0%\node_modules\...\cli.js" %*
 * or:
 *   "%~dp0\node_modules\...\cli.js" %*
 *
 * Returns the resolved absolute path to the .js entry point, or null if the
 * shim format is unrecognised or the script doesn't exist on disk.
 */
export declare function parseCmdShimTarget(cmdPath: string): string | null;
/**
 * Detects whether a resolved binary path is a Windows .cmd/.bat shim and
 * returns adjusted spawn arguments that bypass cmd.exe.
 *
 * First tries to parse the .cmd shim to find the underlying Node.js script
 * so we can spawn `node.exe <script> <args>` directly. This avoids cmd.exe's
 * broken stdin forwarding and its mangling of shell metacharacters in
 * arguments (which breaks AI prompts containing &, |, <, >, ", % etc.).
 *
 * Falls back to `cmd.exe /c` only when the shim can't be parsed.
 * Returns null when no adjustment is needed (non-.cmd binary).
 */
export declare function resolveWindowsCmd(resolvedPath: string | null, args: string[]): {
    bin: string;
    args: string[];
} | null;
/**
 * Cross-platform `spawnSync` wrapper.
 * On Windows, .cmd/.bat shims (common for npm-installed CLIs like cursor,
 * claude, windsurf) cannot be spawned directly — Node.js only resolves .exe
 * and .com via CreateProcessW.  This helper detects .cmd/.bat and routes
 * them through cmd.exe /c so they execute correctly without shell: true
 * (which triggers DEP0190 and mishandles arguments containing spaces or
 * shell metacharacters).
 */
export declare function spawnCommand(command: string, args: string[], options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
/**
 * Returns the user's full login-shell environment merged with process.env.
 * process.env always wins on conflicts, so we never lose what we already have.
 * Falls back to process.env if the shell can't be invoked (e.g. Windows).
 * Result is cached after the first call.
 */
export declare function getUserShellEnv(): NodeJS.ProcessEnv;
/**
 * Returns false when the machine's display is asleep or the screen is locked,
 * meaning GUI-dependent AI agents (Cursor, Windsurf, Claude) cannot operate.
 * Falls back to true (assume available) when detection is inconclusive.
 */
export declare function isScreenAvailable(): boolean;
//# sourceMappingURL=platform.d.ts.map