@txtscape/mcp 0.0.2 → 0.0.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.
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { spawn } = require('child_process');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
const BINARIES = {
|
|
9
|
+
'darwin-arm64': 'txtscape-mcp-darwin-arm64',
|
|
10
|
+
'darwin-x64': 'txtscape-mcp-darwin-x64',
|
|
11
|
+
'linux-x64': 'txtscape-mcp-linux-x64',
|
|
12
|
+
'linux-arm64': 'txtscape-mcp-linux-arm64',
|
|
13
|
+
'win32-x64': 'txtscape-mcp-win32-x64.exe',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const key = `${os.platform()}-${os.arch()}`;
|
|
17
|
+
const name = BINARIES[key];
|
|
18
|
+
|
|
19
|
+
if (!name) {
|
|
20
|
+
process.stderr.write(`txtscape-mcp: unsupported platform: ${key}\n`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const binary = path.join(__dirname, name);
|
|
25
|
+
|
|
26
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
27
|
+
|
|
28
|
+
child.on('exit', (code, signal) => {
|
|
29
|
+
if (signal) {
|
|
30
|
+
process.kill(process.pid, signal);
|
|
31
|
+
} else {
|
|
32
|
+
process.exit(code ?? 1);
|
|
33
|
+
}
|
|
34
|
+
});
|