promptgraph-mcp 2.9.45 → 2.9.46

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/commands/update.js +18 -4
  2. package/package.json +1 -1
@@ -35,17 +35,31 @@ export default async function handler(args, bin) {
35
35
 
36
36
  info(`Current: ${chalk.gray('v' + currentVersion)} → Latest: ${chalk.white.bold('v' + latest)}`);
37
37
 
38
- // Kill other node processes that may lock native .node files (e.g. pg reindex still running)
39
- // Exclude current PID to avoid killing ourselves
38
+ // Kill other promptgraph node processes that may lock native .node files
40
39
  if (process.platform === 'win32') {
41
- spawnSync('wmic', ['process', 'where', `name='node.exe' and ProcessId!=${process.pid}`, 'delete'], { stdio: 'ignore', shell: true });
40
+ // taskkill is reliable on Windows 10/11 (wmic deprecated since Win11 22H2)
41
+ spawnSync('taskkill', ['/F', '/FI', `PID ne ${process.pid}`, '/FI', 'IMAGENAME eq node.exe'], { stdio: 'ignore', shell: true });
42
42
  } else {
43
43
  spawnSync('pkill', ['-f', 'promptgraph-mcp'], { stdio: 'ignore' });
44
44
  }
45
45
 
46
+ // Brief pause so OS releases file locks before npm touches them
47
+ await new Promise(r => setTimeout(r, 1500));
48
+
46
49
  const updateSpin = (await import('../cli.js')).spinner(`Installing promptgraph-mcp@latest (v${latest})...`);
47
50
  updateSpin.start();
48
- const result = spawnSync('npm', ['install', '-g', 'promptgraph-mcp@latest'], { encoding: 'utf8', stdio: 'pipe', shell: true });
51
+
52
+ let result = spawnSync('npm', ['install', '-g', 'promptgraph-mcp@latest'], { encoding: 'utf8', stdio: 'pipe', shell: true });
53
+
54
+ // EBUSY: MCP server may have been re-spawned by the editor — retry once with --force
55
+ if (result.status !== 0 && (result.stderr || '').includes('EBUSY')) {
56
+ updateSpin.stop();
57
+ info('File busy (MCP server still running). Close Claude Code / your editor and press Enter to retry, or Ctrl+C to cancel.');
58
+ await new Promise(r => process.stdin.once('data', r));
59
+ updateSpin.start();
60
+ result = spawnSync('npm', ['install', '-g', 'promptgraph-mcp@latest', '--force'], { encoding: 'utf8', stdio: 'pipe', shell: true });
61
+ }
62
+
49
63
  updateSpin.stop();
50
64
 
51
65
  if (result.status !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "2.9.45",
3
+ "version": "2.9.46",
4
4
  "files": [
5
5
  "*.js",
6
6
  "commands/",