@zero-transfer/sdk 0.1.5 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import { SecureVersion, PeerCertificate } from 'node:tls';
3
3
  import { Readable } from 'node:stream';
4
- import { BaseAgent, Algorithms, ConnectConfig, Client, SFTPWrapper } from 'ssh2';
5
4
  import { Buffer as Buffer$1 } from 'node:buffer';
5
+ import { Socket } from 'node:net';
6
6
 
7
7
  /**
8
8
  * Structured logging contracts and helpers for ZeroTransfer.
@@ -306,10 +306,25 @@ interface RemoteStat extends RemoteEntry {
306
306
  type TlsSecretSource = SecretSource | SecretSource[];
307
307
  /** Known-hosts material source accepted by SSH connection profiles. */
308
308
  type SshKnownHostsSource = SecretSource | SecretSource[];
309
+ /** Minimal SSH agent contract used by profile validation and SSH adapters. */
310
+ interface SshAgentLike {
311
+ /** Returns public identities exposed by the agent implementation. */
312
+ getIdentities: (...args: any[]) => unknown;
313
+ /** Signs payloads using a selected identity. */
314
+ sign: (...args: any[]) => unknown;
315
+ }
316
+ /** Ordered algorithm list mutation operations used by SSH adapters. */
317
+ interface SshAlgorithmMutations {
318
+ append?: string | readonly string[];
319
+ prepend?: string | readonly string[];
320
+ remove?: string | readonly string[];
321
+ }
322
+ /** Single SSH algorithm override value accepted by connection profiles. */
323
+ type SshAlgorithmOverride = readonly string[] | SshAlgorithmMutations;
309
324
  /** SSH agent source accepted by SFTP providers. */
310
- type SshAgentSource = string | BaseAgent;
325
+ type SshAgentSource = string | SshAgentLike;
311
326
  /** SSH transport algorithm overrides accepted by SFTP providers. */
312
- type SshAlgorithms = Algorithms;
327
+ type SshAlgorithms = Record<string, SshAlgorithmOverride | undefined>;
313
328
  /** Context passed to SSH socket factories before opening an SSH session. */
314
329
  interface SshSocketFactoryContext {
315
330
  /** Target SSH host from the resolved connection profile. */
@@ -327,7 +342,7 @@ interface SshSocketFactoryContext {
327
342
  * Use this hook for HTTP CONNECT, SOCKS, bastion, or custom tunnel integrations.
328
343
  *
329
344
  * @param context - Resolved SSH target information for the socket being opened.
330
- * @returns Preconnected readable stream, or a promise for one, passed to ssh2's `sock` option.
345
+ * @returns Preconnected readable stream, or a promise for one, passed to the SSH adapter socket option.
331
346
  */
332
347
  type SshSocketFactory = (context: SshSocketFactoryContext) => Readable | Promise<Readable>;
333
348
  /** Prompt metadata supplied by an SSH keyboard-interactive server challenge. */
@@ -2822,71 +2837,542 @@ declare function parseMlsdLine(line: string, directory?: string): RemoteEntry;
2822
2837
  */
2823
2838
  declare function parseMlstTimestamp(input: string | undefined): Date | undefined;
2824
2839
 
2825
- /** Options used to create an SFTP provider factory. */
2826
- interface SftpProviderOptions {
2827
- /** Hash algorithm used before calling ssh2's host verifier, such as `sha256`. */
2828
- hostHash?: ConnectConfig["hostHash"];
2829
- /** Host-key verifier passed directly to ssh2 for advanced callers. */
2830
- hostVerifier?: ConnectConfig["hostVerifier"];
2831
- /** Default SSH handshake timeout in milliseconds when the profile does not provide `timeoutMs`. */
2832
- readyTimeoutMs?: number;
2840
+ /** Algorithm lists exchanged during SSH KEXINIT negotiation. */
2841
+ interface SshAlgorithmPreferences {
2842
+ compressionClientToServer: readonly string[];
2843
+ compressionServerToClient: readonly string[];
2844
+ encryptionClientToServer: readonly string[];
2845
+ encryptionServerToClient: readonly string[];
2846
+ kexAlgorithms: readonly string[];
2847
+ languagesClientToServer: readonly string[];
2848
+ languagesServerToClient: readonly string[];
2849
+ macClientToServer: readonly string[];
2850
+ macServerToClient: readonly string[];
2851
+ serverHostKeyAlgorithms: readonly string[];
2852
+ }
2853
+ /** Selected algorithms after intersecting client preferences with server capabilities. */
2854
+ interface NegotiatedSshAlgorithms {
2855
+ compressionClientToServer: string;
2856
+ compressionServerToClient: string;
2857
+ encryptionClientToServer: string;
2858
+ encryptionServerToClient: string;
2859
+ kexAlgorithm: string;
2860
+ languageClientToServer?: string;
2861
+ languageServerToClient?: string;
2862
+ macClientToServer: string;
2863
+ macServerToClient: string;
2864
+ serverHostKeyAlgorithm: string;
2865
+ }
2866
+
2867
+ /** Parsed SSH identification components from the RFC 4253 banner line. */
2868
+ interface SshIdentification {
2869
+ protocolVersion: string;
2870
+ softwareVersion: string;
2871
+ comments?: string;
2872
+ raw: string;
2873
+ }
2874
+
2875
+ /** Parsed SSH_MSG_KEXINIT payload. */
2876
+ interface SshKexInitMessage extends SshAlgorithmPreferences {
2877
+ cookie: Buffer$1;
2878
+ firstKexPacketFollows: boolean;
2879
+ messageType: number;
2880
+ reserved: number;
2881
+ }
2882
+
2883
+ /** Directional key material used after SSH NEWKEYS. */
2884
+ interface SshTransportDirectionKeys {
2885
+ encryptionKey: Buffer$1;
2886
+ iv: Buffer$1;
2887
+ macKey: Buffer$1;
2888
+ }
2889
+ /** Session key bundle derived from K, H, and session id. */
2890
+ interface SshDerivedSessionKeys {
2891
+ clientToServer: SshTransportDirectionKeys;
2892
+ exchangeHash: Buffer$1;
2893
+ serverToClient: SshTransportDirectionKeys;
2894
+ sessionId: Buffer$1;
2895
+ }
2896
+
2897
+ /** Initial client-side handshake state before key exchange math starts. */
2898
+ interface SshTransportHandshakeResult {
2899
+ keyExchange: {
2900
+ algorithm: string;
2901
+ clientKexInitPayload: Buffer$1;
2902
+ clientPublicKey: Buffer$1;
2903
+ exchangeHash: Buffer$1;
2904
+ serverHostKey: Buffer$1;
2905
+ serverKexInitPayload: Buffer$1;
2906
+ serverPublicKey: Buffer$1;
2907
+ serverSignature: Buffer$1;
2908
+ sessionId: Buffer$1;
2909
+ sharedSecret: Buffer$1;
2910
+ transportKeys: {
2911
+ clientToServer: SshDerivedSessionKeys["clientToServer"];
2912
+ serverToClient: SshDerivedSessionKeys["serverToClient"];
2913
+ };
2914
+ };
2915
+ negotiatedAlgorithms: NegotiatedSshAlgorithms;
2916
+ serverIdentification: SshIdentification;
2917
+ serverKexInit: SshKexInitMessage;
2918
+ /**
2919
+ * Number of unencrypted packets the client sent during the handshake (KEXINIT,
2920
+ * KEX_ECDH_INIT, NEWKEYS). Per RFC 4253 §6.4, packet sequence numbers are never
2921
+ * reset across NEWKEYS, so this value seeds the outbound protector.
2922
+ */
2923
+ outboundPacketCount: number;
2924
+ /**
2925
+ * Number of unencrypted packets the client received from the server during the
2926
+ * handshake (server KEXINIT, KEX_ECDH_REPLY, NEWKEYS). Seeds the inbound unprotector.
2927
+ */
2928
+ inboundPacketCount: number;
2833
2929
  }
2834
- /** Raw SFTP session handles exposed for advanced diagnostics. */
2835
- interface SftpRawSession {
2836
- /** Underlying ssh2 client connection. */
2837
- client: Client;
2838
- /** Underlying ssh2 SFTP wrapper. */
2839
- sftp: SFTPWrapper;
2930
+
2931
+ /** Standard SSH disconnect reason codes (RFC 4253 §11.1). */
2932
+ declare const SshDisconnectReason: {
2933
+ readonly HOST_NOT_ALLOWED_TO_CONNECT: 1;
2934
+ readonly PROTOCOL_ERROR: 2;
2935
+ readonly KEY_EXCHANGE_FAILED: 3;
2936
+ readonly MAC_ERROR: 5;
2937
+ readonly COMPRESSION_ERROR: 6;
2938
+ readonly SERVICE_NOT_AVAILABLE: 7;
2939
+ readonly PROTOCOL_VERSION_NOT_SUPPORTED: 8;
2940
+ readonly HOST_KEY_NOT_VERIFIABLE: 9;
2941
+ readonly CONNECTION_LOST: 10;
2942
+ readonly BY_APPLICATION: 11;
2943
+ readonly TOO_MANY_CONNECTIONS: 12;
2944
+ readonly AUTH_CANCELLED_BY_USER: 13;
2945
+ readonly NO_MORE_AUTH_METHODS: 14;
2946
+ readonly ILLEGAL_USER_NAME: 15;
2947
+ };
2948
+ type SshDisconnectReason = (typeof SshDisconnectReason)[keyof typeof SshDisconnectReason];
2949
+ interface SshTransportConnectionOptions {
2950
+ /** AbortSignal that cancels the in-flight `connect()` call and tears down the socket. */
2951
+ abortSignal?: AbortSignal;
2952
+ /** Algorithm preference overrides. Defaults to the library defaults. */
2953
+ algorithms?: SshAlgorithmPreferences;
2954
+ /** SSH software version string embedded in the identification line. */
2955
+ clientSoftwareVersion?: string;
2956
+ /**
2957
+ * Hard cap (milliseconds) on the SSH identification + key exchange + first
2958
+ * NEWKEYS handshake. If exceeded the socket is destroyed and `connect()`
2959
+ * rejects with a `TimeoutError`. Has no effect once `connect()` resolves.
2960
+ */
2961
+ handshakeTimeoutMs?: number;
2962
+ /**
2963
+ * If set, sends a `SSH_MSG_IGNORE` packet every `keepaliveIntervalMs`
2964
+ * milliseconds while the transport is connected and idle. This prevents
2965
+ * stateful NAT / firewall devices from dropping long-lived idle sessions
2966
+ * (e.g. between batches in a transfer queue). The timer is reset on every
2967
+ * outbound payload, so active transfers do not generate extra traffic.
2968
+ */
2969
+ keepaliveIntervalMs?: number;
2970
+ /**
2971
+ * Synchronous host-key policy hook invoked after the signature on the SSH
2972
+ * exchange hash is verified. Throw to reject the server's identity.
2973
+ */
2974
+ verifyHostKey?: (input: {
2975
+ hostKeyBlob: Buffer$1;
2976
+ hostKeySha256: Buffer$1;
2977
+ algorithmName: string;
2978
+ }) => void;
2840
2979
  }
2841
2980
  /**
2842
- * Creates an SFTP provider factory backed by the mature `ssh2` implementation.
2981
+ * Live SSH transport connection over a TCP socket.
2843
2982
  *
2844
- * @param options - Optional ssh2 host-key verifier and timeout defaults.
2845
- * @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
2983
+ * Runs the SSH identification exchange and key exchange handshake on the supplied socket,
2984
+ * then provides an encrypted packet send/receive interface for higher-level SSH layers
2985
+ * (authentication, connection, SFTP subsystem).
2846
2986
  *
2847
- * @example Register and use
2987
+ * Usage:
2848
2988
  * ```ts
2849
- * import { createSftpProviderFactory, createTransferClient } from "@zero-transfer/sdk";
2989
+ * const conn = new SshTransportConnection();
2990
+ * const result = await conn.connect(socket); // runs handshake
2991
+ * conn.sendPayload(payload); // post-NEWKEYS send
2992
+ * for await (const payload of conn.receivePayloads()) { ... }
2993
+ * conn.disconnect();
2994
+ * ```
2995
+ */
2996
+ declare class SshTransportConnection {
2997
+ private readonly options;
2998
+ private connected;
2999
+ private disposed;
3000
+ private protector;
3001
+ private unprotector;
3002
+ private socket;
3003
+ private keepaliveTimer;
3004
+ private readonly inboundQueue;
3005
+ /**
3006
+ * FIFO of waiters when the queue is empty. Multiple iterators may suspend on
3007
+ * the same transport (auth session, channel setup, connection-manager pump);
3008
+ * each receives exactly one entry in arrival order. A single-slot field would
3009
+ * lose wakeups when a second consumer suspends before the first is resolved.
3010
+ */
3011
+ private readonly waitingConsumers;
3012
+ constructor(options?: SshTransportConnectionOptions);
3013
+ /**
3014
+ * Runs the SSH handshake on a TCP-connected socket.
3015
+ * Resolves when NEWKEYS completes and the transport is ready for encrypted messages.
3016
+ * Rejects on socket error, abort, or protocol failure.
3017
+ */
3018
+ connect(socket: Socket): Promise<SshTransportHandshakeResult>;
3019
+ /**
3020
+ * Sends an SSH payload over the encrypted transport.
3021
+ * The payload must start with the SSH message type byte.
3022
+ */
3023
+ sendPayload(payload: Buffer$1 | Uint8Array): void;
3024
+ /**
3025
+ * Async generator that yields inbound SSH payloads (post-NEWKEYS).
3026
+ *
3027
+ * Transparent handling:
3028
+ * - SSH_MSG_IGNORE (2) and SSH_MSG_DEBUG (4) are silently dropped.
3029
+ * - SSH_MSG_DISCONNECT (1) from the server throws a `ConnectionError`.
3030
+ * - Socket error or close terminates the generator.
3031
+ */
3032
+ receivePayloads(): AsyncGenerator<Buffer$1>;
3033
+ /**
3034
+ * Sends SSH_MSG_DISCONNECT and ends the socket.
3035
+ * Safe to call multiple times; subsequent calls are no-ops.
3036
+ */
3037
+ disconnect(reason?: SshDisconnectReason, description?: string): void;
3038
+ isConnected(): boolean;
3039
+ private onEncryptedData;
3040
+ private onSocketError;
3041
+ private onSocketClose;
3042
+ private enqueueEntry;
3043
+ private dequeuePayload;
3044
+ private assertConnected;
3045
+ private startKeepalive;
3046
+ private stopKeepalive;
3047
+ private resetKeepaliveTimer;
3048
+ private sendKeepalivePing;
3049
+ }
3050
+
3051
+ /**
3052
+ * SSH session channel (RFC 4254 §6).
2850
3053
  *
2851
- * const client = createTransferClient({ providers: [createSftpProviderFactory()] });
3054
+ * Manages a single "session" channel from the client side:
3055
+ * CHANNEL_OPEN → OPEN_CONFIRMATION → CHANNEL_REQUEST (subsystem/exec) →
3056
+ * bidirectional CHANNEL_DATA with window management → CHANNEL_EOF/CLOSE.
3057
+ *
3058
+ * Window management strategy:
3059
+ * - Local window starts at INITIAL_WINDOW_SIZE.
3060
+ * - When consumed bytes exceed WINDOW_REFILL_THRESHOLD, a WINDOW_ADJUST is sent.
3061
+ * - Outbound data respects the remote window; excess is queued and flushed
3062
+ * as the remote issues WINDOW_ADJUST messages.
3063
+ */
3064
+
3065
+ interface SshSessionChannelOptions {
3066
+ /**
3067
+ * Local channel id allocated by the caller.
3068
+ * If omitted, defaults to 0 (single-channel use case).
3069
+ */
3070
+ localChannelId?: number;
3071
+ }
3072
+ /**
3073
+ * A single SSH session channel.
3074
+ * Not safe to share across concurrent callers; each SftpSession should own one.
3075
+ */
3076
+ declare class SshSessionChannel {
3077
+ private readonly transport;
3078
+ private phase;
3079
+ /** Remote channel id assigned by the server in OPEN_CONFIRMATION. */
3080
+ private remoteChannelId;
3081
+ /** Bytes the remote side can still receive before we must stop sending. */
3082
+ private remoteWindowRemaining;
3083
+ /** Maximum packet data size the remote accepts. */
3084
+ private remoteMaxPacketSize;
3085
+ /** Local window: bytes we can still accept from remote. */
3086
+ private localWindowConsumed;
3087
+ private localWindowSize;
3088
+ /** Queue of inbound data for the `receiveData()` generator. */
3089
+ private readonly inboundQueue;
3090
+ private waitingConsumer;
3091
+ /** Queue of outbound data waiting for remote window space. */
3092
+ private readonly outboundQueue;
3093
+ /**
3094
+ * FIFO of waiters blocked on remote window credit. Each WINDOW_ADJUST wakes
3095
+ * exactly one waiter; concurrent senders must not lose wakeups.
3096
+ */
3097
+ private readonly outboundDrainedWaiters;
3098
+ /** Serializes sendData() calls so byte order on the wire matches call order. */
3099
+ private sendChain;
3100
+ private readonly localChannelId;
3101
+ constructor(transport: SshTransportConnection, options?: SshSessionChannelOptions);
3102
+ /**
3103
+ * Opens the channel and requests a subsystem.
3104
+ * Resolves once the server confirms both CHANNEL_OPEN and the subsystem request.
3105
+ */
3106
+ openSubsystem(subsystemName: string): Promise<void>;
3107
+ /**
3108
+ * Opens the channel and executes a command.
3109
+ */
3110
+ openExec(command: string): Promise<void>;
3111
+ private openChannel;
3112
+ private requestSubsystem;
3113
+ private requestExec;
3114
+ private awaitChannelRequestReply;
3115
+ /**
3116
+ * Sends data on the channel. Respects the remote window; if there is no space,
3117
+ * splits the data and queues the remainder for when WINDOW_ADJUST arrives.
3118
+ *
3119
+ * Concurrent calls are serialized so wire byte order matches call order.
3120
+ */
3121
+ sendData(data: Uint8Array): Promise<void>;
3122
+ private sendDataLocked;
3123
+ /**
3124
+ * Async generator that yields raw data buffers from the channel.
3125
+ * Returns (done) when the channel receives EOF or CLOSE.
3126
+ */
3127
+ receiveData(): AsyncGenerator<Buffer$1, void, undefined>;
3128
+ /**
3129
+ * Sends EOF and CLOSE. Should be called when the client is done sending.
3130
+ */
3131
+ close(): void;
3132
+ /**
3133
+ * Feed an inbound transport payload to this channel.
3134
+ * Called by the channel multiplexer (`SshConnectionManager`).
3135
+ */
3136
+ dispatch(payload: Buffer$1): void;
3137
+ dispatchError(error: Error): void;
3138
+ private consumeLocalWindow;
3139
+ private enqueueInbound;
3140
+ private dequeueInbound;
3141
+ /** Pull the next payload from the transport (used during channel setup only). */
3142
+ private nextPayload;
3143
+ }
3144
+
3145
+ /**
3146
+ * SFTP v3 file attribute encoding and decoding (draft-ietf-secsh-filexfer-02 §5).
3147
+ *
3148
+ * ATTRS flags:
3149
+ * SSH_FILEXFER_ATTR_SIZE 0x00000001
3150
+ * SSH_FILEXFER_ATTR_UIDGID 0x00000002
3151
+ * SSH_FILEXFER_ATTR_PERMISSIONS 0x00000004
3152
+ * SSH_FILEXFER_ATTR_ACMODTIME 0x00000008
3153
+ * SSH_FILEXFER_ATTR_EXTENDED 0x80000000
3154
+ */
3155
+
3156
+ interface SftpFileAttributes {
3157
+ /** File size in bytes. Present when SFTP_ATTR_FLAG.SIZE is set. */
3158
+ size?: bigint;
3159
+ /** User id. Present when SFTP_ATTR_FLAG.UIDGID is set. */
3160
+ uid?: number;
3161
+ /** Group id. Present when SFTP_ATTR_FLAG.UIDGID is set. */
3162
+ gid?: number;
3163
+ /** POSIX file permissions (octal mode). Present when SFTP_ATTR_FLAG.PERMISSIONS is set. */
3164
+ permissions?: number;
3165
+ /** Access time (seconds since Unix epoch). Present when SFTP_ATTR_FLAG.ACMODTIME is set. */
3166
+ atime?: number;
3167
+ /** Modification time (seconds since Unix epoch). Present when SFTP_ATTR_FLAG.ACMODTIME is set. */
3168
+ mtime?: number;
3169
+ /**
3170
+ * Extended attributes as key-value pairs.
3171
+ * Present when SFTP_ATTR_FLAG.EXTENDED is set.
3172
+ */
3173
+ extended?: Array<{
3174
+ type: string;
3175
+ data: Buffer$1;
3176
+ }>;
3177
+ }
3178
+
3179
+ /**
3180
+ * SFTP v3 request and response message codecs (draft-ietf-secsh-filexfer-02).
3181
+ *
3182
+ * Each encode function produces the payload bytes that go inside an
3183
+ * SSH_FXP_* packet (the type byte and length prefix are added by the framer).
3184
+ *
3185
+ * Each decode function accepts the full framed packet payload (starting at the
3186
+ * byte immediately after the type byte, i.e. at request-id).
3187
+ */
3188
+
3189
+ interface SftpVersionResponse {
3190
+ version: number;
3191
+ extensions: Array<{
3192
+ name: string;
3193
+ data: string;
3194
+ }>;
3195
+ }
3196
+ /** A single entry returned by SSH_FXP_NAME. */
3197
+ interface SftpNameEntry {
3198
+ filename: string;
3199
+ longname: string;
3200
+ attrs: SftpFileAttributes;
3201
+ }
3202
+
3203
+ /**
3204
+ * SFTP v3 client session (draft-ietf-secsh-filexfer-02).
3205
+ *
3206
+ * Provides a fully concurrent, typed API over an open SSH session channel.
3207
+ * Multiple requests can be in flight simultaneously; each is tracked by its
3208
+ * SFTP request id. Responses are dispatched to the correct awaiter.
3209
+ *
3210
+ * Lifecycle:
3211
+ * const channel = await connectionManager.openSubsystemChannel("sftp");
3212
+ * const sftp = new SftpSession(channel);
3213
+ * await sftp.init();
3214
+ * const handle = await sftp.open("/path/to/file", SFTP_OPEN_FLAG.READ, {});
3215
+ * const data = await sftp.read(handle, 0n, 4096);
3216
+ * await sftp.close(handle);
3217
+ */
3218
+
3219
+ declare class SftpSession {
3220
+ private readonly channel;
3221
+ private nextRequestId;
3222
+ private readonly pending;
3223
+ private readonly framer;
3224
+ /** Resolves on the first packet (VERSION) during init(). */
3225
+ private versionWaiter;
3226
+ private serverVersion;
3227
+ constructor(channel: SshSessionChannel);
3228
+ /**
3229
+ * Sends SSH_FXP_INIT and awaits SSH_FXP_VERSION.
3230
+ * Must be called once before any other operation.
3231
+ */
3232
+ init(): Promise<SftpVersionResponse>;
3233
+ get negotiatedVersion(): number;
3234
+ /**
3235
+ * Opens a remote file. Returns an opaque handle buffer.
3236
+ */
3237
+ open(path: string, pflags: number, attrs?: SftpFileAttributes): Promise<Buffer$1>;
3238
+ /**
3239
+ * Closes a file or directory handle.
3240
+ */
3241
+ close(handle: Uint8Array): Promise<void>;
3242
+ /**
3243
+ * Reads up to `length` bytes from `handle` at `offset`.
3244
+ * Returns `null` on EOF.
3245
+ */
3246
+ read(handle: Uint8Array, offset: bigint, length: number): Promise<Buffer$1 | null>;
3247
+ /**
3248
+ * Writes `data` to `handle` at `offset`.
3249
+ */
3250
+ write(handle: Uint8Array, offset: bigint, data: Uint8Array): Promise<void>;
3251
+ stat(path: string): Promise<SftpFileAttributes>;
3252
+ lstat(path: string): Promise<SftpFileAttributes>;
3253
+ fstat(handle: Uint8Array): Promise<SftpFileAttributes>;
3254
+ setstat(path: string, attrs: SftpFileAttributes): Promise<void>;
3255
+ fsetstat(handle: Uint8Array, attrs: SftpFileAttributes): Promise<void>;
3256
+ opendir(path: string): Promise<Buffer$1>;
3257
+ /**
3258
+ * Reads one batch of directory entries.
3259
+ * Returns an empty array when the server sends SSH_FX_EOF.
3260
+ */
3261
+ readdir(handle: Uint8Array): Promise<SftpNameEntry[]>;
3262
+ /**
3263
+ * Convenience: opens a directory, reads all entries, and closes the handle.
3264
+ */
3265
+ readdirAll(path: string): Promise<SftpNameEntry[]>;
3266
+ remove(path: string): Promise<void>;
3267
+ mkdir(path: string, attrs?: SftpFileAttributes): Promise<void>;
3268
+ rmdir(path: string): Promise<void>;
3269
+ realpath(path: string): Promise<string>;
3270
+ rename(oldPath: string, newPath: string): Promise<void>;
3271
+ readlink(path: string): Promise<string>;
3272
+ symlink(linkPath: string, targetPath: string): Promise<void>;
3273
+ private allocRequestId;
3274
+ /**
3275
+ * Sends raw SFTP message bytes over the channel.
3276
+ * The message encoders embed the type byte at position 0, followed by the body.
3277
+ * We prefix with a uint32 length so the remote SFTP framer can parse the frame.
3278
+ *
3279
+ * Send is asynchronous because the underlying SSH channel may apply
3280
+ * backpressure when the remote window is exhausted; the channel itself
3281
+ * serializes concurrent calls so byte ordering is preserved.
3282
+ */
3283
+ private sendRaw;
3284
+ private pump;
3285
+ private dispatchPacket;
3286
+ private awaitResponse;
3287
+ }
3288
+
3289
+ /**
3290
+ * Options for {@link createNativeSftpProviderFactory}.
3291
+ *
3292
+ * The native provider is a zero-dependency replacement for the legacy
3293
+ * `ssh2`-backed provider. It implements RFC 4253 SSH transport, RFC 4252 user
3294
+ * authentication (`password`, `keyboard-interactive`, `publickey` with
3295
+ * Ed25519/RSA), RFC 5656 ECDSA host keys (`nistp256/384/521`), and the
3296
+ * SFTP v3 client protocol multiplexed over a single channel.
3297
+ */
3298
+ interface NativeSftpProviderOptions {
3299
+ /**
3300
+ * Default connection timeout in milliseconds when the profile omits
3301
+ * `timeoutMs`. Bounds both the TCP connect *and* the SSH identification +
3302
+ * key-exchange handshake, so a hung server cannot stall `connect()`
3303
+ * indefinitely after the socket is accepted.
3304
+ */
3305
+ readyTimeoutMs?: number;
3306
+ /**
3307
+ * Default interval (milliseconds) between SSH-level keepalive pings sent
3308
+ * once the transport is connected and idle. Prevents stateful firewalls /
3309
+ * NAT devices from dropping long-lived sessions. The timer is reset on
3310
+ * every outbound payload so active transfers do not generate extra
3311
+ * traffic. Disabled when omitted or `0`.
3312
+ */
3313
+ keepaliveIntervalMs?: number;
3314
+ }
3315
+ /**
3316
+ * Low-level handles exposed by a native SFTP session for diagnostics and
3317
+ * advanced extension. Most applications should use the
3318
+ * {@link TransferSession} returned from `client.connect()` instead.
3319
+ */
3320
+ interface NativeSftpRawSession {
3321
+ /** SFTP v3 client multiplexed over the SSH session channel. */
3322
+ sftp: SftpSession;
3323
+ /** Underlying SSH transport (key exchange, packet protection, channel mux). */
3324
+ transport: SshTransportConnection;
3325
+ }
3326
+ /**
3327
+ * Creates a {@link ProviderFactory} backed by the native SSH/SFTP protocol
3328
+ * stack — no `ssh2` dependency required.
3329
+ *
3330
+ * **Supported algorithms**
3331
+ * - Key exchange: `curve25519-sha256`, `curve25519-sha256@libssh.org`
3332
+ * - Host keys: `ssh-ed25519`, `ecdsa-sha2-nistp256/384/521`, `rsa-sha2-256`,
3333
+ * `rsa-sha2-512` (legacy SHA-1 `ssh-rsa` is rejected)
3334
+ * - Ciphers: `aes128-ctr`, `aes256-ctr`
3335
+ * - MACs: `hmac-sha2-256`, `hmac-sha2-512`
3336
+ *
3337
+ * **Authentication**
3338
+ * - `password`
3339
+ * - `keyboard-interactive` (RFC 4256)
3340
+ * - `publickey` for Ed25519 and RSA private keys (`rsa-sha2-512` preferred,
3341
+ * `rsa-sha2-256` fallback). Encrypted keys are unlocked via
3342
+ * `profile.ssh.passphrase`.
2852
3343
  *
3344
+ * **Host-key verification**
3345
+ * - The server's signature over the exchange hash is always verified.
3346
+ * - Optional pinning via `profile.ssh.pinnedHostKeySha256` (`SHA256:...`,
3347
+ * raw base64, or hex).
3348
+ * - Optional `profile.ssh.knownHosts` (OpenSSH format, hashed and plain
3349
+ * patterns, `[host]:port`, negation, and `@revoked` markers).
3350
+ *
3351
+ * **Resilience**
3352
+ * - `readyTimeoutMs` bounds TCP connect + SSH handshake.
3353
+ * - `keepaliveIntervalMs` keeps idle sessions alive through stateful
3354
+ * firewalls / NAT.
3355
+ *
3356
+ * @example
3357
+ * ```ts
3358
+ * const client = createTransferClient({
3359
+ * providers: [createNativeSftpProviderFactory({
3360
+ * readyTimeoutMs: 10_000,
3361
+ * keepaliveIntervalMs: 30_000,
3362
+ * })],
3363
+ * });
2853
3364
  * const session = await client.connect({
2854
- * host: "sftp.example.com",
2855
3365
  * provider: "sftp",
3366
+ * host: "sftp.example.com",
2856
3367
  * username: "deploy",
2857
3368
  * ssh: {
2858
- * privateKey: { path: "./keys/id_ed25519" },
2859
- * // Optional but recommended for production:
2860
- * pinnedHostKeySha256: "SHA256:abc123basesixfourpinFromKnownHosts=",
3369
+ * privateKey: { kind: "literal", value: process.env.DEPLOY_KEY! },
3370
+ * pinnedHostKeySha256: "SHA256:abc...",
2861
3371
  * },
2862
3372
  * });
2863
3373
  * ```
2864
- *
2865
- * Host-key verification (`ssh.knownHosts` and/or `ssh.pinnedHostKeySha256`) is
2866
- * optional; without either, the client trusts whatever host key the server
2867
- * presents. Use one for any non-lab deployment.
2868
- */
2869
- declare function createSftpProviderFactory(options?: SftpProviderOptions): ProviderFactory;
2870
-
2871
- /** Options for {@link createSftpJumpHostSocketFactory}. */
2872
- interface SftpJumpHostOptions {
2873
- /** Static ssh2 connect configuration for the bastion. Mutually exclusive with {@link buildBastion}. */
2874
- bastion?: ConnectConfig;
2875
- /** Per-connection builder used to refresh credentials before each tunnel attempt. */
2876
- buildBastion?: (context: SshSocketFactoryContext) => ConnectConfig | Promise<ConnectConfig>;
2877
- /** Optional logger used for tunnel diagnostics. */
2878
- logger?: ZeroTransferLogger;
2879
- /** Optional ssh2 client factory override used in tests. */
2880
- createClient?: () => Client;
2881
- }
2882
- /**
2883
- * Builds an {@link SshSocketFactory} that tunnels SFTP connections through a bastion host.
2884
- *
2885
- * @param options - Bastion configuration and overrides.
2886
- * @returns Factory that returns a forwarded ssh2 channel stream when invoked.
2887
- * @throws {@link ConfigurationError} When neither {@link SftpJumpHostOptions.bastion} nor {@link SftpJumpHostOptions.buildBastion} is supplied.
2888
3374
  */
2889
- declare function createSftpJumpHostSocketFactory(options: SftpJumpHostOptions): SshSocketFactory;
3375
+ declare function createNativeSftpProviderFactory(options?: NativeSftpProviderOptions): ProviderFactory;
2890
3376
 
2891
3377
  /**
2892
3378
  * Transfer result and progress calculation helpers.
@@ -4534,4 +5020,4 @@ declare function joinRemotePath(...segments: string[]): string;
4534
5020
  */
4535
5021
  declare function basenameRemotePath(input: string): string;
4536
5022
 
4537
- export { AbortError, type AgeRetentionPolicy, ApprovalRegistry, ApprovalRejectedError, type ApprovalRequest, type ApprovalStatus, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type AzureBlobProviderOptions, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, type BuiltinCapabilityMatrixEntry, type BuiltinProviderMatrixId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionProfile, type ConventionEndpoint, type CopyBetweenOptions, type CountRetentionPolicy, type CreateApprovalGateOptions, type CreateAtomicDeployPlanOptions, type CreateInboxRouteOptions, type CreateOutboxRouteOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type CreateWebhookAuditLogOptions, type CronExpression, type CronField, type CronScheduleTrigger, DEFAULT_FAILED_SUBDIR, DEFAULT_PROCESSED_SUBDIR, type DiffRemoteTreesOptions, type DispatchWebhookOptions, type DispatchWebhookResult, type DownloadFileOptions, type DropboxProviderOptions, type EnvSecretSource, type EvaluateRetentionOptions, type FileSecretSource, type FileZillaSite, type FriendlyTransferOptions, type FtpFeatures, type FtpPassiveHostStrategy, type FtpProviderOptions, type FtpReplyErrorInput, type FtpResponse, FtpResponseParser, type FtpResponseStatus, type FtpsDataProtection, type FtpsMode, type FtpsProviderOptions, type GcsProviderOptions, type GoogleDriveProviderOptions, type HttpFetch, type HttpProviderOptions, type ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, InMemoryAuditLog, type IntervalScheduleTrigger, type JsonlWriter, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MftAuditEntry, type MftAuditEntryType, type MftAuditLog, type MftInboxConvention, type MftOutboxConvention, type MftRoute, type MftRouteEndpoint, type MftRouteFilter, type MftRouteOperation, type MftSchedule, type MftScheduleTrigger, MftScheduler, type MftSchedulerOptions, type MkdirOptions, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OneDriveProviderOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type ProgressEventInput, ProtocolError, type AuthenticationCapability as ProviderAuthenticationCapability, type CapabilitySet as ProviderCapabilities, type ChecksumCapability as ProviderChecksumCapability, type ProviderFactory, type ProviderId, type MetadataCapability as ProviderMetadataCapability, ProviderRegistry, type ProviderSelection, type ProviderTransferEndpointRole, type ProviderTransferExecutorOptions, type ProviderTransferOperations, type ProviderTransferReadRequest, type ProviderTransferReadResult, type ProviderTransferRequest, type ProviderTransferSessionResolver, type ProviderTransferSessionResolverInput, type ProviderTransferWriteRequest, type ProviderTransferWriteResult, REDACTED, REMOTE_MANIFEST_FORMAT_VERSION, type RemoteBreadcrumb, type RemoteBrowser, type RemoteBrowserFilter, type RemoteBrowserSnapshot, type RemoteEntry, type RemoteEntrySortKey, type RemoteEntrySortOrder, type RemoteEntryType, type RemoteFileAdapter, type RemoteFileEndpoint, type RemoteFileSystem, type RemoteManifest, type RemoteManifestEntry, type RemotePermissions, type RemoteProtocol, type RemoteStat, type RemoteTreeDiff, type RemoteTreeDiffEntry, type RemoteTreeDiffReason, type RemoteTreeDiffStatus, type RemoteTreeDiffSummary, type RemoteTreeEntry, type RemoteTreeFilter, type RemoveOptions, type RenameOptions, type ResolveSecretOptions, type ResolvedConnectionProfile, type ResolvedOpenSshHost, type ResolvedSshProfile, type ResolvedTlsProfile, type RetentionEvaluation, type RetentionPolicy, type RmdirOptions, RouteRegistry, type RunConnectionDiagnosticsOptions, type RunRouteOptions, type S3MultipartCheckpoint, type S3MultipartOptions, type S3MultipartPart, type S3MultipartResumeKey, type S3MultipartResumeStore, type S3ProviderOptions, ScheduleRegistry, type ScheduleRouteRunner, type ScheduleTimerHooks, type SecretProvider, type SecretSource, type SecretValue, type SftpJumpHostOptions, type SftpProviderOptions, type SftpRawSession, type SpecializedErrorDetails, type SshAgentSource, type SshAlgorithms, type SshKeyboardInteractiveChallenge, type SshKeyboardInteractiveHandler, type SshKeyboardInteractivePrompt, type SshKnownHostsSource, type SshProfile, type SshSocketFactory, type SshSocketFactoryContext, type StatOptions, type SyncConflictPolicy, type SyncDeletePolicy, type SyncDirection, type SyncEndpointInput, TimeoutError, type TlsProfile, type TlsSecretSource, type TransferAttempt, type TransferAttemptError, type TransferBandwidthLimit, type TransferByteRange, TransferClient, type TransferClientOptions, type TransferDataChunk, type TransferDataSource, type TransferEndpoint, TransferEngine, type TransferEngineExecuteOptions, type TransferEngineOptions, TransferError, type TransferExecutionContext, type TransferExecutionResult, type TransferExecutor, type TransferJob, type TransferOperation, type TransferPlan, type TransferPlanAction, type TransferPlanInput, type TransferPlanStep, type TransferPlanSummary, type TransferProgressEvent, type TransferProvider, TransferQueue, type TransferQueueExecutorResolver, type TransferQueueItem, type TransferQueueItemStatus, type TransferQueueOptions, type TransferQueueRunOptions, type TransferQueueSummary, type TransferReceipt, type TransferResult, type TransferResultInput, type TransferRetryDecisionInput, type TransferRetryPolicy, type TransferSession, type TransferTimeoutPolicy, type TransferVerificationResult, UnsupportedFeatureError, type UploadFileOptions, type ValueSecretSource, VerificationError, type WalkRemoteTreeOptions, type WebDavProviderOptions, type WebhookRetryPolicy, type WebhookSignature, type WebhookTarget, type WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildRemoteBreadcrumbs, compareRemoteManifests, composeAuditLogs, copyBetween, createApprovalGate, createAtomicDeployPlan, createAzureBlobProviderFactory, createBandwidthThrottle, createDropboxProviderFactory, createFtpProviderFactory, createFtpsProviderFactory, createGcsProviderFactory, createGoogleDriveProviderFactory, createHttpProviderFactory, createInboxRoute, createJsonlAuditLog, createLocalProviderFactory, createMemoryProviderFactory, createMemoryS3MultipartResumeStore, createOAuthTokenSecretSource, createOneDriveProviderFactory, createOutboxRoute, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createS3ProviderFactory, createSftpJumpHostSocketFactory, createSftpProviderFactory, createSyncPlan, createTransferClient, createTransferJobsFromPlan, createTransferPlan, createTransferResult, createWebDavProviderFactory, createWebhookAuditLog, diffRemoteTrees, dispatchWebhook, downloadFile, emitLog, errorFromFtpReply, evaluateRetention, filterRemoteEntries, formatCapabilityMatrixMarkdown, freezeReceipt, getBuiltinCapabilityMatrix, importFileZillaSites, importOpenSshConfig, importWinScpSessions, inboxFailedPath, inboxProcessedPath, isClassicProviderId, isSensitiveKey, joinRemotePath, matchKnownHosts, matchKnownHostsEntry, nextCronFireAt, nextScheduleFireAt, noopLogger, normalizeRemotePath, parentRemotePath, parseCronExpression, parseFtpFeatures, parseFtpResponseLines, parseKnownHosts, parseMlsdLine, parseMlsdList, parseMlstTimestamp, parseOpenSshConfig, parseRemoteManifest, parseUnixList, parseUnixListLine, redactCommand, redactConnectionProfile, redactObject, redactSecretSource, redactValue, resolveConnectionProfileSecrets, resolveOpenSshHost, resolveProviderId, resolveSecret, runConnectionDiagnostics, runRoute, serializeRemoteManifest, signWebhookPayload, sortRemoteEntries, summarizeClientDiagnostics, summarizeError, summarizeTransferPlan, throttleByteIterable, uploadFile, validateConnectionProfile, validateSchedule, walkRemoteTree };
5023
+ export { AbortError, type AgeRetentionPolicy, ApprovalRegistry, ApprovalRejectedError, type ApprovalRequest, type ApprovalStatus, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type AzureBlobProviderOptions, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, type BuiltinCapabilityMatrixEntry, type BuiltinProviderMatrixId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionProfile, type ConventionEndpoint, type CopyBetweenOptions, type CountRetentionPolicy, type CreateApprovalGateOptions, type CreateAtomicDeployPlanOptions, type CreateInboxRouteOptions, type CreateOutboxRouteOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type CreateWebhookAuditLogOptions, type CronExpression, type CronField, type CronScheduleTrigger, DEFAULT_FAILED_SUBDIR, DEFAULT_PROCESSED_SUBDIR, type DiffRemoteTreesOptions, type DispatchWebhookOptions, type DispatchWebhookResult, type DownloadFileOptions, type DropboxProviderOptions, type EnvSecretSource, type EvaluateRetentionOptions, type FileSecretSource, type FileZillaSite, type FriendlyTransferOptions, type FtpFeatures, type FtpPassiveHostStrategy, type FtpProviderOptions, type FtpReplyErrorInput, type FtpResponse, FtpResponseParser, type FtpResponseStatus, type FtpsDataProtection, type FtpsMode, type FtpsProviderOptions, type GcsProviderOptions, type GoogleDriveProviderOptions, type HttpFetch, type HttpProviderOptions, type ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, InMemoryAuditLog, type IntervalScheduleTrigger, type JsonlWriter, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MftAuditEntry, type MftAuditEntryType, type MftAuditLog, type MftInboxConvention, type MftOutboxConvention, type MftRoute, type MftRouteEndpoint, type MftRouteFilter, type MftRouteOperation, type MftSchedule, type MftScheduleTrigger, MftScheduler, type MftSchedulerOptions, type MkdirOptions, type NativeSftpProviderOptions, type NativeSftpRawSession, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OneDriveProviderOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type ProgressEventInput, ProtocolError, type AuthenticationCapability as ProviderAuthenticationCapability, type CapabilitySet as ProviderCapabilities, type ChecksumCapability as ProviderChecksumCapability, type ProviderFactory, type ProviderId, type MetadataCapability as ProviderMetadataCapability, ProviderRegistry, type ProviderSelection, type ProviderTransferEndpointRole, type ProviderTransferExecutorOptions, type ProviderTransferOperations, type ProviderTransferReadRequest, type ProviderTransferReadResult, type ProviderTransferRequest, type ProviderTransferSessionResolver, type ProviderTransferSessionResolverInput, type ProviderTransferWriteRequest, type ProviderTransferWriteResult, REDACTED, REMOTE_MANIFEST_FORMAT_VERSION, type RemoteBreadcrumb, type RemoteBrowser, type RemoteBrowserFilter, type RemoteBrowserSnapshot, type RemoteEntry, type RemoteEntrySortKey, type RemoteEntrySortOrder, type RemoteEntryType, type RemoteFileAdapter, type RemoteFileEndpoint, type RemoteFileSystem, type RemoteManifest, type RemoteManifestEntry, type RemotePermissions, type RemoteProtocol, type RemoteStat, type RemoteTreeDiff, type RemoteTreeDiffEntry, type RemoteTreeDiffReason, type RemoteTreeDiffStatus, type RemoteTreeDiffSummary, type RemoteTreeEntry, type RemoteTreeFilter, type RemoveOptions, type RenameOptions, type ResolveSecretOptions, type ResolvedConnectionProfile, type ResolvedOpenSshHost, type ResolvedSshProfile, type ResolvedTlsProfile, type RetentionEvaluation, type RetentionPolicy, type RmdirOptions, RouteRegistry, type RunConnectionDiagnosticsOptions, type RunRouteOptions, type S3MultipartCheckpoint, type S3MultipartOptions, type S3MultipartPart, type S3MultipartResumeKey, type S3MultipartResumeStore, type S3ProviderOptions, ScheduleRegistry, type ScheduleRouteRunner, type ScheduleTimerHooks, type SecretProvider, type SecretSource, type SecretValue, type NativeSftpProviderOptions as SftpProviderOptions, type NativeSftpRawSession as SftpRawSession, type SpecializedErrorDetails, type SshAgentSource, type SshAlgorithms, type SshKeyboardInteractiveChallenge, type SshKeyboardInteractiveHandler, type SshKeyboardInteractivePrompt, type SshKnownHostsSource, type SshProfile, type SshSocketFactory, type SshSocketFactoryContext, type StatOptions, type SyncConflictPolicy, type SyncDeletePolicy, type SyncDirection, type SyncEndpointInput, TimeoutError, type TlsProfile, type TlsSecretSource, type TransferAttempt, type TransferAttemptError, type TransferBandwidthLimit, type TransferByteRange, TransferClient, type TransferClientOptions, type TransferDataChunk, type TransferDataSource, type TransferEndpoint, TransferEngine, type TransferEngineExecuteOptions, type TransferEngineOptions, TransferError, type TransferExecutionContext, type TransferExecutionResult, type TransferExecutor, type TransferJob, type TransferOperation, type TransferPlan, type TransferPlanAction, type TransferPlanInput, type TransferPlanStep, type TransferPlanSummary, type TransferProgressEvent, type TransferProvider, TransferQueue, type TransferQueueExecutorResolver, type TransferQueueItem, type TransferQueueItemStatus, type TransferQueueOptions, type TransferQueueRunOptions, type TransferQueueSummary, type TransferReceipt, type TransferResult, type TransferResultInput, type TransferRetryDecisionInput, type TransferRetryPolicy, type TransferSession, type TransferTimeoutPolicy, type TransferVerificationResult, UnsupportedFeatureError, type UploadFileOptions, type ValueSecretSource, VerificationError, type WalkRemoteTreeOptions, type WebDavProviderOptions, type WebhookRetryPolicy, type WebhookSignature, type WebhookTarget, type WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildRemoteBreadcrumbs, compareRemoteManifests, composeAuditLogs, copyBetween, createApprovalGate, createAtomicDeployPlan, createAzureBlobProviderFactory, createBandwidthThrottle, createDropboxProviderFactory, createFtpProviderFactory, createFtpsProviderFactory, createGcsProviderFactory, createGoogleDriveProviderFactory, createHttpProviderFactory, createInboxRoute, createJsonlAuditLog, createLocalProviderFactory, createMemoryProviderFactory, createMemoryS3MultipartResumeStore, createNativeSftpProviderFactory, createOAuthTokenSecretSource, createOneDriveProviderFactory, createOutboxRoute, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createS3ProviderFactory, createNativeSftpProviderFactory as createSftpProviderFactory, createSyncPlan, createTransferClient, createTransferJobsFromPlan, createTransferPlan, createTransferResult, createWebDavProviderFactory, createWebhookAuditLog, diffRemoteTrees, dispatchWebhook, downloadFile, emitLog, errorFromFtpReply, evaluateRetention, filterRemoteEntries, formatCapabilityMatrixMarkdown, freezeReceipt, getBuiltinCapabilityMatrix, importFileZillaSites, importOpenSshConfig, importWinScpSessions, inboxFailedPath, inboxProcessedPath, isClassicProviderId, isSensitiveKey, joinRemotePath, matchKnownHosts, matchKnownHostsEntry, nextCronFireAt, nextScheduleFireAt, noopLogger, normalizeRemotePath, parentRemotePath, parseCronExpression, parseFtpFeatures, parseFtpResponseLines, parseKnownHosts, parseMlsdLine, parseMlsdList, parseMlstTimestamp, parseOpenSshConfig, parseRemoteManifest, parseUnixList, parseUnixListLine, redactCommand, redactConnectionProfile, redactObject, redactSecretSource, redactValue, resolveConnectionProfileSecrets, resolveOpenSshHost, resolveProviderId, resolveSecret, runConnectionDiagnostics, runRoute, serializeRemoteManifest, signWebhookPayload, sortRemoteEntries, summarizeClientDiagnostics, summarizeError, summarizeTransferPlan, throttleByteIterable, uploadFile, validateConnectionProfile, validateSchedule, walkRemoteTree };