overmind-mcp 2.8.9 → 2.8.11
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-overmind-native.sh +220 -0
- package/package.json +3 -2
- package/scripts/install-native.mjs +86 -0
- package/scripts/postgres-manager.mjs +219 -219
- package/scripts/postinstall.mjs +45 -1
- package/scripts/setup.mjs +395 -395
- package/dist/bin/launch.js +0 -78
package/dist/bin/launch.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// launch.js — compiled launcher for Workflow
|
|
2
|
-
// Prebuild copies this to dist/bin/launch.js
|
|
3
|
-
|
|
4
|
-
const { exec, spawn } = require("child_process");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
|
|
8
|
-
const SCRIPT_DIR = path.resolve(__dirname, "..");
|
|
9
|
-
const LOG_DIR = path.join(SCRIPT_DIR, "logs");
|
|
10
|
-
const PORT = "3099";
|
|
11
|
-
const NAME = "Workflow";
|
|
12
|
-
const BUILD_CMD = "npm run build";
|
|
13
|
-
|
|
14
|
-
function log(msg) {
|
|
15
|
-
console.log(`[{new Date().toISOString()}] [{NAME}] ${msg}`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function ensureDir(dir) {
|
|
19
|
-
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function killPort(port) {
|
|
23
|
-
return new Promise((resolve) => {
|
|
24
|
-
const cmd = `powershell -c "Get-NetTCPConnection -LocalPort ${port} -State Listen -ErrorAction SilentlyContinue | Format-Table -HideTableHeaders -Property OwningProcess | ForEach-Object {$_.Trim()} | Where-Object {$_}"`;
|
|
25
|
-
exec(cmd, { cwd: SCRIPT_DIR }, (err, stdout) => {
|
|
26
|
-
const pids = (stdout || "").trim().split("\n").map((p) => p.trim()).filter(Boolean);
|
|
27
|
-
if (pids.length === 0) { log(`Port ${port} — no process`); resolve(); return; }
|
|
28
|
-
for (const pid of pids) {
|
|
29
|
-
log(`Port ${port} PID ${pid} killed`);
|
|
30
|
-
exec(`taskkill /F /PID ${pid}`, () => {});
|
|
31
|
-
}
|
|
32
|
-
setTimeout(resolve, 500);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function build() {
|
|
38
|
-
return new Promise((resolve) => {
|
|
39
|
-
log("[BUILD] Starting...");
|
|
40
|
-
exec(BUILD_CMD, { cwd: SCRIPT_DIR }, (err) => {
|
|
41
|
-
if (err && !fs.existsSync(path.join(SCRIPT_DIR, "dist"))) {
|
|
42
|
-
log("[FAIL] Build failed — no dist");
|
|
43
|
-
resolve(false);
|
|
44
|
-
} else {
|
|
45
|
-
log("[OK] Build complete");
|
|
46
|
-
resolve(true);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function launch() {
|
|
53
|
-
const logFile = path.join(LOG_DIR, `${NAME}.log`);
|
|
54
|
-
const errFile = path.join(LOG_DIR, `${NAME}.err.log`);
|
|
55
|
-
const out = fs.openSync(logFile, "a");
|
|
56
|
-
const err = fs.openSync(errFile, "a");
|
|
57
|
-
const env = { ...process.env, ...{} };
|
|
58
|
-
const child = spawn("node", ['--max-old-space-size=256', '--no-warnings', '--env-file=.env', 'dist/bin/cli.js', '--transport', 'httpStream', '--port', '3099'], {
|
|
59
|
-
cwd: SCRIPT_DIR,
|
|
60
|
-
detached: true,
|
|
61
|
-
stdio: ["ignore", out, err],
|
|
62
|
-
env,
|
|
63
|
-
});
|
|
64
|
-
child.unref();
|
|
65
|
-
log(`[SPAWN] PID=${child.pid}`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function main() {
|
|
69
|
-
log("[START] Launching...");
|
|
70
|
-
ensureDir(LOG_DIR);
|
|
71
|
-
await killPort(PORT);
|
|
72
|
-
const ok = await build();
|
|
73
|
-
if (!ok) { console.error("[ABORT] Build failed"); process.exit(1); }
|
|
74
|
-
launch();
|
|
75
|
-
log("[DONE] Server launched. Check ${LOG_DIR}/${NAME}.log");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
main().catch(console.error);
|