overmind-mcp 2.0.4 → 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 +1 -1
- package/scripts/postinstall.mjs +159 -67
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "overmind-mcp",
|
|
3
|
-
"version": "2.0.
|
|
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",
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -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
|
-
*
|
|
7
|
+
* INSTALLE ET DÉMARRE TOUT AUTOMATIQUEMENT :
|
|
8
8
|
* - Vérifie Docker
|
|
9
9
|
* - Installe PostgreSQL + pgvector (si absent)
|
|
10
|
-
* -
|
|
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
|
|
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
|
-
//
|
|
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, '\
|
|
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
|
|
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
|
|
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,29 +218,107 @@ 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 COMPLÈTE');
|
|
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
|
-
log(COLORS.yellow, '⚠️ docker-compose.yml non trouvé.
|
|
208
|
-
|
|
292
|
+
log(COLORS.yellow, '⚠️ docker-compose.yml non trouvé. Téléchargement...');
|
|
293
|
+
const downloaded = await setupInfrastructure();
|
|
294
|
+
if (!downloaded) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
209
297
|
}
|
|
210
298
|
|
|
211
299
|
try {
|
|
212
|
-
log(COLORS.yellow, '🚀 Démarrage
|
|
300
|
+
log(COLORS.yellow, '🚀 Démarrage automatique de TOUS les services...');
|
|
301
|
+
log(COLORS.cyan, ' (PostgreSQL, RabbitMQ, Temporal, Prometheus, Grafana, Jaeger, Redis)');
|
|
302
|
+
|
|
303
|
+
await runCommandAsync(
|
|
304
|
+
`cd "${INSTALL_DIR}" && docker-compose -f docker-compose.yml pull`,
|
|
305
|
+
'Téléchargement images Docker'
|
|
306
|
+
);
|
|
307
|
+
|
|
213
308
|
await runCommandAsync(
|
|
214
309
|
`cd "${INSTALL_DIR}" && docker-compose -f docker-compose.yml up -d`,
|
|
215
|
-
'Démarrage infrastructure'
|
|
310
|
+
'Démarrage infrastructure complète'
|
|
216
311
|
);
|
|
217
312
|
|
|
218
|
-
log(COLORS.cyan, '\n⏳ Attente démarrage des services (
|
|
219
|
-
await new Promise(resolve => setTimeout(resolve,
|
|
313
|
+
log(COLORS.cyan, '\n⏳ Attente démarrage des services (20s)...');
|
|
314
|
+
await new Promise(resolve => setTimeout(resolve, 20000));
|
|
220
315
|
|
|
221
316
|
return true;
|
|
222
317
|
} catch (error) {
|
|
223
|
-
log(COLORS.red, '
|
|
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');
|
|
224
322
|
return false;
|
|
225
323
|
}
|
|
226
324
|
}
|
|
@@ -228,7 +326,7 @@ async function startInfrastructure() {
|
|
|
228
326
|
async function validateServices() {
|
|
229
327
|
logSection('VALIDATION DES SERVICES');
|
|
230
328
|
|
|
231
|
-
log(COLORS.yellow, '🔍 Vérification des containers...\n');
|
|
329
|
+
log(COLORS.yellow, '🔍 Vérification des containers Docker...\n');
|
|
232
330
|
|
|
233
331
|
const services = [
|
|
234
332
|
{ name: 'PostgreSQL + pgvector', filter: 'postgres', color: COLORS.green },
|
|
@@ -237,6 +335,7 @@ async function validateServices() {
|
|
|
237
335
|
{ name: 'Prometheus', filter: 'prometheus', color: COLORS.green },
|
|
238
336
|
{ name: 'Grafana', filter: 'grafana', color: COLORS.green },
|
|
239
337
|
{ name: 'Jaeger', filter: 'jaeger', color: COLORS.green },
|
|
338
|
+
{ name: 'Redis', filter: 'redis', color: COLORS.green },
|
|
240
339
|
];
|
|
241
340
|
|
|
242
341
|
let allRunning = true;
|
|
@@ -258,34 +357,6 @@ async function validateServices() {
|
|
|
258
357
|
return allRunning;
|
|
259
358
|
}
|
|
260
359
|
|
|
261
|
-
function createEnvConfig() {
|
|
262
|
-
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
263
|
-
|
|
264
|
-
const envFile = join(INSTALL_DIR, '.env');
|
|
265
|
-
|
|
266
|
-
if (!existsSync(envFile)) {
|
|
267
|
-
const envContent = `# OverMind-MCP Environment Configuration
|
|
268
|
-
# Généré automatiquement par npm install
|
|
269
|
-
|
|
270
|
-
# PostgreSQL
|
|
271
|
-
POSTGRES_HOST=localhost
|
|
272
|
-
POSTGRES_PORT=5432
|
|
273
|
-
POSTGRES_USER=postgres
|
|
274
|
-
POSTGRES_PASSWORD=overmind_temp_password_change_me
|
|
275
|
-
POSTGRES_DB=overmind
|
|
276
|
-
|
|
277
|
-
# OpenTelemetry (optionnel)
|
|
278
|
-
OTEL_ENABLED=false
|
|
279
|
-
|
|
280
|
-
# Workspace
|
|
281
|
-
OVERMIND_WORKSPACE=${INSTALL_DIR}
|
|
282
|
-
`;
|
|
283
|
-
|
|
284
|
-
writeFileSync(envFile, envContent);
|
|
285
|
-
log(COLORS.green, '✅ Configuration créée: ' + envFile);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
360
|
function showSummary() {
|
|
290
361
|
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
291
362
|
console.log('║' + ' '.repeat(64) + '║');
|
|
@@ -293,13 +364,21 @@ function showSummary() {
|
|
|
293
364
|
console.log('║' + ' '.repeat(64) + '║');
|
|
294
365
|
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
295
366
|
console.log('');
|
|
296
|
-
log(COLORS.yellow, '📋 SERVICES
|
|
367
|
+
log(COLORS.yellow, '📋 SERVICES ACTIFS DANS DOCKER DESKTOP:');
|
|
297
368
|
console.log('');
|
|
298
369
|
console.log('┌─────────────────────────────────────────────────────────────────┐');
|
|
299
|
-
console.log('│ ' + COLORS.cyan + 'Ouvrez Docker Desktop
|
|
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 + ' │');
|
|
300
379
|
console.log('│ │');
|
|
301
380
|
console.log('│ ' + COLORS.yellow + 'URLs utiles:' + COLORS.reset + ' │');
|
|
302
|
-
console.log('│ • Prometheus:
|
|
381
|
+
console.log('│ • Prometheus: ' + COLORS.cyan + 'http://localhost:9090' + COLORS.reset + ' │');
|
|
303
382
|
console.log('│ • Grafana: ' + COLORS.cyan + 'http://localhost:3000' + COLORS.reset + ' (admin/admin)' + ' │');
|
|
304
383
|
console.log('│ • Jaeger: ' + COLORS.cyan + 'http://localhost:16686' + COLORS.reset + ' │');
|
|
305
384
|
console.log('│ • RabbitMQ: ' + COLORS.cyan + 'http://localhost:15672' + COLORS.reset + ' (guest/guest)' + ' │');
|
|
@@ -316,9 +395,9 @@ function showSummary() {
|
|
|
316
395
|
console.log('');
|
|
317
396
|
}
|
|
318
397
|
|
|
319
|
-
//
|
|
398
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
320
399
|
// MAIN
|
|
321
|
-
//
|
|
400
|
+
// ═════════════════════════════════════════════════════════════════════════════
|
|
322
401
|
|
|
323
402
|
async function main() {
|
|
324
403
|
console.log('╔══════════════════════════════════════════════════════════════════╗');
|
|
@@ -329,12 +408,15 @@ async function main() {
|
|
|
329
408
|
console.log('');
|
|
330
409
|
|
|
331
410
|
// Banner
|
|
332
|
-
console.log(COLORS.cyan + 'Ce script
|
|
411
|
+
console.log(COLORS.cyan + 'Ce script VA installer automatiquement:' + COLORS.reset);
|
|
333
412
|
console.log(' ✓ Vérifier Docker');
|
|
334
413
|
console.log(' ✓ Installer PostgreSQL + pgvector (si absent)');
|
|
335
|
-
console.log(' ✓ Télécharger
|
|
336
|
-
console.log(' ✓ Démarrer
|
|
337
|
-
console.log(' ✓
|
|
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');
|
|
338
420
|
console.log('');
|
|
339
421
|
|
|
340
422
|
// Step 1: Check Docker
|
|
@@ -343,26 +425,36 @@ async function main() {
|
|
|
343
425
|
return;
|
|
344
426
|
}
|
|
345
427
|
|
|
346
|
-
// Step 2: Setup
|
|
347
|
-
createEnvConfig();
|
|
348
|
-
|
|
349
|
-
// Step 3: Install PostgreSQL if needed
|
|
428
|
+
// Step 2: Setup PostgreSQL
|
|
350
429
|
await setupPostgreSQL();
|
|
351
430
|
|
|
352
|
-
// Step
|
|
431
|
+
// Step 3: Setup .env et .mcp.json
|
|
432
|
+
createEnvConfig();
|
|
433
|
+
|
|
434
|
+
// Step 4: Download infrastructure files
|
|
353
435
|
const downloaded = await setupInfrastructure();
|
|
354
436
|
|
|
355
|
-
// Step 5: Start
|
|
437
|
+
// Step 5: Start ALL services automatically
|
|
356
438
|
if (downloaded) {
|
|
357
|
-
await startInfrastructure();
|
|
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
|
+
}
|
|
358
444
|
}
|
|
359
445
|
|
|
360
|
-
// Step 6: Validate services
|
|
446
|
+
// Step 6: Validate ALL services
|
|
361
447
|
if (downloaded) {
|
|
362
|
-
await validateServices();
|
|
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
|
+
}
|
|
363
455
|
}
|
|
364
456
|
|
|
365
|
-
// Show summary
|
|
457
|
+
// Show final summary
|
|
366
458
|
showSummary();
|
|
367
459
|
}
|
|
368
460
|
|