@geminilight/mindos 0.1.8 → 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.
@@ -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
+ }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminilight/mindos",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "MindOS — Human-Agent Collaborative Mind System. Local-first knowledge base that syncs your mind to all AI Agents via MCP.",
5
5
  "keywords": [
6
6
  "mindos",