vibe-annotations-server 0.1.2 → 0.1.4

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/index.js +25 -10
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -59,9 +59,10 @@ function uninstallServer() {
59
59
  // First try to stop the server if it's running
60
60
  try {
61
61
  log(' Stopping server first...', colors.dim);
62
- execSync(`${COMMAND_NAME} stop`, { stdio: 'ignore' });
62
+ execSync(`${COMMAND_NAME} stop`, { stdio: 'ignore', timeout: 5000 });
63
63
  } catch {
64
- // Server might not be running, continue
64
+ // Server might not be running or stop command failed, continue
65
+ log(' (Server stop completed or not running)', colors.dim);
65
66
  }
66
67
 
67
68
  // Check if server is currently installed
@@ -90,10 +91,12 @@ function uninstallServer() {
90
91
  }
91
92
  }
92
93
 
94
+ let childProcess = null;
95
+
93
96
  function runCommand(args) {
94
- const child = spawn(COMMAND_NAME, args, { stdio: 'inherit' });
97
+ childProcess = spawn(COMMAND_NAME, args, { stdio: 'inherit' });
95
98
 
96
- child.on('error', (error) => {
99
+ childProcess.on('error', (error) => {
97
100
  if (error.code === 'ENOENT') {
98
101
  log('āŒ Command not found. Installation may have failed.', colors.yellow);
99
102
  } else {
@@ -101,8 +104,9 @@ function runCommand(args) {
101
104
  }
102
105
  });
103
106
 
104
- child.on('exit', (code) => {
105
- process.exit(code);
107
+ childProcess.on('exit', (code) => {
108
+ childProcess = null;
109
+ process.exit(code || 0);
106
110
  });
107
111
  }
108
112
 
@@ -149,10 +153,21 @@ function main() {
149
153
  runCommand(finalArgs);
150
154
  }
151
155
 
152
- // Handle Ctrl+C gracefully
153
- process.on('SIGINT', () => {
154
- log('\nšŸ‘‹ Shutting down...', colors.yellow);
155
- process.exit(0);
156
+ // Set up signal handlers
157
+ const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
158
+ signals.forEach(signal => {
159
+ process.on(signal, () => {
160
+ if (childProcess) {
161
+ // Forward signal to child process
162
+ childProcess.kill(signal);
163
+ } else {
164
+ // No child process, exit gracefully
165
+ if (signal === 'SIGINT') {
166
+ log('\nšŸ‘‹ Shutting down...', colors.yellow);
167
+ }
168
+ process.exit(0);
169
+ }
170
+ });
156
171
  });
157
172
 
158
173
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-annotations-server",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "MCP server for Vibe Annotations - AI-powered localhost development feedback",
5
5
  "main": "index.js",
6
6
  "bin": {