@pyrokine/mcp-ssh 2.3.2 → 2.4.0
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 +94 -20
- package/README_zh.md +64 -19
- package/dist/command-risk.d.ts +7 -0
- package/dist/command-risk.js +106 -0
- package/dist/directory-verification.d.ts +43 -0
- package/dist/directory-verification.js +485 -0
- package/dist/file-ops.d.ts +56 -13
- package/dist/file-ops.js +531 -145
- package/dist/forward-manager.d.ts +5 -2
- package/dist/forward-manager.js +133 -19
- package/dist/index.js +2 -1
- package/dist/operation-manager.d.ts +52 -0
- package/dist/operation-manager.js +402 -0
- package/dist/pty-manager.d.ts +1 -0
- package/dist/pty-manager.js +11 -7
- package/dist/session-manager.d.ts +21 -10
- package/dist/session-manager.js +328 -75
- package/dist/tools/connection.js +48 -8
- package/dist/tools/exec.js +7 -66
- package/dist/tools/file.js +455 -81
- package/dist/tools/forward.js +12 -4
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +1 -0
- package/dist/tools/operation.d.ts +2 -0
- package/dist/tools/operation.js +126 -0
- package/dist/tools/utils.d.ts +2 -2
- package/dist/transfer-outcome.d.ts +12 -0
- package/dist/transfer-outcome.js +72 -0
- package/dist/types.d.ts +94 -6
- package/package.json +10 -8
package/dist/tools/forward.js
CHANGED
|
@@ -30,6 +30,8 @@ const forwardRemoteSchema = z.object({
|
|
|
30
30
|
});
|
|
31
31
|
const forwardCloseSchema = z.object({
|
|
32
32
|
forwardId: z.string().describe('端口转发 ID'),
|
|
33
|
+
mode: z.enum(['graceful', 'force']).optional().describe('关闭模式,默认 graceful;force 会销毁活跃连接'),
|
|
34
|
+
timeoutMs: z.number().int().positive().max(60000).optional().describe('等待底层 listener 释放的超时,默认 5000ms'),
|
|
33
35
|
});
|
|
34
36
|
const forwardListSchema = z.object({});
|
|
35
37
|
// ========== Handlers ==========
|
|
@@ -64,10 +66,13 @@ async function handleForwardRemote(args) {
|
|
|
64
66
|
}
|
|
65
67
|
async function handleForwardClose(args) {
|
|
66
68
|
try {
|
|
67
|
-
const
|
|
69
|
+
const result = await sessionManager.forwardClose(args.forwardId, {
|
|
70
|
+
mode: args.mode,
|
|
71
|
+
timeoutMs: args.timeoutMs,
|
|
72
|
+
});
|
|
68
73
|
return formatResult({
|
|
69
|
-
|
|
70
|
-
message: success ? `Forward closed: ${args.forwardId}` : `Forward
|
|
74
|
+
...result,
|
|
75
|
+
message: result.success ? `Forward closed: ${args.forwardId}` : `Forward close failed: ${args.forwardId}`,
|
|
71
76
|
});
|
|
72
77
|
}
|
|
73
78
|
catch (error) {
|
|
@@ -110,7 +115,10 @@ export function registerForwardTools(server) {
|
|
|
110
115
|
inputSchema: forwardRemoteSchema,
|
|
111
116
|
}, (args) => handleForwardRemote(args));
|
|
112
117
|
server.registerTool('ssh_forward_close', {
|
|
113
|
-
description:
|
|
118
|
+
description: `关闭端口转发
|
|
119
|
+
|
|
120
|
+
默认 graceful 模式,等待底层 listener 确认释放后才返回成功。force 模式会先销毁活跃连接。
|
|
121
|
+
关闭失败或超时时保留 forward 状态,可使用同一 forwardId 重试。`,
|
|
114
122
|
inputSchema: forwardCloseSchema,
|
|
115
123
|
}, (args) => handleForwardClose(args));
|
|
116
124
|
server.registerTool('ssh_forward_list', {
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
export { registerConnectionTools } from './connection.js';
|
|
5
5
|
export { registerExecTools } from './exec.js';
|
|
6
6
|
export { registerFileTools } from './file.js';
|
|
7
|
+
export { registerOperationTools } from './operation.js';
|
|
7
8
|
export { registerPtyTools } from './pty.js';
|
|
8
9
|
export { registerForwardTools } from './forward.js';
|
package/dist/tools/index.js
CHANGED
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
export { registerConnectionTools } from './connection.js';
|
|
5
5
|
export { registerExecTools } from './exec.js';
|
|
6
6
|
export { registerFileTools } from './file.js';
|
|
7
|
+
export { registerOperationTools } from './operation.js';
|
|
7
8
|
export { registerPtyTools } from './pty.js';
|
|
8
9
|
export { registerForwardTools } from './forward.js';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DEFAULT_OPERATION_MAX_OUTPUT_BYTES, DEFAULT_OPERATION_READ_BYTES, DEFAULT_OPERATION_RETENTION_MS, HARD_OPERATION_MAX_OUTPUT_BYTES, HARD_OPERATION_READ_BYTES, MAX_OPERATION_RETENTION_MS, } from '../operation-manager.js';
|
|
3
|
+
import { sessionManager } from '../session-manager.js';
|
|
4
|
+
import { formatError, formatResult } from './utils.js';
|
|
5
|
+
const operationStartSchema = z.object({
|
|
6
|
+
alias: z.string().describe('连接别名'),
|
|
7
|
+
command: z.string().describe('要在远端跟踪执行的命令'),
|
|
8
|
+
cwd: z.string().optional().describe('工作目录(可选)'),
|
|
9
|
+
env: z.record(z.string(), z.string()).optional().describe('额外环境变量'),
|
|
10
|
+
runAs: z.string().optional().describe('本次命令使用的目标用户,覆盖连接级 runAs'),
|
|
11
|
+
useLoginUser: z.boolean().optional().describe('设为 true 时跳过连接级 runAs,直接以登录用户执行'),
|
|
12
|
+
loadProfile: z.boolean().optional().describe('runAs 执行时是否加载目标用户 shell 配置,默认 true'),
|
|
13
|
+
maxOutputBytes: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.positive()
|
|
17
|
+
.max(HARD_OPERATION_MAX_OUTPUT_BYTES)
|
|
18
|
+
.optional()
|
|
19
|
+
.describe(`内存输出硬上限,默认 ${DEFAULT_OPERATION_MAX_OUTPUT_BYTES} 字节,最大 ${HARD_OPERATION_MAX_OUTPUT_BYTES}`),
|
|
20
|
+
retentionMs: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.positive()
|
|
24
|
+
.max(MAX_OPERATION_RETENTION_MS)
|
|
25
|
+
.optional()
|
|
26
|
+
.describe(`完成后的状态保留时间,默认 ${DEFAULT_OPERATION_RETENTION_MS}ms,最大 ${MAX_OPERATION_RETENTION_MS}ms`),
|
|
27
|
+
});
|
|
28
|
+
const operationIdSchema = z.object({
|
|
29
|
+
operationId: z.string().describe('tracked operation ID'),
|
|
30
|
+
});
|
|
31
|
+
const operationReadSchema = operationIdSchema.extend({
|
|
32
|
+
stdoutOffset: z.number().int().nonnegative().optional().describe('stdout 起始字节偏移,默认 0'),
|
|
33
|
+
stderrOffset: z.number().int().nonnegative().optional().describe('stderr 起始字节偏移,默认 0'),
|
|
34
|
+
maxBytes: z
|
|
35
|
+
.number()
|
|
36
|
+
.int()
|
|
37
|
+
.positive()
|
|
38
|
+
.max(HARD_OPERATION_READ_BYTES)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe(`本次读取总字节上限,默认 ${DEFAULT_OPERATION_READ_BYTES},最大 ${HARD_OPERATION_READ_BYTES}`),
|
|
41
|
+
});
|
|
42
|
+
const operationListSchema = z.object({
|
|
43
|
+
alias: z.string().optional().describe('按连接别名过滤'),
|
|
44
|
+
});
|
|
45
|
+
async function handleOperationStart(args) {
|
|
46
|
+
try {
|
|
47
|
+
const operation = await sessionManager.operationStart(args.alias, args.command, {
|
|
48
|
+
cwd: args.cwd,
|
|
49
|
+
env: args.env,
|
|
50
|
+
runAs: args.runAs,
|
|
51
|
+
useLoginUser: args.useLoginUser,
|
|
52
|
+
loadProfile: args.loadProfile,
|
|
53
|
+
maxOutputBytes: args.maxOutputBytes,
|
|
54
|
+
retentionMs: args.retentionMs,
|
|
55
|
+
});
|
|
56
|
+
return formatResult({ success: true, ...operation });
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
return formatError(error);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function handleOperationStatus(args) {
|
|
63
|
+
try {
|
|
64
|
+
return formatResult({ success: true, ...sessionManager.operationStatus(args.operationId) });
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return formatError(error);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function handleOperationRead(args) {
|
|
71
|
+
try {
|
|
72
|
+
return formatResult({
|
|
73
|
+
success: true,
|
|
74
|
+
...sessionManager.operationRead(args.operationId, {
|
|
75
|
+
stdoutOffset: args.stdoutOffset,
|
|
76
|
+
stderrOffset: args.stderrOffset,
|
|
77
|
+
maxBytes: args.maxBytes,
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return formatError(error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function handleOperationCancel(args) {
|
|
86
|
+
try {
|
|
87
|
+
return formatResult(await sessionManager.operationCancel(args.operationId));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
return formatError(error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function handleOperationList(args) {
|
|
94
|
+
try {
|
|
95
|
+
const operations = sessionManager.operationList(args.alias);
|
|
96
|
+
return formatResult({ success: true, count: operations.length, operations });
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
return formatError(error);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function registerOperationTools(server) {
|
|
103
|
+
server.registerTool('ssh_operation_start', {
|
|
104
|
+
description: `启动可跟踪的长时间远端命令
|
|
105
|
+
|
|
106
|
+
返回不可预测的 operationId。输出保存在有硬上限的内存缓冲区中,完成后按 retentionMs 自动过期。
|
|
107
|
+
普通 ssh_exec 的同步和 timeout 行为不变。`,
|
|
108
|
+
inputSchema: operationStartSchema,
|
|
109
|
+
}, (args) => handleOperationStart(args));
|
|
110
|
+
server.registerTool('ssh_operation_status', {
|
|
111
|
+
description: '查询 tracked operation 状态、远端 PID、输出计数和过期时间',
|
|
112
|
+
inputSchema: operationIdSchema,
|
|
113
|
+
}, (args) => handleOperationStatus(args));
|
|
114
|
+
server.registerTool('ssh_operation_read', {
|
|
115
|
+
description: '按字节偏移读取 tracked operation 的有界 stdout/stderr 缓冲区',
|
|
116
|
+
inputSchema: operationReadSchema,
|
|
117
|
+
}, (args) => handleOperationRead(args));
|
|
118
|
+
server.registerTool('ssh_operation_cancel', {
|
|
119
|
+
description: '校验远端 operation marker 后发送 TERM;marker 无法证明时拒绝取消',
|
|
120
|
+
inputSchema: operationIdSchema,
|
|
121
|
+
}, (args) => handleOperationCancel(args));
|
|
122
|
+
server.registerTool('ssh_operation_list', {
|
|
123
|
+
description: '列出未过期的 tracked operations,可按 alias 过滤',
|
|
124
|
+
inputSchema: operationListSchema,
|
|
125
|
+
}, (args) => handleOperationList(args));
|
|
126
|
+
}
|
package/dist/tools/utils.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function expandTilde(p: string): string;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function formatResult(data: unknown): {
|
|
14
14
|
content: {
|
|
15
|
-
type:
|
|
15
|
+
type: 'text';
|
|
16
16
|
text: string;
|
|
17
17
|
}[];
|
|
18
18
|
};
|
|
@@ -21,7 +21,7 @@ export declare function formatResult(data: unknown): {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function formatError(error: unknown): {
|
|
23
23
|
content: {
|
|
24
|
-
type:
|
|
24
|
+
type: 'text';
|
|
25
25
|
text: string;
|
|
26
26
|
}[];
|
|
27
27
|
isError: boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type VerificationStatus = 'not_requested' | 'matched' | 'mismatched' | 'skipped' | 'error';
|
|
2
|
+
export type TransferOutcome = {
|
|
3
|
+
success: boolean;
|
|
4
|
+
transferSuccess: boolean;
|
|
5
|
+
verificationRequested: boolean;
|
|
6
|
+
verificationSuccess?: boolean;
|
|
7
|
+
verificationStatus: VerificationStatus;
|
|
8
|
+
failedChecks: string[];
|
|
9
|
+
expected?: unknown;
|
|
10
|
+
actual?: unknown;
|
|
11
|
+
};
|
|
12
|
+
export declare function buildTransferOutcome(transferSuccess: boolean, verificationRequested: boolean, verification?: Record<string, unknown>, verificationError?: unknown): TransferOutcome;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function collectChecks(value, prefix, failed, skipped) {
|
|
2
|
+
if (!value || typeof value !== 'object') {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
const record = value;
|
|
6
|
+
if (record.skipped === true) {
|
|
7
|
+
skipped.push(prefix || 'verification');
|
|
8
|
+
}
|
|
9
|
+
if (record.checks && typeof record.checks === 'object') {
|
|
10
|
+
for (const [name, matched] of Object.entries(record.checks)) {
|
|
11
|
+
if (matched !== true) {
|
|
12
|
+
failed.push(prefix ? `${prefix}.${name}` : name);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if ('hashMatch' in record && record.hashMatch !== true) {
|
|
17
|
+
failed.push(prefix ? `${prefix}.sha256` : 'sha256');
|
|
18
|
+
}
|
|
19
|
+
for (const [name, child] of Object.entries(record)) {
|
|
20
|
+
if (name === 'checks' || name === 'expected' || name === 'actual' || name === 'local' || name === 'remote') {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (child && typeof child === 'object') {
|
|
24
|
+
collectChecks(child, prefix ? `${prefix}.${name}` : name, failed, skipped);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function buildTransferOutcome(transferSuccess, verificationRequested, verification, verificationError) {
|
|
29
|
+
if (!verificationRequested) {
|
|
30
|
+
return {
|
|
31
|
+
success: transferSuccess,
|
|
32
|
+
transferSuccess,
|
|
33
|
+
verificationRequested: false,
|
|
34
|
+
verificationStatus: 'not_requested',
|
|
35
|
+
failedChecks: [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (verificationError !== undefined) {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
transferSuccess,
|
|
42
|
+
verificationRequested: true,
|
|
43
|
+
verificationSuccess: false,
|
|
44
|
+
verificationStatus: 'error',
|
|
45
|
+
failedChecks: ['verification_error'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (!transferSuccess && verification === undefined) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
transferSuccess: false,
|
|
52
|
+
verificationRequested: true,
|
|
53
|
+
verificationSuccess: false,
|
|
54
|
+
verificationStatus: 'skipped',
|
|
55
|
+
failedChecks: ['verification'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const failedChecks = [];
|
|
59
|
+
const skipped = [];
|
|
60
|
+
collectChecks(verification, '', failedChecks, skipped);
|
|
61
|
+
const verificationSuccess = skipped.length === 0 && failedChecks.length === 0;
|
|
62
|
+
return {
|
|
63
|
+
success: transferSuccess && verificationSuccess,
|
|
64
|
+
transferSuccess,
|
|
65
|
+
verificationRequested: true,
|
|
66
|
+
verificationSuccess,
|
|
67
|
+
verificationStatus: skipped.length > 0 ? 'skipped' : verificationSuccess ? 'matched' : 'mismatched',
|
|
68
|
+
failedChecks: skipped.length > 0 ? [...new Set([...failedChecks, ...skipped])] : [...new Set(failedChecks)],
|
|
69
|
+
expected: verification?.expected,
|
|
70
|
+
actual: verification?.actual ?? verification?.remote,
|
|
71
|
+
};
|
|
72
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -23,18 +23,41 @@ export interface SSHConnectionConfig {
|
|
|
23
23
|
shell?: string;
|
|
24
24
|
jumpHost?: SSHConnectionConfig;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface SSHSessionBrief {
|
|
27
27
|
alias: string;
|
|
28
28
|
identity: string;
|
|
29
|
+
runAs?: string;
|
|
30
|
+
connected: boolean;
|
|
31
|
+
lastUsedAt: number;
|
|
32
|
+
}
|
|
33
|
+
export interface SSHSessionDetail extends SSHSessionBrief {
|
|
29
34
|
host: string;
|
|
30
35
|
port: number;
|
|
31
36
|
username: string;
|
|
32
|
-
|
|
33
|
-
keyPath?: string;
|
|
34
|
-
authMethod: 'key' | 'password' | 'agent';
|
|
35
|
-
connected: boolean;
|
|
37
|
+
authMethod: 'key' | 'password' | 'agent' | 'inline-key';
|
|
36
38
|
connectedAt: number;
|
|
37
|
-
|
|
39
|
+
hasJumpHost: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface ExternalTransferCapability {
|
|
42
|
+
alias: string;
|
|
43
|
+
identity: string;
|
|
44
|
+
host: string;
|
|
45
|
+
port: number;
|
|
46
|
+
username: string;
|
|
47
|
+
authMethod: 'key-path' | 'password' | 'agent' | 'inline-key';
|
|
48
|
+
keyPath?: string;
|
|
49
|
+
hasJumpHost: boolean;
|
|
50
|
+
routeSafeForOpenSsh: boolean;
|
|
51
|
+
rsyncEligible: boolean;
|
|
52
|
+
decisionReason: string;
|
|
53
|
+
}
|
|
54
|
+
export type ConnectionFailureStage = 'preflight' | 'authentication' | 'ready_timeout' | 'transport_or_handshake' | 'unknown';
|
|
55
|
+
export type ConnectionStep = 'key_read' | 'jump_connect' | 'jump_forward' | 'target_connect';
|
|
56
|
+
export interface ConnectionFailureDetails {
|
|
57
|
+
failureStage: ConnectionFailureStage;
|
|
58
|
+
connectionStep?: ConnectionStep;
|
|
59
|
+
retryable: boolean;
|
|
60
|
+
suggestion?: string;
|
|
38
61
|
}
|
|
39
62
|
export interface ExecOptions {
|
|
40
63
|
timeout?: number;
|
|
@@ -79,6 +102,55 @@ export interface ExecResult {
|
|
|
79
102
|
envInjectedKeys?: string[];
|
|
80
103
|
timedOut?: boolean;
|
|
81
104
|
}
|
|
105
|
+
export type OperationStatus = 'starting' | 'running' | 'completed' | 'failed' | 'cancelled' | 'unknown';
|
|
106
|
+
export interface OperationStartOptions {
|
|
107
|
+
cwd?: string;
|
|
108
|
+
env?: Record<string, string>;
|
|
109
|
+
runAs?: string;
|
|
110
|
+
useLoginUser?: boolean;
|
|
111
|
+
loadProfile?: boolean;
|
|
112
|
+
maxOutputBytes?: number;
|
|
113
|
+
retentionMs?: number;
|
|
114
|
+
}
|
|
115
|
+
export interface OperationInfo {
|
|
116
|
+
operationId: string;
|
|
117
|
+
alias: string;
|
|
118
|
+
status: OperationStatus;
|
|
119
|
+
pid: number | null;
|
|
120
|
+
processGroup: boolean;
|
|
121
|
+
markerVerified: boolean;
|
|
122
|
+
cancelRequested: boolean;
|
|
123
|
+
startedAt: number;
|
|
124
|
+
finishedAt: number | null;
|
|
125
|
+
expiresAt: number | null;
|
|
126
|
+
retentionMs: number;
|
|
127
|
+
exitCode: number | null;
|
|
128
|
+
signal: string | null;
|
|
129
|
+
stdoutBytes: number;
|
|
130
|
+
stderrBytes: number;
|
|
131
|
+
stdoutStoredBytes: number;
|
|
132
|
+
stderrStoredBytes: number;
|
|
133
|
+
stdoutTruncated: boolean;
|
|
134
|
+
stderrTruncated: boolean;
|
|
135
|
+
maxOutputBytes: number;
|
|
136
|
+
error?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface OperationReadResult extends OperationInfo {
|
|
139
|
+
stdout: string;
|
|
140
|
+
stderr: string;
|
|
141
|
+
stdoutOffset: number;
|
|
142
|
+
stderrOffset: number;
|
|
143
|
+
nextStdoutOffset: number;
|
|
144
|
+
nextStderrOffset: number;
|
|
145
|
+
readBytes: number;
|
|
146
|
+
maxReadBytes: number;
|
|
147
|
+
}
|
|
148
|
+
export interface OperationCancelResult extends OperationInfo {
|
|
149
|
+
success: boolean;
|
|
150
|
+
cancelRequested: boolean;
|
|
151
|
+
retryable: boolean;
|
|
152
|
+
verificationError?: string;
|
|
153
|
+
}
|
|
82
154
|
export interface FileInfo {
|
|
83
155
|
name: string;
|
|
84
156
|
path: string;
|
|
@@ -141,3 +213,19 @@ export interface PortForwardInfo {
|
|
|
141
213
|
createdAt: number;
|
|
142
214
|
active: boolean;
|
|
143
215
|
}
|
|
216
|
+
export type ForwardCloseMode = 'graceful' | 'force';
|
|
217
|
+
export interface ForwardCloseOptions {
|
|
218
|
+
mode?: ForwardCloseMode;
|
|
219
|
+
timeoutMs?: number;
|
|
220
|
+
}
|
|
221
|
+
export interface ForwardCloseResult {
|
|
222
|
+
success: boolean;
|
|
223
|
+
forwardId: string;
|
|
224
|
+
type?: ForwardType;
|
|
225
|
+
closeMode: ForwardCloseMode;
|
|
226
|
+
listenerReleased: boolean;
|
|
227
|
+
remoteUnforwarded: boolean;
|
|
228
|
+
activeConnections: number;
|
|
229
|
+
retryable: boolean;
|
|
230
|
+
error?: string;
|
|
231
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyrokine/mcp-ssh",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "A comprehensive SSH MCP Server for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
"mcp-ssh": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
11
|
+
"build": "node node_modules/typescript7/bin/tsc",
|
|
12
12
|
"start": "node dist/index.js",
|
|
13
|
-
"dev": "tsc && node dist/index.js",
|
|
13
|
+
"dev": "node node_modules/typescript7/bin/tsc && node dist/index.js",
|
|
14
14
|
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
15
15
|
"prepublishOnly": "npm run build",
|
|
16
16
|
"lint": "eslint \"src/**/*.ts\"",
|
|
17
17
|
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
18
|
+
"test": "npm run build && node test/run-tests.mjs",
|
|
18
19
|
"format": "prettier --write src/",
|
|
19
20
|
"format:check": "prettier --check src/"
|
|
20
21
|
},
|
|
@@ -39,12 +40,13 @@
|
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@eslint/js": "^10.0.1",
|
|
42
|
-
"@types/node": "^
|
|
43
|
+
"@types/node": "^26.1.1",
|
|
43
44
|
"@types/ssh2": "^1.15.5",
|
|
44
|
-
"eslint": "^10.
|
|
45
|
-
"prettier": "^3.
|
|
46
|
-
"typescript": "
|
|
47
|
-
"typescript-eslint": "^8.
|
|
45
|
+
"eslint": "^10.7.0",
|
|
46
|
+
"prettier": "^3.9.5",
|
|
47
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
48
|
+
"typescript-eslint": "^8.64.0",
|
|
49
|
+
"typescript7": "npm:typescript@^7.0.2"
|
|
48
50
|
},
|
|
49
51
|
"engines": {
|
|
50
52
|
"node": ">=20.19.0"
|