create-merlin-brain 2.1.7 → 2.1.8
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/bin/install.cjs +26 -0
- package/dist/server/version.d.ts +1 -1
- package/dist/server/version.js +1 -1
- package/package.json +1 -1
package/bin/install.cjs
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// CRITICAL: Detect if this is being run as MCP server (with 'serve' argument)
|
|
5
|
+
// If so, hand off to the actual MCP server instead of running the installer.
|
|
6
|
+
// This prevents the installer from reading MCP protocol messages as user input!
|
|
7
|
+
// =============================================================================
|
|
8
|
+
const isServeMode = process.argv.includes('serve');
|
|
9
|
+
|
|
10
|
+
if (isServeMode) {
|
|
11
|
+
// Hand off to the MCP server using dynamic import (works in CommonJS with Node 14+)
|
|
12
|
+
import('../dist/server/index.js').catch((err) => {
|
|
13
|
+
console.error('Failed to start Merlin MCP server:', err.message);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
});
|
|
16
|
+
// The import runs the server module which keeps the process alive.
|
|
17
|
+
// We don't need to do anything else here - the code below won't
|
|
18
|
+
// execute until the server exits (which it won't during normal operation).
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// INSTALLER CODE BELOW - Only runs when NOT in serve mode
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
if (!isServeMode) {
|
|
26
|
+
|
|
3
27
|
const fs = require('fs');
|
|
4
28
|
const path = require('path');
|
|
5
29
|
const os = require('os');
|
|
@@ -864,3 +888,5 @@ install().catch((err) => {
|
|
|
864
888
|
console.error('Installation failed:', err);
|
|
865
889
|
process.exit(1);
|
|
866
890
|
});
|
|
891
|
+
|
|
892
|
+
} // End of if (!isServeMode)
|
package/dist/server/version.d.ts
CHANGED
package/dist/server/version.js
CHANGED
package/package.json
CHANGED