overmind-mcp 2.0.5 → 2.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overmind-mcp",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "preferGlobal": true,
5
5
  "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.",
6
6
  "type": "module",
@@ -2,19 +2,21 @@
2
2
  /**
3
3
  * ═══════════════════════════════════════════════════════════════════════════════
4
4
  * OVERMIND-MCP - POST-INSTALL AUTOMATIQUE
5
- * ═══════════════════════════════════════════════════════════════════════════════
5
+ * ═════════════════════════════════════════════════════════════════════════════
6
6
  * Script exécuté automatiquement après npm install -g overmind-mcp
7
- * Installe et configure TOUT :
7
+ * INSTALLE ET DÉMARRE TOUT AUTOMATIQUEMENT :
8
8
  * - Vérifie Docker
9
9
  * - Installe PostgreSQL + pgvector (si absent)
10
- * - Télécharge et lance l'infrastructure Docker complète
10
+ * - Copie .env.example .env
11
+ * - Copie .mcp.json.example → .mcp.json
12
+ * - Télécharge et démarre TOUTE l'infrastructure Docker
11
13
  * - Valide tous les services
12
- * - Montre à l'utilisateur voir les services dans Docker Desktop
14
+ * - Montre où les voir dans Docker Desktop
13
15
  * ═══════════════════════════════════════════════════════════════════════════════
14
16
  */
15
17
 
16
18
  import { execSync, spawn } from 'child_process';
17
- import { existsSync, mkdirSync, writeFileSync } from 'fs';
19
+ import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
18
20
  import { join } from 'path';
19
21
  import { fileURLToPath } from 'url';
20
22
  import { dirname } from 'path';
@@ -28,8 +30,8 @@ const INSTALL_DIR = join(
28
30
  );
29
31
 
30
32
  // ═══════════════════════════════════════════════════════════════════════════════
31
- // CONFIG & COLORS
32
- // ═══════════════════════════════════════════════════════════════════════════════
33
+ // COLORS
34
+ // ═════════════════════════════════════════════════════════════════════════════
33
35
 
34
36
  const COLORS = {
35
37
  cyan: '\x1b[36m',
@@ -84,7 +86,7 @@ async function runCommandAsync(cmd, description) {
84
86
 
85
87
  // ═══════════════════════════════════════════════════════════════════════════════
86
88
  // INSTALLATION STEPS
87
- // ═══════════════════════════════════════════════════════════════════════════════
89
+ // ═════════════════════════════════════════════════════════════════════════════
88
90
 
89
91
  async function checkDocker() {
90
92
  logSection('VÉRIFICATION DOCKER');
@@ -104,7 +106,7 @@ async function checkDocker() {
104
106
  console.log(' Linux: https://docs.docker.com/engine/install/');
105
107
  }
106
108
 
107
- log(COLORS.cyan, '\n📥 Après installation de Docker, relancez: npm install -g overmind-mcp');
109
+ log(COLORS.cyan, '\nAprès installation de Docker, relancez: npm install -g overmind-mcp');
108
110
  return false;
109
111
  }
110
112
 
@@ -169,28 +171,46 @@ async function setupPostgreSQL() {
169
171
  }
170
172
 
171
173
  async function setupInfrastructure() {
172
- logSection('TÉLÉCHARGEMENT INFRASTRUCTURE DOCKER');
174
+ logSection('TÉLÉCHARGEMENT INFRASTRUCTURE');
173
175
 
174
176
  mkdirSync(INSTALL_DIR, { recursive: true });
175
177
 
176
- log(COLORS.yellow, '📥 Téléchargement docker-compose.yml...');
178
+ log(COLORS.yellow, '📥 Téléchargement fichiers docker-compose...');
177
179
 
178
180
  const composeUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/docker-compose.yml';
179
181
  const exportersUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/docker-compose.exporters.yml';
182
+ const envExampleUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/.env.example';
183
+ const mcpExampleUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/.mcp.json.example';
180
184
 
181
185
  try {
186
+ // Télécharger docker-compose.yml
182
187
  const composeData = runCommand(`curl -sL ${composeUrl}`);
183
188
  if (composeData) {
184
189
  writeFileSync(join(INSTALL_DIR, 'docker-compose.yml'), composeData);
185
190
  log(COLORS.green, '✅ docker-compose.yml téléchargé');
186
191
  }
187
192
 
193
+ // Télécharger docker-compose.exporters.yml
188
194
  const exportersData = runCommand(`curl -sL ${exportersUrl}`);
189
195
  if (exportersData) {
190
196
  writeFileSync(join(INSTALL_DIR, 'docker-compose.exporters.yml'), exportersData);
191
197
  log(COLORS.green, '✅ docker-compose.exporters.yml téléchargé');
192
198
  }
193
199
 
200
+ // Télécharger .env.example
201
+ const envExampleData = runCommand(`curl -sL ${envExampleUrl}`);
202
+ if (envExampleData) {
203
+ writeFileSync(join(INSTALL_DIR, '.env.example'), envExampleData);
204
+ log(COLORS.green, '✅ .env.example téléchargé');
205
+ }
206
+
207
+ // Télécharger .mcp.json.example
208
+ const mcpExampleData = runCommand(`curl -sL ${mcpExampleUrl}`);
209
+ if (mcpExampleData) {
210
+ writeFileSync(join(INSTALL_DIR, '.mcp.json.example'), mcpExampleData);
211
+ log(COLORS.green, '✅ .mcp.json.example téléchargé');
212
+ }
213
+
194
214
  return true;
195
215
  } catch (error) {
196
216
  log(COLORS.red, '❌ Erreur téléchargement: ' + error.message);
@@ -198,30 +218,115 @@ async function setupInfrastructure() {
198
218
  }
199
219
  }
200
220
 
221
+ function createEnvConfig() {
222
+ logSection('CRÉATION CONFIGURATION');
223
+
224
+ mkdirSync(INSTALL_DIR, { recursive: true });
225
+
226
+ const envFile = join(INSTALL_DIR, '.env');
227
+ const envExampleFile = join(INSTALL_DIR, '.env.example');
228
+ const mcpFile = join(INSTALL_DIR, '.mcp.json');
229
+ const mcpExampleFile = join(INSTALL_DIR, '.mcp.json.example');
230
+
231
+ // Copier .env.example → .env si existe
232
+ if (existsSync(envExampleFile) && !existsSync(envFile)) {
233
+ let envContent;
234
+
235
+ if (process.platform === 'win32') {
236
+ envContent = runCommand(`type "${envExampleFile}"`, { stdio: 'pipe' });
237
+ } else {
238
+ envContent = runCommand(`cat "${envExampleFile}"`, { stdio: 'pipe' });
239
+ }
240
+
241
+ if (envContent) {
242
+ writeFileSync(envFile, envContent);
243
+ log(COLORS.green, '✅ .env créé (à partir de .env.example)');
244
+ }
245
+ }
246
+
247
+ // Créer .env minimal si n'existe pas
248
+ if (!existsSync(envFile)) {
249
+ const envContent = `# OverMind-MCP Environment Configuration
250
+ # Généré automatiquement par npm install
251
+
252
+ # PostgreSQL
253
+ POSTGRES_HOST=localhost
254
+ POSTGRES_PORT=5432
255
+ POSTGRES_USER=postgres
256
+ POSTGRES_PASSWORD=overmind_temp_password_change_me
257
+ POSTGRES_DB=overmind
258
+
259
+ # OpenTelemetry (optionnel)
260
+ OTEL_ENABLED=false
261
+
262
+ # Workspace
263
+ OVERMIND_WORKSPACE=${INSTALL_DIR}
264
+ `;
265
+ writeFileSync(envFile, envContent);
266
+ log(COLORS.green, '✅ Configuration .env créée: ' + envFile);
267
+ }
268
+
269
+ // Copier .mcp.json.example → .mcp.json si existe
270
+ if (existsSync(mcpExampleFile) && !existsSync(mcpFile)) {
271
+ let mcpContent;
272
+
273
+ if (process.platform === 'win32') {
274
+ mcpContent = runCommand(`type "${mcpExampleFile}"`, { stdio: 'pipe' });
275
+ } else {
276
+ mcpContent = runCommand(`cat "${mcpExampleFile}"`, { stdio: 'pipe' });
277
+ }
278
+
279
+ if (mcpContent) {
280
+ writeFileSync(mcpFile, mcpContent);
281
+ log(COLORS.green, '✅ .mcp.json créé (à partir de .mcp.json.example)');
282
+ }
283
+ }
284
+ }
285
+
201
286
  async function startInfrastructure() {
202
- logSection('DÉMARRAGE INFRASTRUCTURE');
287
+ logSection('DÉMARRAGE AUTOMATIQUE INFRASTRUCTURE COMPLÈTE');
203
288
 
204
289
  const composeFile = join(INSTALL_DIR, 'docker-compose.yml');
205
290
 
206
291
  if (!existsSync(composeFile)) {
207
292
  log(COLORS.yellow, '⚠️ docker-compose.yml non trouvé. Téléchargement...');
208
- return false;
293
+ const downloaded = await setupInfrastructure();
294
+ if (!downloaded) {
295
+ return false;
296
+ }
209
297
  }
210
298
 
211
- log(COLORS.cyan, '💡 Infrastructure Docker téléchargée.');
212
- log(COLORS.yellow, '⚠️ Pour démarrer tous les services (RabbitMQ, Temporal, Prometheus, Grafana, Jaeger):');
213
- log(COLORS.white, ' overmind-setup --full');
214
- log(COLORS.white, ' → Ou manuellement: cd ~/.overmind && docker-compose up -d');
215
- log(COLORS.white, ' ');
216
- log(COLORS.green, '✅ PostgreSQL + pgvector sont déjà prêts !');
299
+ try {
300
+ log(COLORS.yellow, '🚀 Démarrage automatique de TOUS les services...');
301
+ log(COLORS.cyan, ' (PostgreSQL, RabbitMQ, Temporal, Prometheus, Grafana, Jaeger, Redis)');
217
302
 
218
- return true;
303
+ await runCommandAsync(
304
+ `cd "${INSTALL_DIR}" && docker-compose -f docker-compose.yml pull`,
305
+ 'Téléchargement images Docker'
306
+ );
307
+
308
+ await runCommandAsync(
309
+ `cd "${INSTALL_DIR}" && docker-compose -f docker-compose.yml up -d`,
310
+ 'Démarrage infrastructure complète'
311
+ );
312
+
313
+ log(COLORS.cyan, '\n⏳ Attente démarrage des services (20s)...');
314
+ await new Promise(resolve => setTimeout(resolve, 20000));
315
+
316
+ return true;
317
+ } catch (error) {
318
+ log(COLORS.red, '\n⚠️ Erreur démarrage infrastructure: ' + error.message);
319
+ log(COLORS.yellow, '\n💡 Solution manuelle:');
320
+ log(COLORS.white, ' cd ~/.overmind');
321
+ log(COLORS.white, ' docker-compose up -d');
322
+ return false;
323
+ }
219
324
  }
220
325
 
221
326
  async function validateServices() {
222
327
  logSection('VALIDATION DES SERVICES');
223
328
 
224
- log(COLORS.yellow, '🔍 Vérification des containers...\n');
329
+ log(COLORS.yellow, '🔍 Vérification des containers Docker...\n');
225
330
 
226
331
  const services = [
227
332
  { name: 'PostgreSQL + pgvector', filter: 'postgres', color: COLORS.green },
@@ -230,6 +335,7 @@ async function validateServices() {
230
335
  { name: 'Prometheus', filter: 'prometheus', color: COLORS.green },
231
336
  { name: 'Grafana', filter: 'grafana', color: COLORS.green },
232
337
  { name: 'Jaeger', filter: 'jaeger', color: COLORS.green },
338
+ { name: 'Redis', filter: 'redis', color: COLORS.green },
233
339
  ];
234
340
 
235
341
  let allRunning = true;
@@ -251,34 +357,6 @@ async function validateServices() {
251
357
  return allRunning;
252
358
  }
253
359
 
254
- function createEnvConfig() {
255
- mkdirSync(INSTALL_DIR, { recursive: true });
256
-
257
- const envFile = join(INSTALL_DIR, '.env');
258
-
259
- if (!existsSync(envFile)) {
260
- const envContent = `# OverMind-MCP Environment Configuration
261
- # Généré automatiquement par npm install
262
-
263
- # PostgreSQL
264
- POSTGRES_HOST=localhost
265
- POSTGRES_PORT=5432
266
- POSTGRES_USER=postgres
267
- POSTGRES_PASSWORD=overmind_temp_password_change_me
268
- POSTGRES_DB=overmind
269
-
270
- # OpenTelemetry (optionnel)
271
- OTEL_ENABLED=false
272
-
273
- # Workspace
274
- OVERMIND_WORKSPACE=${INSTALL_DIR}
275
- `;
276
-
277
- writeFileSync(envFile, envContent);
278
- log(COLORS.green, '✅ Configuration créée: ' + envFile);
279
- }
280
- }
281
-
282
360
  function showSummary() {
283
361
  console.log('\n╔══════════════════════════════════════════════════════════════════╗');
284
362
  console.log('║' + ' '.repeat(64) + '║');
@@ -286,13 +364,21 @@ function showSummary() {
286
364
  console.log('║' + ' '.repeat(64) + '║');
287
365
  console.log('╚══════════════════════════════════════════════════════════════════╝');
288
366
  console.log('');
289
- log(COLORS.yellow, '📋 SERVICES DISPONIBLES:');
367
+ log(COLORS.yellow, '📋 SERVICES ACTIFS DANS DOCKER DESKTOP:');
290
368
  console.log('');
291
369
  console.log('┌─────────────────────────────────────────────────────────────────┐');
292
- console.log('│ ' + COLORS.cyan + 'Ouvrez Docker Desktop pour voir tous les containers' + COLORS.reset + ' │');
370
+ console.log('│ ' + COLORS.cyan + 'Ouvrez Docker Desktop onglet "Containers"' + COLORS.reset + ' │');
371
+ console.log('│ ' + COLORS.cyan + 'Vous verrez tous les services OverMind actifs:' + COLORS.reset + ' │');
372
+ console.log('│ ' + COLORS.green + ' • PostgreSQL + pgvector' + COLORS.reset + ' │');
373
+ console.log('│ ' + COLORS.green + ' • RabbitMQ (Message Broker)' + COLORS.reset + ' │');
374
+ console.log('│ ' + COLORS.green + ' • Temporal (Workflow Engine)' + COLORS.reset + ' │');
375
+ console.log('│ ' + COLORS.green + ' • Prometheus (Métriques)' + COLORS.reset + ' │');
376
+ console.log('│ ' + COLORS.green + ' • Grafana (Dashboards)' + COLORS.reset + ' │');
377
+ console.log('│ ' + COLORS.green + ' • Jaeger (Tracing)' + COLORS.reset + ' │');
378
+ console.log('│ ' + COLORS.green + ' • Redis (Cache)' + COLORS.reset + ' │');
293
379
  console.log('│ │');
294
380
  console.log('│ ' + COLORS.yellow + 'URLs utiles:' + COLORS.reset + ' │');
295
- console.log('│ • Prometheus: ' + COLORS.cyan + 'http://localhost:9090' + COLORS.reset + ' │');
381
+ console.log('│ • Prometheus: ' + COLORS.cyan + 'http://localhost:9090' + COLORS.reset + ' │');
296
382
  console.log('│ • Grafana: ' + COLORS.cyan + 'http://localhost:3000' + COLORS.reset + ' (admin/admin)' + ' │');
297
383
  console.log('│ • Jaeger: ' + COLORS.cyan + 'http://localhost:16686' + COLORS.reset + ' │');
298
384
  console.log('│ • RabbitMQ: ' + COLORS.cyan + 'http://localhost:15672' + COLORS.reset + ' (guest/guest)' + ' │');
@@ -309,9 +395,9 @@ function showSummary() {
309
395
  console.log('');
310
396
  }
311
397
 
312
- // ═══════════════════════════════════════════════════════════════════════════════
398
+ // ═════════════════════════════════════════════════════════════════════════════
313
399
  // MAIN
314
- // ═══════════════════════════════════════════════════════════════════════════════
400
+ // ═════════════════════════════════════════════════════════════════════════════
315
401
 
316
402
  async function main() {
317
403
  console.log('╔══════════════════════════════════════════════════════════════════╗');
@@ -322,12 +408,15 @@ async function main() {
322
408
  console.log('');
323
409
 
324
410
  // Banner
325
- console.log(COLORS.cyan + 'Ce script va:' + COLORS.reset);
411
+ console.log(COLORS.cyan + 'Ce script VA installer automatiquement:' + COLORS.reset);
326
412
  console.log(' ✓ Vérifier Docker');
327
413
  console.log(' ✓ Installer PostgreSQL + pgvector (si absent)');
328
- console.log(' ✓ Télécharger l\'infrastructure Docker');
329
- console.log(' ✓ Démarrer tous les services');
330
- console.log(' ✓ Valider l\'installation');
414
+ console.log(' ✓ Télécharger docker-compose.yml et configs');
415
+ console.log(' ✓ Démarrer TOUS les services Docker automatiquement');
416
+ console.log(' ✓ Copier .env.example → .env');
417
+ console.log(' ✓ Copier .mcp.json.example → .mcp.json');
418
+ console.log(' ✓ Valider tous les services');
419
+ console.log(' ✓ Montrer où les voir dans Docker Desktop');
331
420
  console.log('');
332
421
 
333
422
  // Step 1: Check Docker
@@ -336,28 +425,36 @@ async function main() {
336
425
  return;
337
426
  }
338
427
 
339
- // Step 2: Setup .env
340
- createEnvConfig();
341
-
342
- // Step 3: Install PostgreSQL if needed
428
+ // Step 2: Setup PostgreSQL
343
429
  await setupPostgreSQL();
344
430
 
345
- // Step 4: Download infrastructure files
346
- await setupInfrastructure();
431
+ // Step 3: Setup .env et .mcp.json
432
+ createEnvConfig();
347
433
 
348
- // Step 5: Show how to start full infrastructure
349
- await startInfrastructure();
434
+ // Step 4: Download infrastructure files
435
+ const downloaded = await setupInfrastructure();
436
+
437
+ // Step 5: Start ALL services automatically
438
+ if (downloaded) {
439
+ const started = await startInfrastructure();
440
+ if (!started) {
441
+ log(COLORS.yellow, '\n⚠️ Infrastructure non démarrée automatiquement.');
442
+ log(COLORS.yellow, ' PostgreSQL fonctionne, mais les autres services ne sont pas actifs.');
443
+ }
444
+ }
350
445
 
351
- // Step 6: Show PostgreSQL is ready
352
- logSection('POSTGRESQL PRÊT');
353
- log(COLORS.green, '✅ PostgreSQL + pgvector sont installés et prêts !');
354
- log(COLORS.cyan, '');
355
- log(COLORS.yellow, '🚀 Pour activer toutes les features (Swarm, Workflows, Observabilité):');
356
- log(COLORS.white, ' Option 1: overmind-setup --full');
357
- log(COLORS.white, ' Option 2: cd ~/.overmind && docker-compose up -d');
358
- log(COLORS.white, '');
446
+ // Step 6: Validate ALL services
447
+ if (downloaded) {
448
+ const allOk = await validateServices();
449
+ if (allOk) {
450
+ logSection(' TOUS LES SERVICES SONT ACTIFS');
451
+ log(COLORS.green, '🎉 Installation complète réussie !');
452
+ } else {
453
+ logSection('⚠️ CERTAINS SERVICES NON DÉMARRÉS');
454
+ }
455
+ }
359
456
 
360
- // Show summary
457
+ // Show final summary
361
458
  showSummary();
362
459
  }
363
460