/**
 * Shared spawn utilities for postinstall and lifecycle scripts.
 *
 * Provides a thin async wrapper around Bun.spawn and a PATH-prepend helper,
 * eliminating duplication across postinstall-playwright, postinstall-liteparse, etc.
 */
export interface SpawnResult {
    success: boolean;
    details: string;
    stdout?: string;
    stderr?: string;
}
export interface RunCommandOptions {
    /** When true, stdout/stderr are inherited so the user sees live output. */
    inherit?: boolean;
}
/**
 * Run a command asynchronously and collect its output.
 * Returns a result object instead of throwing on failure.
 *
 * When `inherit` is true, output streams directly to the terminal so the
 * user can follow installation progress in real time.
 */
export declare function runCommand(cmd: string[], options?: RunCommandOptions): Promise<SpawnResult>;
/**
 * Prepend a directory to the PATH environment variable (if not already present).
 */
export declare function prependPath(directory: string): void;
export declare function resolveCommandFromCurrentPath(cmd: string): string | null;
export type MuxBinaryName = "tmux" | "psmux" | "pmux";
export declare function requiredMuxBinaryCandidatesForPlatform(platform?: NodeJS.Platform): MuxBinaryName[];
export declare function isMuxBinaryRequiredForPlatform(binary: MuxBinaryName, platform?: NodeJS.Platform): boolean;
export declare function hasRequiredMuxBinary(): boolean;
export declare function psmuxReleaseAssetSuffix(arch?: NodeJS.Architecture): string | null;
/**
 * Get the user's home directory.
 * Uses Node.js os.homedir() which handles cross-platform resolution
 * (HOME on Unix, USERPROFILE on Windows, and fallback to passwd on Linux).
 */
export declare function getHomeDir(): string;
/**
 * Options for the user-facing ensure* installers.
 *
 * `quiet: true` captures subprocess output instead of streaming it to the
 * terminal, so a higher-level spinner UI (see auto-sync's `runSteps`) can
 * own the display. Failures collected in the captured buffer are thrown
 * out of the ensure* function so the spinner can mark the step red and
 * surface the captured tail in its summary.
 *
 * Default (`quiet: false`) preserves the historical inherit-stdout
 * behavior used by the ad-hoc fallbacks in chat.ts / workflow.ts.
 */
export interface EnsureOptions {
    quiet?: boolean;
}
/**
 * Install one or more global packages via a single `bun install -g` call.
 * Uses `--trust` to allow postinstall lifecycle scripts (required by
 * packages like @playwright/cli).
 *
 * Combining multiple packages into one invocation is important: Bun's
 * global linker is not safe to run concurrently — two parallel
 * `bun install -g` processes race to create the same symlinks in the
 * shared global store, causing EEXIST errors for transitive deps that
 * both packages (or the already-installed @bastani/atomic) share.
 */
export declare function upgradeGlobalPackages(pkgs: string[]): Promise<void>;
/** Upgrade @playwright/cli, @llamaindex/liteparse, and @ast-grep/cli globally in one pass. */
export declare function upgradeGlobalToolPackages(): Promise<void>;
/**
 * Ensure a terminal multiplexer (tmux on Unix, psmux on Windows) is installed.
 * No-op when already present on PATH.
 *
 * When `quiet: true`, subprocess output is captured instead of inherited
 * so an outer spinner UI owns the display. On failure the captured tail
 * is re-thrown as the error message.
 */
export declare function ensureTmuxInstalled(options?: EnsureOptions): Promise<void>;
/**
 * Ensure bun is installed and available on PATH.
 * No-op when already present.
 */
export declare function ensureBunInstalled(): Promise<void>;
/**
 * Ensure tmux/psmux is installed. Used as a ToolingStep in the update pipeline.
 * Does not attempt version upgrades — just ensures the tool exists.
 */
export declare function upgradeTmux(): Promise<void>;
/**
 * Upgrade bun to the latest version, or install if missing.
 */
export declare function upgradeBun(): Promise<void>;
export declare class ToolingSetupError extends Error {
    readonly failures: string[];
    constructor(failures: string[]);
}
export interface ToolingStep {
    label: string;
    fn: () => Promise<unknown>;
}
export declare function collectFailures(steps: ToolingStep[], results: PromiseSettledResult<unknown>[]): string[];
//# sourceMappingURL=spawn.d.ts.map