/** * Bash Executor * * Built-in implementation for running shell commands using Node.js spawn. */ import type { ShellExecutor } from "../types"; export declare class CommandExitError extends Error { readonly exitCode: number; readonly output: string; constructor(exitCode: number, output: string); } /** * Options for the shell executor */ export interface ShellExecutorOptions { /** * Shell to use for execution * @default "/bin/bash" on Unix, "powershell" on Windows */ shell?: string; /** * Timeout for command execution in milliseconds * @default 30000 (30 seconds) */ timeoutMs?: number; /** * Maximum output kept, in characters. Output beyond this is * middle-truncated: the head and tail are preserved and the middle is * elided, since build and test failures usually live at the end of the * output. * @default 48_000 — see MAX_COMMAND_OUTPUT_CHARS in output-limits.ts */ maxOutputChars?: number; /** * @deprecated Misnamed — the limit was always enforced in characters, * not bytes. Use {@link maxOutputChars}; this alias is honored when * maxOutputChars is not set. */ maxOutputBytes?: number; /** * Environment variables to add/override */ env?: Record; /** * Whether to combine stdout and stderr * @default true */ combineOutput?: boolean; } /** * Create a shell executor using Node.js spawn * * @example * ```typescript * const shell = createShellExecutor({ * timeoutMs: 60000, // 1 minute timeout * shell: "/bin/zsh", * }) * * const output = await shell("ls -la", "/path/to/project", context) * ``` */ export declare function createShellExecutor(options?: ShellExecutorOptions): ShellExecutor;