@hailer/mcp 1.0.26 → 1.0.27

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.
Files changed (2) hide show
  1. package/dist/cli.js +43 -32
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -51,53 +51,64 @@ const CLAUDE_CONFIG_FILE = path.join(CLAUDE_CONFIG_DIR, 'claude_desktop_config.j
51
51
  * Prompt user for input
52
52
  */
53
53
  function prompt(question, isPassword = false) {
54
- const rl = readline.createInterface({
55
- input: process.stdin,
56
- output: process.stdout,
57
- });
58
54
  return new Promise((resolve) => {
59
55
  if (isPassword) {
60
- // For password, we need to handle it differently
56
+ // For password input, use raw mode to hide characters
61
57
  process.stdout.write(question);
62
58
  let password = '';
63
59
  const stdin = process.stdin;
64
- const wasRaw = stdin.isRaw;
65
- if (stdin.isTTY) {
66
- stdin.setRawMode(true);
60
+ if (!stdin.isTTY) {
61
+ // Not a TTY, fall back to simple readline (won't hide password)
62
+ const rl = readline.createInterface({ input: stdin, output: process.stdout });
63
+ rl.question('', (answer) => {
64
+ rl.close();
65
+ resolve(answer.trim());
66
+ });
67
+ return;
67
68
  }
69
+ stdin.setRawMode(true);
68
70
  stdin.resume();
69
71
  stdin.setEncoding('utf8');
70
- const onData = (char) => {
71
- const charCode = char.charCodeAt(0);
72
- if (charCode === 13 || charCode === 10) {
73
- // Enter
74
- stdin.removeListener('data', onData);
75
- if (stdin.isTTY) {
76
- stdin.setRawMode(wasRaw ?? false);
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;
77
84
  }
78
- process.stdout.write('\n');
79
- rl.close();
80
- resolve(password);
81
- }
82
- else if (charCode === 3) {
83
- // Ctrl+C
84
- process.exit();
85
- }
86
- else if (charCode === 127 || charCode === 8) {
87
- // Backspace
88
- if (password.length > 0) {
89
- password = password.slice(0, -1);
90
- process.stdout.write('\b \b');
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('*');
91
102
  }
92
- }
93
- else {
94
- password += char;
95
- process.stdout.write('*');
96
103
  }
97
104
  };
98
105
  stdin.on('data', onData);
99
106
  }
100
107
  else {
108
+ const rl = readline.createInterface({
109
+ input: process.stdin,
110
+ output: process.stdout,
111
+ });
101
112
  rl.question(question, (answer) => {
102
113
  rl.close();
103
114
  resolve(answer.trim());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hailer/mcp",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "config": {
5
5
  "docker": {
6
6
  "registry": "registry.gitlab.com/hailer-repos/hailer-mcp"