/**
 * SSH command builder — array-based construction with shell escaping.
 *
 * Use cmd() to build commands from typed arguments. Each argument is
 * shell-escaped, preventing command injection via crafted inputs.
 *
 * Use raw() ONLY for hardcoded static strings (heredocs, complex redirections)
 * that cannot be expressed via cmd(). Never pass user input to raw().
 */
/** Branded string type. Prevents accidental raw string usage while remaining zero-overhead. */
export type SshCommand = string & {
    readonly __brand: "SshCommand";
};
/**
 * POSIX-safe shell escaping.
 * - Safe chars (alphanumeric + ._:/@=+-) → returned as-is
 * - Empty string → ''
 * - Everything else → wrapped in single quotes, with embedded single quotes
 *   replaced by the POSIX idiom: '\''
 */
export declare function shellEscape(arg: string): string;
/**
 * Build a single command from program + arguments.
 * Each argument is shell-escaped before joining with spaces.
 */
export declare function cmd(...args: string[]): SshCommand;
/**
 * Wrap a pre-validated static string as SshCommand.
 *
 * WARNING: Only use for hardcoded constants or complex shell constructs
 * (heredocs, multi-line scripts, redirections) that cannot be expressed
 * via cmd(). Never pass user input to raw() — it is NOT escaped.
 */
export declare function raw(command: string): SshCommand;
/** Join commands with ' && ' (fail-fast sequential execution). */
export declare function and(...commands: SshCommand[]): SshCommand;
/** Join commands with ' | ' (pipe stdout to next command). */
export declare function pipe(...commands: SshCommand[]): SshCommand;
/** Join commands with ' || ' (run next if previous fails). */
export declare function or(...commands: SshCommand[]): SshCommand;
/** Join commands with ' ; ' (sequential, regardless of exit code). */
export declare function seq(...commands: SshCommand[]): SshCommand;
/** Wrap a command in a subshell: ( ... ) */
export declare function subshell(command: SshCommand): SshCommand;
/**
 * Extract the final shell string from an SshCommand.
 * Provides semantic clarity at call sites — SshCommand is already a string.
 */
export declare function buildCommandString(command: SshCommand): string;
//# sourceMappingURL=sshCommand.d.ts.map