@hailer/mcp 1.0.27 → 1.0.28
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/dist/cli.js +21 -49
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -47,62 +47,34 @@ const os = __importStar(require("os"));
|
|
|
47
47
|
const readline = __importStar(require("readline"));
|
|
48
48
|
const CLAUDE_CONFIG_DIR = path.join(os.homedir(), 'Library', 'Application Support', 'Claude');
|
|
49
49
|
const CLAUDE_CONFIG_FILE = path.join(CLAUDE_CONFIG_DIR, 'claude_desktop_config.json');
|
|
50
|
+
/**
|
|
51
|
+
* Muted output stream for password input
|
|
52
|
+
*/
|
|
53
|
+
class MutedStream {
|
|
54
|
+
writable = true;
|
|
55
|
+
muted = false;
|
|
56
|
+
write() { return true; }
|
|
57
|
+
end() { }
|
|
58
|
+
}
|
|
50
59
|
/**
|
|
51
60
|
* Prompt user for input
|
|
52
61
|
*/
|
|
53
62
|
function prompt(question, isPassword = false) {
|
|
54
63
|
return new Promise((resolve) => {
|
|
55
64
|
if (isPassword) {
|
|
56
|
-
//
|
|
65
|
+
// Use muted stream to hide password - most reliable cross-terminal approach
|
|
66
|
+
const mutedOutput = new MutedStream();
|
|
67
|
+
const rl = readline.createInterface({
|
|
68
|
+
input: process.stdin,
|
|
69
|
+
output: mutedOutput,
|
|
70
|
+
terminal: true,
|
|
71
|
+
});
|
|
57
72
|
process.stdout.write(question);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
rl.question('', (answer) => {
|
|
64
|
-
rl.close();
|
|
65
|
-
resolve(answer.trim());
|
|
66
|
-
});
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
stdin.setRawMode(true);
|
|
70
|
-
stdin.resume();
|
|
71
|
-
stdin.setEncoding('utf8');
|
|
72
|
-
const onData = (key) => {
|
|
73
|
-
// Handle each character
|
|
74
|
-
for (const char of key) {
|
|
75
|
-
const code = char.charCodeAt(0);
|
|
76
|
-
if (code === 13 || code === 10) {
|
|
77
|
-
// Enter - done
|
|
78
|
-
stdin.setRawMode(false);
|
|
79
|
-
stdin.pause();
|
|
80
|
-
stdin.removeListener('data', onData);
|
|
81
|
-
process.stdout.write('\n');
|
|
82
|
-
resolve(password);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
else if (code === 3) {
|
|
86
|
-
// Ctrl+C - exit
|
|
87
|
-
stdin.setRawMode(false);
|
|
88
|
-
process.stdout.write('\n');
|
|
89
|
-
process.exit(0);
|
|
90
|
-
}
|
|
91
|
-
else if (code === 127 || code === 8) {
|
|
92
|
-
// Backspace
|
|
93
|
-
if (password.length > 0) {
|
|
94
|
-
password = password.slice(0, -1);
|
|
95
|
-
process.stdout.write('\b \b');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else if (code >= 32) {
|
|
99
|
-
// Printable character
|
|
100
|
-
password += char;
|
|
101
|
-
process.stdout.write('*');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
stdin.on('data', onData);
|
|
73
|
+
rl.question('', (answer) => {
|
|
74
|
+
rl.close();
|
|
75
|
+
process.stdout.write('\n');
|
|
76
|
+
resolve(answer);
|
|
77
|
+
});
|
|
106
78
|
}
|
|
107
79
|
else {
|
|
108
80
|
const rl = readline.createInterface({
|