2026-01-25 01:31:03 -06:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
|
|
const { spawn } = require('child_process');
|
|
|
|
|
const path = require('path');
|
2026-01-26 23:48:23 -06:00
|
|
|
const fs = require('fs');
|
2026-01-25 01:31:03 -06:00
|
|
|
const os = require('os');
|
|
|
|
|
|
|
|
|
|
const platform = os.platform();
|
2026-01-25 01:44:11 -06:00
|
|
|
const binaryName = platform === 'win32' ? 'vestige-mcp.exe' : 'vestige-mcp';
|
2026-01-26 23:48:23 -06:00
|
|
|
const binaryPath = path.join(__dirname, binaryName);
|
|
|
|
|
|
|
|
|
|
if (!fs.existsSync(binaryPath)) {
|
|
|
|
|
console.error('Error: vestige-mcp binary not found.');
|
|
|
|
|
console.error(`Expected at: ${binaryPath}`);
|
|
|
|
|
console.error('');
|
|
|
|
|
console.error('Try reinstalling: npm install -g @vestige/mcp');
|
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
2026-01-25 01:31:03 -06:00
|
|
|
|
|
|
|
|
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
|
|
|
stdio: 'inherit',
|
|
|
|
|
});
|
|
|
|
|
|
2026-01-26 23:48:23 -06:00
|
|
|
child.on('error', (err) => {
|
|
|
|
|
console.error('Failed to start vestige-mcp:', err.message);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
});
|
|
|
|
|
|
2026-01-25 01:31:03 -06:00
|
|
|
child.on('exit', (code) => {
|
|
|
|
|
process.exit(code ?? 0);
|
|
|
|
|
});
|