export declare const SSH_CONN_FAILURE_CODE = 255; export declare const SSH_TARGET_RE: RegExp; export declare function assertValidSshTarget(host: string): void; export declare function shellQuote(s: string): string; export declare const SSH_OPTS: readonly string[]; export declare const REMOTE_STDOUT_MAX_BYTES: number; export declare class RemoteUtf8Accumulator { private readonly decoder; private value; write(chunk: Buffer): void; end(): string; current(): string; } export declare function sshConnectOpts(hostKeyOpts?: string[]): string[]; export interface SshExecOptions { input?: string; timeoutMs?: number; extraSshArgs?: string[]; hostKeyOpts?: string[]; } export interface SshExecResult { code: number | null; stdout: string; stderr: string; timedOut: boolean; } export declare const SSH_TIMEOUT_KILL_GRACE_MS = 250; export declare function sshExec(target: string, remoteCmd: string, opts?: SshExecOptions): SshExecResult; export declare function sshExecAsync(target: string, remoteCmd: string, opts?: SshExecOptions): Promise; export interface SshExecRawResult { code: number | null; stdout: Buffer; stderr: Buffer; timedOut: boolean; } export declare function sshExecRaw(target: string, remoteCmd: string, opts?: SshExecOptions): SshExecRawResult; export declare function sshReachable(target: string, timeoutMs?: number): boolean; export interface SshStreamOptions { tty?: boolean; hostKeyOpts?: string[]; extraSshArgs?: string[]; } export declare const TERMINAL_MODE_RESET: string; export declare function restoreLocalTerminal(saved: string | undefined, opts: { drainStdin: boolean; }): void; export declare function saveLocalTerminal(): string | undefined; export declare function sshStream(target: string, remoteCmd: string, opts?: SshStreamOptions): number; export declare function managedKnownHostsPath(): string; export declare function ensureManagedKnownHostsDir(file?: string): void; export declare function readManagedKnownHosts(file?: string): string; export declare function parseKnownHosts(content: string): string[]; export declare function isHostPinnedIn(content: string, host: string): boolean; export declare function isHostPinned(host: string, file?: string): boolean; export declare function hostKeyCheckingOpts(pinned: boolean, file?: string): string[]; export declare function newKnownHostsLines(existing: string, scanned: string): string[]; export interface PinResult { pinned: boolean; added: number; } export declare function recordScannedKeys(host: string, scanned: string, file?: string): PinResult; export declare function pinHostKey(host: string, opts?: { file?: string; timeoutMs?: number; port?: number; }): PinResult; export type RemoteShell = 'posix' | 'powershell'; export declare function remoteShellFor(os: string | undefined): RemoteShell; export declare function powershellQuote(s: string): string; export declare function encodePowershell(script: string): string; export declare function decodePowershell(encoded: string): string; export declare function remoteStateRootEnv(root: string | undefined, os?: string): Record; export declare function posixEnvExports(env?: Record): string; export declare const POWERSHELL_PROGRESS_SILENCE = "$ProgressPreference = 'SilentlyContinue'"; interface WindowsSecretsCommand { args: string[]; env?: Record; } export declare function windowsSecretsScript(cmd: WindowsSecretsCommand): string; export declare function buildRemoteSecretsInvocation(args: string[], os?: string, env?: Record): string; export declare function buildWindowsStdinImportCommand(bundle: string, opts?: { force?: boolean; policyNever?: boolean; env?: Record; }): string; export declare function rememberRemoteOs(target: string, os: string | undefined): void; export declare function clearRemoteOsCache(): void; export declare function resolveRemoteOs(target: string, opts?: { timeoutMs?: number; }): string | undefined; export declare function resolveRemoteOsAsync(target: string, opts?: { timeoutMs?: number; }): Promise; export {};