@akms/mcp-ssh 0.1.4 → 0.1.6

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/lib/index.d.cts CHANGED
@@ -380,7 +380,7 @@ declare function createSshMcpServer(): SshMcpServerInstance;
380
380
  * 5) Route: proxy command and / or jump host
381
381
  *
382
382
  * @param env - Where the `SSH_*` variables are read from. Defaults to the process
383
- * environment; the `setup` command passes the entry it is about to write.
383
+ * environment; the `config` command passes the entry it is about to write.
384
384
  * @throws {Error} If `SSH_HOST` is set without `SSH_USER`, a `SSH_JUMP_*` variable is set
385
385
  * without `SSH_JUMP_HOST`, or a typed value is malformed.
386
386
  */
@@ -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.4";
535
+ declare const SERVER_VERSION = "0.1.6";
536
536
 
537
537
  /**
538
538
  * Environment variables that define the host, one MCP server entry per host.
package/lib/index.d.ts CHANGED
@@ -380,7 +380,7 @@ declare function createSshMcpServer(): SshMcpServerInstance;
380
380
  * 5) Route: proxy command and / or jump host
381
381
  *
382
382
  * @param env - Where the `SSH_*` variables are read from. Defaults to the process
383
- * environment; the `setup` command passes the entry it is about to write.
383
+ * environment; the `config` command passes the entry it is about to write.
384
384
  * @throws {Error} If `SSH_HOST` is set without `SSH_USER`, a `SSH_JUMP_*` variable is set
385
385
  * without `SSH_JUMP_HOST`, or a typed value is malformed.
386
386
  */
@@ -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.4";
535
+ declare const SERVER_VERSION = "0.1.6";
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.4";
28
+ var SERVER_VERSION = "0.1.6";
29
29
 
30
30
  // src/_defs/command-rules.ts
31
31
  var CRITICAL_PATH_PATTERN = new RegExp(
@@ -488,6 +488,10 @@ var LEVEL_WEIGHTS = {
488
488
  error: 4
489
489
  };
490
490
  var SECRET_META_KEYS = ["password", "passphrase", "privatekey", "privatekeypath", "secret", "token"];
491
+ var stderrBroken = false;
492
+ process.stderr.on("error", () => {
493
+ stderrBroken = true;
494
+ });
491
495
  function resolveThreshold() {
492
496
  const configured = process.env[LOG_LEVEL_ENV];
493
497
  if (configured == null) {
@@ -511,6 +515,9 @@ function maskMeta(meta) {
511
515
  return masked;
512
516
  }
513
517
  function write(level, message, meta) {
518
+ if (stderrBroken == true) {
519
+ return;
520
+ }
514
521
  const threshold = resolveThreshold();
515
522
  if (threshold === "silent") {
516
523
  return;
@@ -524,8 +531,12 @@ function write(level, message, meta) {
524
531
  if (Object.keys(masked).length > 0) {
525
532
  line += ` ${JSON.stringify(masked)}`;
526
533
  }
527
- process.stderr.write(`${line}
534
+ try {
535
+ process.stderr.write(`${line}
528
536
  `);
537
+ } catch {
538
+ stderrBroken = true;
539
+ }
529
540
  }
530
541
  function createLogger(boundMeta) {
531
542
  return {