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.
@@ -0,0 +1,220 @@
1
+ #!/usr/bin/env bash
2
+ # ============================================================
3
+ # install-overmind-native.sh
4
+ # Installation OverMind-MCP + Postgres-MCP — mode NATIF (sans Docker)
5
+ # Pour Ubuntu 26.04+ avec PostgreSQL 18 + pgvector + systemd
6
+ # Idempotent : peut être ré-exécuté sans casser l'existant.
7
+ # ============================================================
8
+
9
+ set -euo pipefail
10
+
11
+ # ---------- Couleurs ----------
12
+ R='\033[0;31m'; G='\033[0;32m'; Y='\033[1;33m'; C='\033[0;36m'; N='\033[0m'
13
+
14
+ log() { echo -e "${C}[$(date +%H:%M:%S)]${N} $*"; }
15
+ ok() { echo -e "${G}[OK]${N} $*"; }
16
+ warn() { echo -e "${Y}[WARN]${N} $*"; }
17
+ die() { echo -e "${R}[FAIL]${N} $*"; exit 1; }
18
+
19
+ # ---------- Constantes ----------
20
+ OM_USER="${SUDO_USER:-$(whoami)}"
21
+ OM_HOME="$(getent passwd "$OM_USER" | cut -d: -f6)"
22
+ OM_DIR="$OM_HOME/.overmind"
23
+ LOG_DIR="$OM_DIR/logs"
24
+ PG_DB="overmind_memory"
25
+ PG_PORT=5432
26
+ MCP_PORT_CORE=3099
27
+ MCP_PORT_PG=5433
28
+
29
+ [ "$(id -u)" -ne 0 ] && die "Lancer avec sudo : sudo $0"
30
+ [ -z "$OM_USER" ] || [ -z "$OM_HOME" ] && die "Impossible de déterminer l'utilisateur"
31
+
32
+ log "Installation pour user=$OM_USER home=$OM_HOME"
33
+
34
+ # ============================================================
35
+ # STEP 1/6 — Vérification Node.js + npm
36
+ # ============================================================
37
+ log "STEP 1/6 : Node.js"
38
+ command -v node >/dev/null || die "Node.js manquant : curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt install -y nodejs"
39
+ NODE_MAJ=$(node -p "process.versions.node.split('.')[0]")
40
+ [ "$NODE_MAJ" -ge 20 ] || die "Node >= 20 requis (vous avez $(node -v))"
41
+ ok "Node $(node -v) / npm $(npm -v)"
42
+
43
+ # ============================================================
44
+ # STEP 2/6 — PostgreSQL 18 + pgvector
45
+ # ============================================================
46
+ log "STEP 2/6 : PostgreSQL + pgvector"
47
+ if ! dpkg -l postgresql-18-pgvector 2>/dev/null | grep -q '^ii'; then
48
+ log "Installation postgresql-18-pgvector..."
49
+ apt update -qq
50
+ DEBIAN_FRONTEND=noninteractive apt install -y postgresql-18-pgvector postgresql-client-18
51
+ fi
52
+ ok "postgresql-18-pgvector $(dpkg -s postgresql-18-pgvector | awk '/Version:/ {print $2}')"
53
+
54
+ # Service postgresql actif
55
+ if ! systemctl is-active --quiet postgresql; then
56
+ systemctl enable --now postgresql
57
+ fi
58
+ ok "postgresql.service: $(systemctl is-active postgresql)"
59
+
60
+ # DB + extension vector
61
+ if ! sudo -u postgres psql -tAc "SELECT 1 FROM pg_database WHERE datname='$PG_DB'" | grep -q 1; then
62
+ log "Création DB $PG_DB..."
63
+ sudo -u postgres createdb "$PG_DB"
64
+ fi
65
+ sudo -u postgres psql -d "$PG_DB" -c "CREATE EXTENSION IF NOT EXISTS vector;" >/dev/null
66
+ PGV=$(sudo -u postgres psql -d "$PG_DB" -tAc "SELECT extversion FROM pg_extension WHERE extname='vector'")
67
+ ok "DB $PG_DB prête, pgvector v$PGV"
68
+
69
+ # ============================================================
70
+ # STEP 3/6 — Packages npm globaux
71
+ # ============================================================
72
+ log "STEP 3/6 : npm install -g"
73
+ if ! npm list -g overmind-mcp >/dev/null 2>&1; then
74
+ npm install -g overmind-mcp@latest
75
+ fi
76
+ if ! npm list -g overmind-postgres-mcp >/dev/null 2>&1; then
77
+ npm install -g overmind-postgres-mcp@latest
78
+ fi
79
+ ok "overmind-mcp $(npm list -g overmind-mcp --depth=0 | awk '/overmind-mcp@/ {print $2}')"
80
+ ok "overmind-postgres-mcp $(npm list -g overmind-postgres-mcp --depth=0 | awk '/overmind-postgres-mcp@/ {print $2}')"
81
+
82
+ # ============================================================
83
+ # STEP 4/6 — Arborescence + .env
84
+ # ============================================================
85
+ log "STEP 4/6 : ~/.overmind/"
86
+ mkdir -p "$OM_DIR/logs" "$OM_DIR/config"
87
+ chown -R "$OM_USER:$OM_USER" "$OM_DIR"
88
+
89
+ if [ ! -f "$OM_DIR/.env" ]; then
90
+ log "Création $OM_DIR/.env (template à compléter)..."
91
+ cat > "$OM_DIR/.env" <<'EOF'
92
+ # OverMind - Configuration principale (mode natif sans Docker)
93
+
94
+ # --- PostgreSQL (apt postgresql-18 + pgvector) ---
95
+ POSTGRES_HOST=127.0.0.1
96
+ POSTGRES_PORT=5432
97
+ POSTGRES_USER=postgres
98
+ POSTGRES_PASSWORD=CHANGEME_PG_PASS
99
+ POSTGRES_DATABASE=overmind_memory
100
+ POSTGRES_SSL=false
101
+ POSTGRES_MAX_CONNECTIONS=10
102
+
103
+ # --- Provider LLM par défaut ---
104
+ OVERMIND_DEFAULT_PROVIDER=anthropic
105
+
106
+ # --- Core ---
107
+ OVERMIND_MEMORY_TYPE=postgres
108
+ MEMORY_HTTP_PORT=3099
109
+ OVERMIND_HTTP_MODE=false
110
+ OVERMIND_HTTP_PORT=3099
111
+
112
+ # --- Embeddings (Qwen 8B, 4096D) ---
113
+ OVERMIND_EMBEDDING_DIMENSIONS=4096
114
+ OVERMIND_EMBEDDING_MODEL=qwen/qwen3-embedding-8b
115
+ OVERMIND_EMBEDDING_URL=https://openrouter.ai/api/v1
116
+ # OVERMIND_EMBEDDING_KEY=sk-or-...
117
+
118
+ # --- Clés LLM (à remplir) ---
119
+ # ANTHROPIC_AUTH_TOKEN=...
120
+ # ANTHROPIC_BASE_URL=https://api.anthropic.com
121
+ # ANTHROPIC_MODEL=claude-sonnet-4-6
122
+ # MISTRAL_API_KEY=...
123
+ # GLM_API_KEY=...
124
+ # ELEVENLABS_API_KEY=...
125
+ EOF
126
+ chown "$OM_USER:$OM_USER" "$OM_DIR/.env"
127
+ chmod 600 "$OM_DIR/.env"
128
+ warn "Éditer $OM_DIR/.env et remplir POSTGRES_PASSWORD + clés LLM"
129
+ else
130
+ ok ".env existant conservé"
131
+ fi
132
+
133
+ # ============================================================
134
+ # STEP 5/6 — Systemd units
135
+ # ============================================================
136
+ log "STEP 5/6 : systemd units"
137
+
138
+ write_unit() {
139
+ local name="$1" port="$2" entry="$3"
140
+ cat > "/etc/systemd/system/$name" <<EOF
141
+ [Unit]
142
+ Description=$name (OverMind)
143
+ After=network-online.target postgresql.service
144
+ Wants=network-online.target
145
+ Requires=postgresql.service
146
+
147
+ [Service]
148
+ Type=simple
149
+ User=$OM_USER
150
+ Group=$OM_USER
151
+ WorkingDirectory=$OM_DIR
152
+ EnvironmentFile=$OM_DIR/.env
153
+ ExecStart=/usr/bin/node --max-old-space-size=256 --no-warnings $entry
154
+ Restart=on-failure
155
+ RestartSec=5
156
+ StandardOutput=append:$LOG_DIR/$name.log
157
+ StandardError=append:$LOG_DIR/$name.err
158
+
159
+ [Install]
160
+ WantedBy=multi-user.target
161
+ EOF
162
+ }
163
+
164
+ write_unit "overmind-mcp.service" "$MCP_PORT_CORE" \
165
+ "/usr/lib/node_modules/overmind-mcp/dist/bin/cli.js --transport httpStream --port $MCP_PORT_CORE"
166
+
167
+ write_unit "overmind-postgres-mcp.service" "$MCP_PORT_PG" \
168
+ "/usr/lib/node_modules/overmind-postgres-mcp/dist/index.js"
169
+
170
+ systemctl daemon-reload
171
+ systemctl enable --now overmind-mcp.service overmind-postgres-mcp.service
172
+ ok "Services activés et démarrés"
173
+
174
+ # ============================================================
175
+ # STEP 6/6 — Validation HTTP
176
+ # ============================================================
177
+ log "STEP 6/6 : validation"
178
+
179
+ sleep 3
180
+ test_endpoint() {
181
+ local port="$1" name="$2"
182
+ local code
183
+ code=$(curl -s -o /dev/null -w "%{http_code}" -m 5 \
184
+ -H "Accept: application/json, text/event-stream" \
185
+ -H "Content-Type: application/json" \
186
+ -X POST "http://127.0.0.1:$port/mcp" \
187
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}' || echo "000")
188
+ if [ "$code" = "200" ]; then
189
+ ok "$name (port $port) : HTTP 200"
190
+ else
191
+ warn "$name (port $port) : HTTP $code — voir $LOG_DIR/$name.err"
192
+ fi
193
+ }
194
+
195
+ test_endpoint "$MCP_PORT_CORE" "overmind-mcp"
196
+ test_endpoint "$MCP_PORT_PG" "overmind-postgres-mcp"
197
+
198
+ # Test SQL direct
199
+ if sudo -u postgres psql -d "$PG_DB" -c "SELECT 1" >/dev/null 2>&1; then
200
+ ok "PostgreSQL $PG_DB accessible en local"
201
+ else
202
+ warn "PostgreSQL $PG_DB inaccessible — vérifier sudo -u postgres psql"
203
+ fi
204
+
205
+ echo
206
+ echo -e "${G}============================================================${N}"
207
+ echo -e "${G}✅ Installation terminée${N}"
208
+ echo -e "${G}============================================================${N}"
209
+ echo
210
+ echo "Endpoints (loopback uniquement) :"
211
+ echo " • overmind-mcp : http://127.0.0.1:$MCP_PORT_CORE"
212
+ echo " • overmind-postgres-mcp: http://127.0.0.1:$MCP_PORT_PG"
213
+ echo
214
+ echo "Pour accès distant, utiliser un tunnel SSH :"
215
+ echo " ssh -L 13099:127.0.0.1:$MCP_PORT_CORE -L 15433:127.0.0.1:$MCP_PORT_PG user@host"
216
+ echo
217
+ echo "Actions manuelles restantes :"
218
+ echo " 1. Éditer $OM_DIR/.env et remplir POSTGRES_PASSWORD + clés LLM"
219
+ echo " 2. sudo systemctl restart overmind-mcp overmind-postgres-mcp"
220
+ echo " 3. (Optionnel) Créer un user Postgres dédié et restreindre pg_hba.conf"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overmind-mcp",
3
- "version": "2.8.9",
3
+ "version": "2.8.11",
4
4
  "description": "Orchestrateur universel agents IA multi-modeles via MCP. Inclut le protocole 'Custom-Nickname' pour identifier vos agents avec des surnoms originaux (The Chaos Prophet, Shadow Sniper, etc.), l'isolation mémoire (Private Memory Context) et le support pour QwenCli et Nous Hermes. Installation automatique des dépendances Docker (PostgreSQL, pgvector) inclus.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,8 @@
9
9
  "overmind": "./dist/bin/cli.js",
10
10
  "overmind-setup": "./scripts/setup.mjs",
11
11
  "overmind-postgres-mcp": "./scripts/postgres-manager.mjs",
12
- "overmind-uninstall": "./scripts/uninstall.mjs"
12
+ "overmind-uninstall": "./scripts/uninstall.mjs",
13
+ "overmind-install-native": "./scripts/install-native.mjs"
13
14
  },
14
15
  "exports": {
15
16
  ".": {
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ═══════════════════════════════════════════════════════════════════════════════
4
+ * overmind-install-native — Lanceur cross-platform du script install natif
5
+ * ═══════════════════════════════════════════════════════════════════════════════
6
+ * Délègue au bon script selon l'OS :
7
+ * - Linux/macOS → bin/install-overmind-native.sh
8
+ * - Windows → instructions pour WSL (le mode natif est Linux-only)
9
+ *
10
+ * Utilisation :
11
+ * npx overmind-install-native
12
+ * overmind-install-native --yes (auto-install sans prompt)
13
+ * ═══════════════════════════════════════════════════════════════════════════════
14
+ */
15
+
16
+ import { spawnSync } from 'child_process';
17
+ import { existsSync } from 'fs';
18
+ import { fileURLToPath } from 'url';
19
+ import { dirname, join } from 'path';
20
+
21
+ const __filename = fileURLToPath(import.meta.url);
22
+ const __dirname = dirname(__filename);
23
+ const ROOT = join(__dirname, '..');
24
+
25
+ const COLORS = {
26
+ cyan: '\x1b[36m', green: '\x1b[32m', yellow: '\x1b[33m',
27
+ red: '\x1b[31m', reset: '\x1b[0m'
28
+ };
29
+ const c = (col, s) => `${COLORS[col]}${s}${COLORS.reset}`;
30
+
31
+ function header() {
32
+ console.log('');
33
+ console.log(c('cyan', '╔════════════════════════════════════════════════════════════════╗'));
34
+ console.log(c('cyan', '║ 🚀 OverMind-MCP — Installation NATIVE (sans Docker) ║'));
35
+ console.log(c('cyan', '╚════════════════════════════════════════════════════════════════╝'));
36
+ console.log('');
37
+ }
38
+
39
+ function launchUnix() {
40
+ const script = join(ROOT, 'bin', 'install-overmind-native.sh');
41
+ if (!existsSync(script)) {
42
+ console.error(c('red', `❌ Script introuvable: ${script}`));
43
+ process.exit(1);
44
+ }
45
+ console.log(c('yellow', '→ Lancement bin/install-overmind-native.sh'));
46
+ console.log(c('yellow', ' (sudo est requis pour apt, systemd, create DB)'));
47
+ console.log('');
48
+
49
+ // Nécessite sudo pour systemd, apt, postgres. Si root déjà, lancer tel quel.
50
+ const isRoot = process.getuid?.() === 0;
51
+ const cmd = isRoot ? 'bash' : 'sudo';
52
+ const args = isRoot
53
+ ? [script, ...process.argv.slice(2)]
54
+ : ['bash', script, ...process.argv.slice(2)];
55
+
56
+ const r = spawnSync(cmd, args, { stdio: 'inherit' });
57
+ process.exit(r.status ?? 1);
58
+ }
59
+
60
+ function windowsHelp() {
61
+ console.log(c('yellow', '⚠ Le mode natif est conçu pour Linux (systemd + apt + pgvector).'));
62
+ console.log('');
63
+ console.log('Options sur Windows :');
64
+ console.log('');
65
+ console.log(c('green', ' 1) WSL 2 (recommandé) — installer Ubuntu dans WSL :'));
66
+ console.log(' wsl --install -d Ubuntu-26.04');
67
+ console.log(' Puis dans WSL :');
68
+ console.log(' curl -fsSL https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/bin/install-overmind-native.sh | sudo bash');
69
+ console.log('');
70
+ console.log(c('green', ' 2) Docker Desktop (par défaut) :'));
71
+ console.log(' npm install -g overmind-mcp # postinstall Docker automatique');
72
+ console.log('');
73
+ console.log(c('green', ' 3) Installation manuelle dans WSL :'));
74
+ console.log(' git clone https://github.com/DeamonDev888/overmind-mcp');
75
+ console.log(' cd overmind-mcp');
76
+ console.log(' sudo bash bin/install-overmind-native.sh');
77
+ process.exit(0);
78
+ }
79
+
80
+ header();
81
+
82
+ if (process.platform === 'win32') {
83
+ windowsHelp();
84
+ } else {
85
+ launchUnix();
86
+ }