@akms/mcp-ssh 0.1.5 → 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/README.md +1 -1
- package/lib/cli.cjs +26 -3
- package/lib/cli.cjs.map +1 -1
- package/lib/cli.js +26 -3
- package/lib/cli.js.map +1 -1
- package/lib/index.cjs +13 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +13 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ var SESSION_SWEEP_INTERVAL_MS = 6e4;
|
|
|
34
34
|
var CWD_MARKER = "__AKMS_SSH_CWD__";
|
|
35
35
|
var MAX_DIRECTORY_ENTRIES = 1e3;
|
|
36
36
|
var SERVER_NAME = "akms-mcp-ssh";
|
|
37
|
-
var SERVER_VERSION = "0.1.
|
|
37
|
+
var SERVER_VERSION = "0.1.6";
|
|
38
38
|
|
|
39
39
|
// src/_defs/command-rules.ts
|
|
40
40
|
var CRITICAL_PATH_PATTERN = new RegExp(
|
|
@@ -497,6 +497,10 @@ var LEVEL_WEIGHTS = {
|
|
|
497
497
|
error: 4
|
|
498
498
|
};
|
|
499
499
|
var SECRET_META_KEYS = ["password", "passphrase", "privatekey", "privatekeypath", "secret", "token"];
|
|
500
|
+
var stderrBroken = false;
|
|
501
|
+
process.stderr.on("error", () => {
|
|
502
|
+
stderrBroken = true;
|
|
503
|
+
});
|
|
500
504
|
function resolveThreshold() {
|
|
501
505
|
const configured = process.env[LOG_LEVEL_ENV];
|
|
502
506
|
if (configured == null) {
|
|
@@ -520,6 +524,9 @@ function maskMeta(meta) {
|
|
|
520
524
|
return masked;
|
|
521
525
|
}
|
|
522
526
|
function write(level, message, meta) {
|
|
527
|
+
if (stderrBroken == true) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
523
530
|
const threshold = resolveThreshold();
|
|
524
531
|
if (threshold === "silent") {
|
|
525
532
|
return;
|
|
@@ -533,8 +540,12 @@ function write(level, message, meta) {
|
|
|
533
540
|
if (Object.keys(masked).length > 0) {
|
|
534
541
|
line += ` ${JSON.stringify(masked)}`;
|
|
535
542
|
}
|
|
536
|
-
|
|
543
|
+
try {
|
|
544
|
+
process.stderr.write(`${line}
|
|
537
545
|
`);
|
|
546
|
+
} catch {
|
|
547
|
+
stderrBroken = true;
|
|
548
|
+
}
|
|
538
549
|
}
|
|
539
550
|
function createLogger(boundMeta) {
|
|
540
551
|
return {
|