/**
 * The shell seam the {@link import("./worktree").Workspace} runs git through.
 *
 * Worktree provisioning is the one place in the isolation layer that has to
 * shell out — `git worktree add/list/remove` has no in-process equivalent. To
 * keep that I/O testable, the {@link Workspace} never reaches for
 * `node:child_process` itself; it asks for a {@link ShellRunner} and invokes
 * git through it. Tests inject a hand-written fake runner (asserting on the
 * exact command strings, returning scripted output and exit codes); production
 * code injects {@link nodeRunner}, a thin wrapper over `execFile` with the
 * shell disabled.
 *
 * A run never throws on a non-zero exit. The runner always resolves with a
 * {@link RunResult} carrying `{ stdout, stderr, code }`; it is the
 * {@link Workspace}'s job to inspect `code` and translate a git failure into a
 * typed `isolation` {@link import("../kernel").SwarmFault}. This keeps the
 * seam dumb (it transports bytes and an exit status, nothing more) and the
 * policy (what counts as a failure, what the error should say) in one place.
 */
/** The outcome of one shelled-out command. */
export interface RunResult {
    /** Everything the command wrote to stdout, decoded as UTF-8. */
    readonly stdout: string;
    /** Everything the command wrote to stderr, decoded as UTF-8. */
    readonly stderr: string;
    /**
     * The process exit code. `0` is success; any other value is a failure the
     * caller is expected to map onto a fault. A process killed by a signal (no
     * numeric code) is reported as `null`.
     */
    readonly code: number | null;
}
/**
 * A function that runs one command and resolves with its captured output and
 * exit status. It must *not* reject on a non-zero exit — a failed command is a
 * resolved {@link RunResult} with a non-zero `code`. Rejection is reserved for
 * the runner itself being unable to spawn anything (e.g. the binary is
 * missing), which the {@link Workspace} also folds into an `isolation` fault.
 */
export interface ShellRunner {
    /**
     * Execute `command` and resolve with its result. `command` is the full
     * command line as a single string (e.g. `git worktree list --porcelain`).
     * The optional `cwd` is the directory to run it in; when omitted the runner's
     * own default applies.
     */
    exec(command: string, cwd?: string): Promise<RunResult>;
}
/**
 * The production {@link ShellRunner}: a thin wrapper over `execFile`.
 *
 * The command string is split on whitespace into an argv vector and handed to
 * `execFile` with **no shell** — there is no `/bin/sh -c`, so command
 * substitution, globbing, pipes, and quoting do not apply. Every argument this
 * layer ever passes to git is a literal token (a branch name, an absolute
 * path, a flag), so the naive split is exactly right and the shell-less spawn
 * removes an injection surface. A non-zero exit resolves (it does not reject):
 * `execFile`'s error object still carries `stdout`/`stderr`/`code`, which we
 * forward verbatim.
 */
export declare const nodeRunner: ShellRunner;
