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.
- package/commands/update.js +18 -4
- package/package.json +1 -1
package/commands/update.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|