@pyrokine/mcp-ssh 2.4.1 → 2.4.3
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/README.md +174 -130
- package/README_zh.md +232 -128
- package/dist/directory-verification.js +29 -4
- package/dist/file-ops.d.ts +13 -8
- package/dist/file-ops.js +191 -115
- package/dist/forward-manager.js +9 -3
- package/dist/operation-manager.d.ts +0 -5
- package/dist/operation-manager.js +13 -55
- package/dist/pty-manager.d.ts +3 -3
- package/dist/pty-manager.js +61 -15
- package/dist/session-manager.d.ts +3 -3
- package/dist/session-manager.js +44 -20
- package/dist/sftp-timeout.d.ts +9 -0
- package/dist/sftp-timeout.js +49 -0
- package/dist/tools/connection.js +75 -29
- package/dist/tools/exec.js +16 -6
- package/dist/tools/file.js +101 -55
- package/dist/tools/forward.js +6 -5
- package/dist/tools/operation.js +2 -1
- package/dist/tools/pty.js +17 -13
- package/dist/tools/schema.d.ts +4 -0
- package/dist/tools/schema.js +9 -0
- package/dist/types.d.ts +15 -0
- package/dist/utf8.d.ts +3 -0
- package/dist/utf8.js +44 -0
- package/package.json +8 -8
package/dist/file-ops.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ type ValidatedLocalUploadSource = {
|
|
|
23
23
|
stats: fs.Stats;
|
|
24
24
|
};
|
|
25
25
|
export declare function validateUploadFileSource(localPath: string): ValidatedLocalUploadSource;
|
|
26
|
-
export declare function validateSyncUploadSource(localPath: string, followSymlinks?: boolean
|
|
26
|
+
export declare function validateSyncUploadSource(localPath: string, followSymlinks?: boolean): ValidatedLocalUploadSource;
|
|
27
27
|
export declare function probeLocalPath(localPath: string, followSymlinks?: boolean): {
|
|
28
28
|
exists: boolean;
|
|
29
29
|
inputPath: string;
|
|
@@ -59,16 +59,17 @@ export declare function hashRemoteFileDigest(alias: string, remotePath: string,
|
|
|
59
59
|
export declare class RemoteRenameNotStartedError extends Error {
|
|
60
60
|
constructor(message: string);
|
|
61
61
|
}
|
|
62
|
-
export declare function renameRemoteFile(alias: string, sourcePath: string, targetPath: string, replaceExisting?: boolean): Promise<void>;
|
|
62
|
+
export declare function renameRemoteFile(alias: string, sourcePath: string, targetPath: string, replaceExisting?: boolean, timeout?: number): Promise<void>;
|
|
63
63
|
export declare function removeRemoteFile(alias: string, remotePath: string): Promise<void>;
|
|
64
64
|
export declare class UploadFileError extends Error {
|
|
65
65
|
readonly remoteCreated: boolean;
|
|
66
|
+
readonly details?: Record<string, unknown>;
|
|
66
67
|
constructor(message: string, remoteCreated: boolean, options?: ErrorOptions);
|
|
67
68
|
}
|
|
68
69
|
/**
|
|
69
70
|
* 上传文件
|
|
70
71
|
*/
|
|
71
|
-
export declare function uploadFile(alias: string, localPath: string, remotePath: string, onProgress?: (progress: TransferProgress) => void, sharedSftp?: SFTPWrapper, createMode?: number, signal?: AbortSignal, followSymlinks?: boolean, exclusive?: boolean): Promise<{
|
|
72
|
+
export declare function uploadFile(alias: string, localPath: string, remotePath: string, onProgress?: (progress: TransferProgress) => void, sharedSftp?: SFTPWrapper, createMode?: number, signal?: AbortSignal, followSymlinks?: boolean, exclusive?: boolean, timeout?: number): Promise<{
|
|
72
73
|
success: boolean;
|
|
73
74
|
size: number;
|
|
74
75
|
createMode: string;
|
|
@@ -76,7 +77,7 @@ export declare function uploadFile(alias: string, localPath: string, remotePath:
|
|
|
76
77
|
/**
|
|
77
78
|
* 下载文件
|
|
78
79
|
*/
|
|
79
|
-
export declare function downloadFile(alias: string, remotePath: string, localPath: string, onProgress?: (progress: TransferProgress) => void, sharedSftp?: SFTPWrapper, signal?: AbortSignal): Promise<{
|
|
80
|
+
export declare function downloadFile(alias: string, remotePath: string, localPath: string, onProgress?: (progress: TransferProgress) => void, sharedSftp?: SFTPWrapper, signal?: AbortSignal, timeout?: number): Promise<{
|
|
80
81
|
success: boolean;
|
|
81
82
|
size: number;
|
|
82
83
|
atomic: true;
|
|
@@ -89,13 +90,17 @@ type ReadFileOptions = {
|
|
|
89
90
|
offset?: number;
|
|
90
91
|
tail?: boolean;
|
|
91
92
|
lineRange?: string;
|
|
93
|
+
timeout?: number;
|
|
92
94
|
};
|
|
93
95
|
type ReadFileResult = {
|
|
94
96
|
content: string;
|
|
95
97
|
size: number;
|
|
96
98
|
total_size: number;
|
|
97
99
|
read_offset: number;
|
|
100
|
+
requested_offset?: number;
|
|
98
101
|
read_bytes: number;
|
|
102
|
+
read_end?: number;
|
|
103
|
+
next_offset?: number;
|
|
99
104
|
remaining_bytes?: number;
|
|
100
105
|
sample_kind: ReadFileSampleKind;
|
|
101
106
|
truncated: boolean;
|
|
@@ -113,22 +118,22 @@ export declare function readFile(alias: string, remotePath: string, options?: nu
|
|
|
113
118
|
/**
|
|
114
119
|
* 写入远程文件
|
|
115
120
|
*/
|
|
116
|
-
export declare function writeFile(alias: string, remotePath: string, content: string, append?: boolean): Promise<{
|
|
121
|
+
export declare function writeFile(alias: string, remotePath: string, content: string, append?: boolean, timeout?: number): Promise<{
|
|
117
122
|
success: boolean;
|
|
118
123
|
size: number;
|
|
119
124
|
}>;
|
|
120
125
|
/**
|
|
121
126
|
* 列出目录内容
|
|
122
127
|
*/
|
|
123
|
-
export declare function listDir(alias: string, remotePath: string, showHidden?: boolean, sharedSftp?: SFTPWrapper): Promise<FileInfo[]>;
|
|
128
|
+
export declare function listDir(alias: string, remotePath: string, showHidden?: boolean, sharedSftp?: SFTPWrapper, timeout?: number): Promise<FileInfo[]>;
|
|
124
129
|
/**
|
|
125
130
|
* 获取文件信息
|
|
126
131
|
*/
|
|
127
|
-
export declare function getFileInfo(alias: string, remotePath: string): Promise<FileInfo>;
|
|
132
|
+
export declare function getFileInfo(alias: string, remotePath: string, timeout?: number): Promise<FileInfo>;
|
|
128
133
|
/**
|
|
129
134
|
* 创建目录
|
|
130
135
|
*/
|
|
131
|
-
export declare function mkdir(alias: string, remotePath: string, recursive?: boolean, sharedSftp?: SFTPWrapper): Promise<boolean>;
|
|
136
|
+
export declare function mkdir(alias: string, remotePath: string, recursive?: boolean, sharedSftp?: SFTPWrapper, timeout?: number): Promise<boolean>;
|
|
132
137
|
/**
|
|
133
138
|
* 检查远程是否安装 rsync
|
|
134
139
|
*/
|