/** * Classifying ssh failures * * The only place that parses OpenSSH's message text. The job is to tell a * transport failure (safe to retry) apart from an authentication failure * (retrying is harmful: every attempt counts against the server as a failed * login) and from an honest non-zero exit code from the remote command * (not a failure at all). */ import { SSHRunnerError } from './errors.js'; /** Return code by which ssh reports its own failure */ export declare const SSH_FAILURE_EXIT_CODE = 255; /** * Observed outcome of running ssh */ export interface SpawnOutcome { /** Process spawn error (ssh not found, etc.) */ spawnError?: NodeJS.ErrnoException; exitCode: number | null; stderr: string; /** Needed to tell a broken channel apart from a command that itself returned 255 */ stdout?: string; } /** Strip multiplexing housekeeping lines from the command output */ export declare function stripMuxNotices(stderr: string): string; /** * Parse the outcome of a run. * * @returns A transport error, or null if there was no transport failure and * the result should be treated as a plain ExecResult. */ export declare function classifySpawnOutcome(outcome: SpawnOutcome, context: { host: string; port: number; idempotent?: boolean; }): SSHRunnerError | null;