@geminilight/mindos 0.1.7 → 0.1.9
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/README.md +62 -42
- package/README_zh.md +62 -42
- package/assets/demo-flow-zh.html +30 -30
- package/assets/images/demo-flow-dark.png +0 -0
- package/assets/images/demo-flow-light.png +0 -0
- package/assets/images/demo-flow-zh-dark.png +0 -0
- package/assets/images/demo-flow-zh-light.png +0 -0
- package/bin/cli.js +49 -532
- package/bin/lib/build.js +59 -0
- package/bin/lib/colors.js +7 -0
- package/bin/lib/config.js +47 -0
- package/bin/lib/constants.js +13 -0
- package/bin/lib/gateway.js +244 -0
- package/bin/lib/mcp-install.js +156 -0
- package/bin/lib/mcp-spawn.js +36 -0
- package/bin/lib/pid.js +15 -0
- package/bin/lib/port.js +19 -0
- package/bin/lib/startup.js +51 -0
- package/bin/lib/stop.js +27 -0
- package/bin/lib/utils.js +16 -0
- package/package.json +1 -1
package/bin/lib/stop.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { green, yellow, dim } from './colors.js';
|
|
3
|
+
import { loadPids, clearPids } from './pid.js';
|
|
4
|
+
|
|
5
|
+
export function stopMindos() {
|
|
6
|
+
const pids = loadPids();
|
|
7
|
+
if (!pids.length) {
|
|
8
|
+
console.log(yellow('No PID file found, trying pattern-based stop...'));
|
|
9
|
+
try { execSync('pkill -f "next start|next dev" 2>/dev/null || true', { stdio: 'inherit' }); } catch {}
|
|
10
|
+
try { execSync('pkill -f "mcp/src/index" 2>/dev/null || true', { stdio: 'inherit' }); } catch {}
|
|
11
|
+
console.log(green('\u2714 Done'));
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
let stopped = 0;
|
|
15
|
+
for (const pid of pids) {
|
|
16
|
+
try {
|
|
17
|
+
process.kill(pid, 'SIGTERM');
|
|
18
|
+
stopped++;
|
|
19
|
+
} catch {
|
|
20
|
+
// process already gone — ignore
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
clearPids();
|
|
24
|
+
console.log(stopped
|
|
25
|
+
? green(`\u2714 Stopped ${stopped} process${stopped > 1 ? 'es' : ''}`)
|
|
26
|
+
: dim('No running processes found'));
|
|
27
|
+
}
|
package/bin/lib/utils.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { ROOT } from './constants.js';
|
|
5
|
+
|
|
6
|
+
export function run(command, cwd = ROOT) {
|
|
7
|
+
try {
|
|
8
|
+
execSync(command, { cwd, stdio: 'inherit', env: process.env });
|
|
9
|
+
} catch {
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function expandHome(p) {
|
|
15
|
+
return p.startsWith('~/') ? resolve(homedir(), p.slice(2)) : p;
|
|
16
|
+
}
|
package/package.json
CHANGED