@akms/mcp-ssh 0.1.6 → 0.1.7
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/CHANGELOG.md +205 -0
- package/README.md +5 -0
- package/lib/cli.cjs +477 -364
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.js +480 -367
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +6 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +6 -2
- package/lib/index.js.map +1 -1
- package/package.json +2 -1
package/lib/index.d.cts
CHANGED
|
@@ -180,7 +180,7 @@ declare class SshConnection {
|
|
|
180
180
|
* @throws {Error} If the connection was closed, authentication fails, the host is
|
|
181
181
|
* unreachable, the handshake times out, or the carrier cannot be opened.
|
|
182
182
|
*/
|
|
183
|
-
connect(): Promise<void>;
|
|
183
|
+
connect(onProgress?: (stage: "transport" | "host") => void): Promise<void>;
|
|
184
184
|
/**
|
|
185
185
|
* Screens a command against this profile's policy, then runs it on its own channel.
|
|
186
186
|
*
|
|
@@ -532,7 +532,7 @@ declare const $logger: Logger;
|
|
|
532
532
|
/** Env var overriding the stderr log level ("debug" | "info" | "warn" | "error" | "silent"). */
|
|
533
533
|
declare const LOG_LEVEL_ENV = "SSH_MCP_LOG_LEVEL";
|
|
534
534
|
declare const SERVER_NAME = "akms-mcp-ssh";
|
|
535
|
-
declare const SERVER_VERSION = "0.1.
|
|
535
|
+
declare const SERVER_VERSION = "0.1.7";
|
|
536
536
|
|
|
537
537
|
/**
|
|
538
538
|
* Environment variables that define the host, one MCP server entry per host.
|
package/lib/index.d.ts
CHANGED
|
@@ -180,7 +180,7 @@ declare class SshConnection {
|
|
|
180
180
|
* @throws {Error} If the connection was closed, authentication fails, the host is
|
|
181
181
|
* unreachable, the handshake times out, or the carrier cannot be opened.
|
|
182
182
|
*/
|
|
183
|
-
connect(): Promise<void>;
|
|
183
|
+
connect(onProgress?: (stage: "transport" | "host") => void): Promise<void>;
|
|
184
184
|
/**
|
|
185
185
|
* Screens a command against this profile's policy, then runs it on its own channel.
|
|
186
186
|
*
|
|
@@ -532,7 +532,7 @@ declare const $logger: Logger;
|
|
|
532
532
|
/** Env var overriding the stderr log level ("debug" | "info" | "warn" | "error" | "silent"). */
|
|
533
533
|
declare const LOG_LEVEL_ENV = "SSH_MCP_LOG_LEVEL";
|
|
534
534
|
declare const SERVER_NAME = "akms-mcp-ssh";
|
|
535
|
-
declare const SERVER_VERSION = "0.1.
|
|
535
|
+
declare const SERVER_VERSION = "0.1.7";
|
|
536
536
|
|
|
537
537
|
/**
|
|
538
538
|
* Environment variables that define the host, one MCP server entry per host.
|
package/lib/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var SESSION_SWEEP_INTERVAL_MS = 6e4;
|
|
|
25
25
|
var CWD_MARKER = "__AKMS_SSH_CWD__";
|
|
26
26
|
var MAX_DIRECTORY_ENTRIES = 1e3;
|
|
27
27
|
var SERVER_NAME = "akms-mcp-ssh";
|
|
28
|
-
var SERVER_VERSION = "0.1.
|
|
28
|
+
var SERVER_VERSION = "0.1.7";
|
|
29
29
|
|
|
30
30
|
// src/_defs/command-rules.ts
|
|
31
31
|
var CRITICAL_PATH_PATTERN = new RegExp(
|
|
@@ -1620,7 +1620,7 @@ var SshConnection = class {
|
|
|
1620
1620
|
* @throws {Error} If the connection was closed, authentication fails, the host is
|
|
1621
1621
|
* unreachable, the handshake times out, or the carrier cannot be opened.
|
|
1622
1622
|
*/
|
|
1623
|
-
async connect() {
|
|
1623
|
+
async connect(onProgress) {
|
|
1624
1624
|
if (this.disposed == true) {
|
|
1625
1625
|
throw new Error(`ssh connection for '${this.profile.name}' has been closed; open a new session`);
|
|
1626
1626
|
}
|
|
@@ -1642,6 +1642,9 @@ var SshConnection = class {
|
|
|
1642
1642
|
this.observedFingerprint = fingerprint;
|
|
1643
1643
|
});
|
|
1644
1644
|
this.connecting = (async () => {
|
|
1645
|
+
if (this.profile.jump != null || this.profile.proxyCommand != null) {
|
|
1646
|
+
onProgress?.("transport");
|
|
1647
|
+
}
|
|
1645
1648
|
const transport = await openTransport(this.profile, (fingerprint) => {
|
|
1646
1649
|
this.observedJumpFingerprint = fingerprint;
|
|
1647
1650
|
});
|
|
@@ -1652,6 +1655,7 @@ var SshConnection = class {
|
|
|
1652
1655
|
if (transport != null) {
|
|
1653
1656
|
connectConfig.sock = transport.sock;
|
|
1654
1657
|
}
|
|
1658
|
+
onProgress?.("host");
|
|
1655
1659
|
await new Promise((resolve, reject) => {
|
|
1656
1660
|
const client = new Client();
|
|
1657
1661
|
this.pendingClient = client;
|