overmind-mcp 2.0.3 → 2.0.4
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/auto-install.mjs +327 -0
- package/scripts/postinstall.mjs +324 -143
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "overmind-mcp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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",
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
4
|
+
* OVERMIND-MCP - INSTALLATION AUTOMATIQUE (POST-INSTALL)
|
|
5
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
6
|
+
* Ce script est exécuté automatiquement après npm install -g
|
|
7
|
+
* Il installe et configure TOUT :
|
|
8
|
+
* - Docker Desktop (vérification)
|
|
9
|
+
* - PostgreSQL + pgvector (si absent)
|
|
10
|
+
* - Infrastructure complète
|
|
11
|
+
* - Invite l'utilisateur à voir les services dans Docker Desktop
|
|
12
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { execSync, spawn } from 'child_process';
|
|
16
|
+
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
17
|
+
import { join } from 'path';
|
|
18
|
+
import { fileURLToPath } from 'url';
|
|
19
|
+
import { dirname } from 'path';
|
|
20
|
+
import { createInterface } from 'readline';
|
|
21
|
+
|
|
22
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
+
const __dirname = dirname(__filename);
|
|
24
|
+
|
|
25
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
26
|
+
// CONFIG
|
|
27
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
28
|
+
|
|
29
|
+
const INSTALL_DIR = join(
|
|
30
|
+
process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH,
|
|
31
|
+
'.overmind'
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
35
|
+
// UTILS
|
|
36
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
37
|
+
|
|
38
|
+
function logSection(title) {
|
|
39
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
40
|
+
console.log(`║ ${title.padEnd(64)} ║`);
|
|
41
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function runCommand(cmd, options = {}) {
|
|
45
|
+
try {
|
|
46
|
+
return execSync(cmd, { stdio: 'pipe', encoding: 'utf8', ...options });
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function promptYesNo(question) {
|
|
53
|
+
const rl = createInterface({
|
|
54
|
+
input: process.stdin,
|
|
55
|
+
output: process.stdout,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return new Promise((resolve) => {
|
|
59
|
+
rl.question(`${question} (y/N): `, (answer) => {
|
|
60
|
+
rl.close();
|
|
61
|
+
resolve(answer.toLowerCase().startsWith('y'));
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function runCommandAsync(cmd, description) {
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
console.log(`🔧 ${description}`);
|
|
69
|
+
console.log(` $ ${cmd}`);
|
|
70
|
+
|
|
71
|
+
const child = spawn(cmd, { shell: true, stdio: 'inherit' });
|
|
72
|
+
|
|
73
|
+
child.on('close', (code) => {
|
|
74
|
+
if (code === 0) {
|
|
75
|
+
console.log(`✅ ${description} terminé`);
|
|
76
|
+
resolve(true);
|
|
77
|
+
} else {
|
|
78
|
+
console.error(`❌ Erreur (code ${code})`);
|
|
79
|
+
reject(new Error(`Command failed with code ${code}`));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
child.on('error', (err) => {
|
|
84
|
+
console.error('❌ Erreur:', err.message);
|
|
85
|
+
reject(err);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
91
|
+
// INSTALLATION STEPS
|
|
92
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
93
|
+
|
|
94
|
+
async function checkDocker() {
|
|
95
|
+
logSection('VÉRIFICATION DOCKER');
|
|
96
|
+
|
|
97
|
+
const version = runCommand('docker --version');
|
|
98
|
+
if (!version) {
|
|
99
|
+
console.log('❌ Docker non trouvé');
|
|
100
|
+
console.log('');
|
|
101
|
+
console.log('📥 Installation Docker requise:');
|
|
102
|
+
|
|
103
|
+
const platform = process.platform;
|
|
104
|
+
if (platform === 'win32') {
|
|
105
|
+
console.log(' Windows: https://www.docker.com/products/docker-desktop/');
|
|
106
|
+
} else if (platform === 'darwin') {
|
|
107
|
+
console.log(' macOS: https://www.docker.com/products/docker-desktop/');
|
|
108
|
+
} else {
|
|
109
|
+
console.log(' Linux: https://docs.docker.com/engine/install/');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const answer = await promptYesNo('Voulez-vous ouvrir le site de téléchargement ?');
|
|
113
|
+
if (answer) {
|
|
114
|
+
const url = 'https://www.docker.com/products/docker-desktop/';
|
|
115
|
+
const openCmd = process.platform === 'win32' ? 'start' :
|
|
116
|
+
process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
117
|
+
runCommand(`${openCmd} ${url}`, { stdio: 'ignore' });
|
|
118
|
+
console.log('✅ Navigateur ouvert. Installez Docker, puis relancez: npm install -g overmind-mcp');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
console.log('✅ Docker détecté:', version.trim());
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function setupInfrastructure() {
|
|
129
|
+
logSection('TÉLÉCHARGEMENT INFRASTRUCTURE');
|
|
130
|
+
|
|
131
|
+
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
132
|
+
|
|
133
|
+
console.log('📥 Téléchargement docker-compose.yml...');
|
|
134
|
+
|
|
135
|
+
const composeUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/docker-compose.yml';
|
|
136
|
+
const exportersUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/docker-compose.exporters.yml';
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
const composeData = runCommand(`curl -sL ${composeUrl}`);
|
|
140
|
+
if (composeData) {
|
|
141
|
+
writeFileSync(join(INSTALL_DIR, 'docker-compose.yml'), composeData);
|
|
142
|
+
console.log('✅ docker-compose.yml téléchargé');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const exportersData = runCommand(`curl -sL ${exportersUrl}`);
|
|
146
|
+
if (exportersData) {
|
|
147
|
+
writeFileSync(join(INSTALL_DIR, 'docker-compose.exporters.yml'), exportersData);
|
|
148
|
+
console.log('✅ docker-compose.exporters.yml téléchargé');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return true;
|
|
152
|
+
} catch (error) {
|
|
153
|
+
console.error('❌ Erreur téléchargement:', error.message);
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function startInfrastructure() {
|
|
159
|
+
logSection('DÉMARRAGE INFRASTRUCTURE DOCKER');
|
|
160
|
+
|
|
161
|
+
const composeFile = join(INSTALL_DIR, 'docker-compose.yml');
|
|
162
|
+
|
|
163
|
+
if (!existsSync(composeFile)) {
|
|
164
|
+
console.log('⚠️ docker-compose.yml non trouvé. Installation infrastructure skippée.');
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
try {
|
|
169
|
+
console.log('🚀 Démarrage des services...');
|
|
170
|
+
await runCommandAsync(
|
|
171
|
+
`cd "${INSTALL_DIR}" && docker-compose -f docker-compose.yml up -d`,
|
|
172
|
+
'Démarrage infrastructure'
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
console.log('');
|
|
176
|
+
console.log('⏳ Attente démarrage des services (15s)...');
|
|
177
|
+
await new Promise(resolve => setTimeout(resolve, 15000));
|
|
178
|
+
|
|
179
|
+
return true;
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error('❌ Erreur démarrage:', error.message);
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
async function validateServices() {
|
|
187
|
+
logSection('VALIDATION DES SERVICES');
|
|
188
|
+
|
|
189
|
+
console.log('🔍 Vérification des containers...');
|
|
190
|
+
console.log('');
|
|
191
|
+
|
|
192
|
+
const services = [
|
|
193
|
+
{ name: 'PostgreSQL', filter: 'postgres', check: 'pg_isready' },
|
|
194
|
+
{ name: 'RabbitMQ', filter: 'rabbitmq', check: null },
|
|
195
|
+
{ name: 'Temporal', filter: 'temporal', check: null },
|
|
196
|
+
{ name: 'Prometheus', filter: 'prometheus', check: null },
|
|
197
|
+
{ name: 'Grafana', filter: 'grafana', check: null },
|
|
198
|
+
{ name: 'Jaeger', filter: 'jaeger', check: null },
|
|
199
|
+
];
|
|
200
|
+
|
|
201
|
+
let allRunning = true;
|
|
202
|
+
|
|
203
|
+
for (const service of services) {
|
|
204
|
+
const containerName = runCommand(
|
|
205
|
+
`docker ps --filter "name=${service.filter}" --format "{{.Names}}"`,
|
|
206
|
+
{ stdio: 'pipe' }
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
if (containerName) {
|
|
210
|
+
const name = containerName.trim();
|
|
211
|
+
console.log(`✅ ${service.name}: ${name}`);
|
|
212
|
+
} else {
|
|
213
|
+
console.log(`❌ ${service.name}: Non trouvé`);
|
|
214
|
+
allRunning = false;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return allRunning;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async function createEnvConfig() {
|
|
222
|
+
const envFile = join(INSTALL_DIR, '.env');
|
|
223
|
+
|
|
224
|
+
if (!existsSync(envFile)) {
|
|
225
|
+
logSection('CRÉATION CONFIGURATION');
|
|
226
|
+
|
|
227
|
+
const envContent = `# OverMind-MCP Environment Configuration
|
|
228
|
+
# Généré automatiquement par npm install
|
|
229
|
+
|
|
230
|
+
# PostgreSQL
|
|
231
|
+
POSTGRES_HOST=localhost
|
|
232
|
+
POSTGRES_PORT=5432
|
|
233
|
+
POSTGRES_USER=postgres
|
|
234
|
+
POSTGRES_PASSWORD=overmind_temp_password_change_me
|
|
235
|
+
POSTGRES_DB=overmind
|
|
236
|
+
|
|
237
|
+
# OpenTelemetry (optionnel)
|
|
238
|
+
OTEL_ENABLED=false
|
|
239
|
+
|
|
240
|
+
# Workspace
|
|
241
|
+
OVERMIND_WORKSPACE=${INSTALL_DIR}
|
|
242
|
+
`;
|
|
243
|
+
|
|
244
|
+
writeFileSync(envFile, envContent);
|
|
245
|
+
console.log('✅ Configuration créée:', envFile);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function showSummary() {
|
|
250
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
251
|
+
console.log('║ ✅ INSTALLATION TERMINÉE ! ║');
|
|
252
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
253
|
+
console.log('');
|
|
254
|
+
console.log('📋 SERVICES DISPONIBLES:');
|
|
255
|
+
console.log('');
|
|
256
|
+
console.log('┌─────────────────────────────────────────────────────────────────┐');
|
|
257
|
+
console.log('│ Ouvrez Docker Desktop pour voir tous les containers │');
|
|
258
|
+
console.log('│ │');
|
|
259
|
+
console.log('│ URLs utiles: │');
|
|
260
|
+
console.log('│ • Prometheus: http://localhost:9090 │');
|
|
261
|
+
console.log('│ • Grafana: http://localhost:3000 (admin/admin) │');
|
|
262
|
+
console.log('│ • Jaeger: http://localhost:16686 │');
|
|
263
|
+
console.log('│ • RabbitMQ: http://localhost:15672 (guest/guest) │');
|
|
264
|
+
console.log('│ • Temporal: http://localhost:8233 │');
|
|
265
|
+
console.log('└─────────────────────────────────────────────────────────────────┘');
|
|
266
|
+
console.log('');
|
|
267
|
+
console.log('📚 DOCUMENTATION:');
|
|
268
|
+
console.log(' • https://github.com/DeamonDev888/overmind-mcp');
|
|
269
|
+
console.log(' • https://www.npmjs.com/package/overmind-mcp');
|
|
270
|
+
console.log('');
|
|
271
|
+
console.log('🎉 PROCHAINE ÉTAPE:');
|
|
272
|
+
console.log(' • Créez votre premier agent: overmind create-agent');
|
|
273
|
+
console.log(' • Ou utilisez: overmind-setup --full');
|
|
274
|
+
console.log('');
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
278
|
+
// MAIN
|
|
279
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
280
|
+
|
|
281
|
+
async function main() {
|
|
282
|
+
console.log('╔══════════════════════════════════════════════════════════════════╗');
|
|
283
|
+
console.log('║ ║');
|
|
284
|
+
console.log('║ 🚀 OVERMIND-MCP - INSTALLATION AUTOMATIQUE ║');
|
|
285
|
+
console.log('║ npm install -g overmind-mcp ║');
|
|
286
|
+
console.log('║ ║');
|
|
287
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
288
|
+
console.log('');
|
|
289
|
+
|
|
290
|
+
// Step 1: Check Docker
|
|
291
|
+
const dockerOk = await checkDocker();
|
|
292
|
+
if (!dockerOk) {
|
|
293
|
+
console.log('\n⚠️ Relancez après installation de Docker: npm install -g overmind-mcp');
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Step 2: Setup .env
|
|
298
|
+
await createEnvConfig();
|
|
299
|
+
|
|
300
|
+
// Step 3: Download docker-compose files
|
|
301
|
+
const downloaded = await setupInfrastructure();
|
|
302
|
+
if (!downloaded) {
|
|
303
|
+
console.log('\n⚠️ Impossible de télécharger l\'infrastructure. Continue en mode minimal.');
|
|
304
|
+
showSummary();
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Step 4: Start infrastructure
|
|
309
|
+
const started = await startInfrastructure();
|
|
310
|
+
if (!started) {
|
|
311
|
+
console.log('\n⚠️ Infrastructure non démarrée. Continue en mode minimal.');
|
|
312
|
+
showSummary();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Step 5: Validate services
|
|
317
|
+
await validateServices();
|
|
318
|
+
|
|
319
|
+
// Show summary
|
|
320
|
+
showSummary();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Run main
|
|
324
|
+
main().catch((error) => {
|
|
325
|
+
console.error('\n❌ ERREUR FATALE:', error.message);
|
|
326
|
+
process.exit(1);
|
|
327
|
+
});
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,192 +1,373 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
4
|
+
* OVERMIND-MCP - POST-INSTALL AUTOMATIQUE
|
|
5
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
6
|
+
* Script exécuté automatiquement après npm install -g overmind-mcp
|
|
7
|
+
* Installe et configure TOUT :
|
|
8
|
+
* - Vérifie Docker
|
|
9
|
+
* - Installe PostgreSQL + pgvector (si absent)
|
|
10
|
+
* - Télécharge et lance l'infrastructure Docker complète
|
|
11
|
+
* - Valide tous les services
|
|
12
|
+
* - Montre à l'utilisateur où voir les services dans Docker Desktop
|
|
13
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
6
14
|
*/
|
|
7
15
|
|
|
8
|
-
import { execSync } from 'child_process';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
16
|
+
import { execSync, spawn } from 'child_process';
|
|
17
|
+
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
18
|
+
import { join } from 'path';
|
|
11
19
|
import { fileURLToPath } from 'url';
|
|
20
|
+
import { dirname } from 'path';
|
|
12
21
|
|
|
13
22
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
23
|
const __dirname = dirname(__filename);
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
const INSTALL_DIR = join(
|
|
26
|
+
process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH,
|
|
27
|
+
'.overmind'
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
31
|
+
// CONFIG & COLORS
|
|
32
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
33
|
+
|
|
34
|
+
const COLORS = {
|
|
35
|
+
cyan: '\x1b[36m',
|
|
36
|
+
green: '\x1b[32m',
|
|
37
|
+
yellow: '\x1b[33m',
|
|
38
|
+
red: '\x1b[31m',
|
|
39
|
+
white: '\x1b[37m',
|
|
40
|
+
reset: '\x1b[0m'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function log(color, str) {
|
|
44
|
+
console.log(`${color}${str}${COLORS.reset}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function logSection(title) {
|
|
48
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
49
|
+
console.log(`║ ${title.padEnd(64)} ║`);
|
|
50
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function runCommand(cmd, options = {}) {
|
|
17
54
|
try {
|
|
18
|
-
|
|
19
|
-
console.log('[OK] Docker detecte: ' + version.split(',')[0]);
|
|
20
|
-
return true;
|
|
55
|
+
return execSync(cmd, { stdio: 'pipe', encoding: 'utf8', ...options });
|
|
21
56
|
} catch {
|
|
22
|
-
|
|
23
|
-
console.log(' -> Installez Docker Desktop: https://www.docker.com/products/docker-desktop/');
|
|
24
|
-
return false;
|
|
57
|
+
return null;
|
|
25
58
|
}
|
|
26
59
|
}
|
|
27
60
|
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
async function runCommandAsync(cmd, description) {
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
console.log(`🔧 ${description}`);
|
|
64
|
+
console.log(` $ ${cmd}`);
|
|
65
|
+
|
|
66
|
+
const child = spawn(cmd, { shell: true, stdio: 'inherit' });
|
|
67
|
+
|
|
68
|
+
child.on('close', (code) => {
|
|
69
|
+
if (code === 0) {
|
|
70
|
+
console.log(`✅ ${description} terminé`);
|
|
71
|
+
resolve(true);
|
|
72
|
+
} else {
|
|
73
|
+
console.error(`❌ Erreur (code ${code})`);
|
|
74
|
+
reject(new Error(`Command failed with code ${code}`));
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
child.on('error', (err) => {
|
|
79
|
+
console.error('❌ Erreur:', err.message);
|
|
80
|
+
reject(err);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
86
|
+
// INSTALLATION STEPS
|
|
87
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
88
|
+
|
|
89
|
+
async function checkDocker() {
|
|
90
|
+
logSection('VÉRIFICATION DOCKER');
|
|
91
|
+
|
|
92
|
+
const version = runCommand('docker --version');
|
|
93
|
+
if (!version) {
|
|
94
|
+
log(COLORS.red, '❌ Docker non trouvé');
|
|
95
|
+
console.log('');
|
|
96
|
+
log(COLORS.yellow, '📥 Installation Docker requise:');
|
|
97
|
+
|
|
98
|
+
const platform = process.platform;
|
|
99
|
+
if (platform === 'win32') {
|
|
100
|
+
console.log(' Windows: https://www.docker.com/products/docker-desktop/');
|
|
101
|
+
} else if (platform === 'darwin') {
|
|
102
|
+
console.log(' macOS: https://www.docker.com/products/docker-desktop/');
|
|
103
|
+
} else {
|
|
104
|
+
console.log(' Linux: https://docs.docker.com/engine/install/');
|
|
37
105
|
}
|
|
38
|
-
|
|
106
|
+
|
|
107
|
+
log(COLORS.cyan, '\n📥 Après installation de Docker, relancez: npm install -g overmind-mcp');
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
log(COLORS.green, '✅ Docker détecté: ' + version.trim());
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function setupPostgreSQL() {
|
|
116
|
+
logSection('INSTALLATION POSTGRESQL + PGVECTOR');
|
|
117
|
+
|
|
118
|
+
// Check if already exists
|
|
119
|
+
const existingContainer = runCommand(
|
|
120
|
+
'docker ps --filter "name=postgres-pgvector" --format "{{.Names}}"',
|
|
121
|
+
{ stdio: 'pipe' }
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
if (existingContainer) {
|
|
125
|
+
log(COLORS.green, '✅ PostgreSQL + pgvector déjà installé');
|
|
126
|
+
log(COLORS.cyan, ' Container: ' + existingContainer.trim());
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
log(COLORS.yellow, '📦 Installation PostgreSQL + pgvector...');
|
|
39
131
|
|
|
40
132
|
try {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
133
|
+
await runCommandAsync(
|
|
134
|
+
'docker pull pgvector/pgvector:pg16',
|
|
135
|
+
'Téléchargement image'
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
// Remove existing if stopped
|
|
139
|
+
runCommand('docker rm -f overmind-postgres-pgvector', { stdio: 'pipe' });
|
|
140
|
+
|
|
141
|
+
const runCmd = [
|
|
142
|
+
'docker', 'run', '-d',
|
|
143
|
+
'--name', 'overmind-postgres-pgvector',
|
|
144
|
+
'-p', '5432:5432',
|
|
145
|
+
'-e', 'POSTGRES_PASSWORD=overmind_temp_password_change_me',
|
|
146
|
+
'-e', 'POSTGRES_USER=postgres',
|
|
147
|
+
'-v', 'overmind_postgres_data:/var/lib/postgresql/data',
|
|
148
|
+
'--restart', 'unless-stopped',
|
|
149
|
+
'pgvector/pgvector:pg16'
|
|
150
|
+
].join(' ');
|
|
151
|
+
|
|
152
|
+
await runCommandAsync(runCmd, 'Démarrage PostgreSQL');
|
|
153
|
+
|
|
154
|
+
log(COLORS.cyan, '\n⏳ Attente démarrage PostgreSQL (20s)...');
|
|
155
|
+
await new Promise(resolve => setTimeout(resolve, 20000));
|
|
156
|
+
|
|
157
|
+
// Enable pgvector
|
|
158
|
+
await runCommandAsync(
|
|
159
|
+
`docker exec overmind-postgres-pgvector psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS vector;"`,
|
|
160
|
+
'Activation pgvector'
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
log(COLORS.green, '\n✅ PostgreSQL + pgvector installés !');
|
|
164
|
+
return true;
|
|
165
|
+
} catch (error) {
|
|
166
|
+
log(COLORS.red, '❌ Erreur installation PostgreSQL: ' + error.message);
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
49
169
|
}
|
|
50
170
|
|
|
51
|
-
function
|
|
171
|
+
async function setupInfrastructure() {
|
|
172
|
+
logSection('TÉLÉCHARGEMENT INFRASTRUCTURE DOCKER');
|
|
173
|
+
|
|
174
|
+
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
175
|
+
|
|
176
|
+
log(COLORS.yellow, '📥 Téléchargement docker-compose.yml...');
|
|
177
|
+
|
|
178
|
+
const composeUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/docker-compose.yml';
|
|
179
|
+
const exportersUrl = 'https://raw.githubusercontent.com/DeamonDev888/overmind-mcp/main/docker-compose.exporters.yml';
|
|
180
|
+
|
|
52
181
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
).trim();
|
|
58
|
-
if (r === '1') { console.log('[OK] pgvector installe (Docker)'); return true; }
|
|
59
|
-
} else {
|
|
60
|
-
try {
|
|
61
|
-
const r = execSync('pg_config --version', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
62
|
-
if (r.includes('pgvector')) { console.log('[OK] pgvector installe (natif)'); return true; }
|
|
63
|
-
} catch {}
|
|
64
|
-
try {
|
|
65
|
-
const r = execSync(
|
|
66
|
-
"psql -U postgres -t -c \"SELECT 1 FROM pg_extension WHERE extname='vector';\"",
|
|
67
|
-
{ encoding: 'utf8', stdio: 'pipe' }
|
|
68
|
-
).trim();
|
|
69
|
-
if (r === '1') { console.log('[OK] pgvector installe (natif)'); return true; }
|
|
70
|
-
} catch {}
|
|
182
|
+
const composeData = runCommand(`curl -sL ${composeUrl}`);
|
|
183
|
+
if (composeData) {
|
|
184
|
+
writeFileSync(join(INSTALL_DIR, 'docker-compose.yml'), composeData);
|
|
185
|
+
log(COLORS.green, '✅ docker-compose.yml téléchargé');
|
|
71
186
|
}
|
|
72
|
-
} catch {}
|
|
73
187
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
188
|
+
const exportersData = runCommand(`curl -sL ${exportersUrl}`);
|
|
189
|
+
if (exportersData) {
|
|
190
|
+
writeFileSync(join(INSTALL_DIR, 'docker-compose.exporters.yml'), exportersData);
|
|
191
|
+
log(COLORS.green, '✅ docker-compose.exporters.yml téléchargé');
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return true;
|
|
195
|
+
} catch (error) {
|
|
196
|
+
log(COLORS.red, '❌ Erreur téléchargement: ' + error.message);
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
77
199
|
}
|
|
78
200
|
|
|
79
|
-
function
|
|
201
|
+
async function startInfrastructure() {
|
|
202
|
+
logSection('DÉMARRAGE INFRASTRUCTURE COMPLÈTE');
|
|
203
|
+
|
|
204
|
+
const composeFile = join(INSTALL_DIR, 'docker-compose.yml');
|
|
205
|
+
|
|
206
|
+
if (!existsSync(composeFile)) {
|
|
207
|
+
log(COLORS.yellow, '⚠️ docker-compose.yml non trouvé. Mode minimal activé.');
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
|
|
80
211
|
try {
|
|
81
|
-
|
|
212
|
+
log(COLORS.yellow, '🚀 Démarrage des services Docker...');
|
|
213
|
+
await runCommandAsync(
|
|
214
|
+
`cd "${INSTALL_DIR}" && docker-compose -f docker-compose.yml up -d`,
|
|
215
|
+
'Démarrage infrastructure'
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
log(COLORS.cyan, '\n⏳ Attente démarrage des services (15s)...');
|
|
219
|
+
await new Promise(resolve => setTimeout(resolve, 15000));
|
|
220
|
+
|
|
82
221
|
return true;
|
|
83
|
-
} catch {
|
|
84
|
-
|
|
222
|
+
} catch (error) {
|
|
223
|
+
log(COLORS.red, '❌ Erreur démarrage: ' + error.message);
|
|
85
224
|
return false;
|
|
86
225
|
}
|
|
87
226
|
}
|
|
88
227
|
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
228
|
+
async function validateServices() {
|
|
229
|
+
logSection('VALIDATION DES SERVICES');
|
|
230
|
+
|
|
231
|
+
log(COLORS.yellow, '🔍 Vérification des containers...\n');
|
|
232
|
+
|
|
233
|
+
const services = [
|
|
234
|
+
{ name: 'PostgreSQL + pgvector', filter: 'postgres', color: COLORS.green },
|
|
235
|
+
{ name: 'RabbitMQ', filter: 'rabbitmq', color: COLORS.green },
|
|
236
|
+
{ name: 'Temporal', filter: 'temporal', color: COLORS.green },
|
|
237
|
+
{ name: 'Prometheus', filter: 'prometheus', color: COLORS.green },
|
|
238
|
+
{ name: 'Grafana', filter: 'grafana', color: COLORS.green },
|
|
239
|
+
{ name: 'Jaeger', filter: 'jaeger', color: COLORS.green },
|
|
240
|
+
];
|
|
241
|
+
|
|
242
|
+
let allRunning = true;
|
|
243
|
+
|
|
244
|
+
for (const service of services) {
|
|
245
|
+
const containerName = runCommand(
|
|
246
|
+
`docker ps --filter "name=${service.filter}" --format "{{.Names}}"`,
|
|
247
|
+
{ stdio: 'pipe' }
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
if (containerName) {
|
|
251
|
+
log(service.color, ` ✅ ${service.name}: ${containerName.trim()}`);
|
|
252
|
+
} else {
|
|
253
|
+
log(COLORS.red, ` ❌ ${service.name}: Non trouvé`);
|
|
254
|
+
allRunning = false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return allRunning;
|
|
93
259
|
}
|
|
94
260
|
|
|
95
|
-
function
|
|
96
|
-
|
|
97
|
-
console.log('================================================================');
|
|
98
|
-
console.log(' BRAIN OVERMIND-MCP v2.0.0 - INSTALLATION');
|
|
99
|
-
console.log('================================================================');
|
|
100
|
-
console.log('');
|
|
261
|
+
function createEnvConfig() {
|
|
262
|
+
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
101
263
|
|
|
102
|
-
|
|
103
|
-
console.log('');
|
|
264
|
+
const envFile = join(INSTALL_DIR, '.env');
|
|
104
265
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
detectNodeVersion();
|
|
266
|
+
if (!existsSync(envFile)) {
|
|
267
|
+
const envContent = `# OverMind-MCP Environment Configuration
|
|
268
|
+
# Généré automatiquement par npm install
|
|
109
269
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
|
114
276
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
console.log(' Commande: overmind-setup --full');
|
|
125
|
-
} else if (hasDocker) {
|
|
126
|
-
console.log(' [FAST] MODE PARTIEL (Docker uniquement)');
|
|
127
|
-
console.log('');
|
|
128
|
-
console.log(' OverMind installera automatiquement:');
|
|
129
|
-
bar('PostgreSQL + pgvector', true);
|
|
130
|
-
bar('RabbitMQ (Broker)', true);
|
|
131
|
-
bar('Temporal (Workflows)', true);
|
|
132
|
-
console.log('');
|
|
133
|
-
console.log(' Commande: overmind-setup --full');
|
|
134
|
-
} else {
|
|
135
|
-
console.log(' [OK] MODE SIMPLE (sans Docker)');
|
|
136
|
-
console.log('');
|
|
137
|
-
console.log(' OverMind fonctionne immediatement avec:');
|
|
138
|
-
bar('Agents IA (Claude, Gemini...)', true);
|
|
139
|
-
bar('Creation/Config agents', true);
|
|
140
|
-
bar('Execution taches complexes', true);
|
|
141
|
-
bar('Vector DB', false);
|
|
142
|
-
bar('Workflows Long-Running', false);
|
|
143
|
-
console.log('');
|
|
144
|
-
console.log(' Pour activer toutes les features:');
|
|
145
|
-
console.log(' 1. Installez Docker Desktop');
|
|
146
|
-
console.log(' 2. Relancez: overmind-setup --full');
|
|
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);
|
|
147
286
|
}
|
|
287
|
+
}
|
|
148
288
|
|
|
289
|
+
function showSummary() {
|
|
290
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
291
|
+
console.log('║' + ' '.repeat(64) + '║');
|
|
292
|
+
console.log('║' + COLORS.green + ' ✅ INSTALLATION TERMINÉE !' + COLORS.reset + ' '.repeat(33) + '║');
|
|
293
|
+
console.log('║' + ' '.repeat(64) + '║');
|
|
294
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
295
|
+
console.log('');
|
|
296
|
+
log(COLORS.yellow, '📋 SERVICES DISPONIBLES:');
|
|
297
|
+
console.log('');
|
|
298
|
+
console.log('┌─────────────────────────────────────────────────────────────────┐');
|
|
299
|
+
console.log('│ ' + COLORS.cyan + 'Ouvrez Docker Desktop pour voir tous les containers' + COLORS.reset + ' │');
|
|
300
|
+
console.log('│ │');
|
|
301
|
+
console.log('│ ' + COLORS.yellow + 'URLs utiles:' + COLORS.reset + ' │');
|
|
302
|
+
console.log('│ • Prometheus: ' + COLORS.cyan + 'http://localhost:9090' + COLORS.reset + ' │');
|
|
303
|
+
console.log('│ • Grafana: ' + COLORS.cyan + 'http://localhost:3000' + COLORS.reset + ' (admin/admin)' + ' │');
|
|
304
|
+
console.log('│ • Jaeger: ' + COLORS.cyan + 'http://localhost:16686' + COLORS.reset + ' │');
|
|
305
|
+
console.log('│ • RabbitMQ: ' + COLORS.cyan + 'http://localhost:15672' + COLORS.reset + ' (guest/guest)' + ' │');
|
|
306
|
+
console.log('│ • Temporal: ' + COLORS.cyan + 'http://localhost:8233' + COLORS.reset + ' │');
|
|
307
|
+
console.log('└─────────────────────────────────────────────────────────────────┘');
|
|
149
308
|
console.log('');
|
|
150
|
-
|
|
151
|
-
console.log('
|
|
152
|
-
console.log('
|
|
309
|
+
log(COLORS.yellow, '📚 DOCUMENTATION:');
|
|
310
|
+
console.log(' • https://github.com/DeamonDev888/overmind-mcp');
|
|
311
|
+
console.log(' • https://www.npmjs.com/package/overmind-mcp');
|
|
153
312
|
console.log('');
|
|
313
|
+
log(COLORS.yellow, '🎉 PROCHAINE ÉTAPE:');
|
|
314
|
+
console.log(' • Créez votre premier agent: overmind create-agent');
|
|
315
|
+
console.log(' • Ou listez les agents: overmind list-agents');
|
|
316
|
+
console.log('');
|
|
317
|
+
}
|
|
154
318
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
console.log('');
|
|
159
|
-
console.log(' Cette commande va:');
|
|
160
|
-
console.log(' - Installer PostgreSQL + pgvector en Docker');
|
|
161
|
-
console.log(' - Creer la base de donnees OverMind');
|
|
162
|
-
console.log(' - Demarrer RabbitMQ + Temporal');
|
|
163
|
-
console.log(' - Configurer les fichiers necessaires');
|
|
164
|
-
console.log('');
|
|
165
|
-
}
|
|
319
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
320
|
+
// MAIN
|
|
321
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
166
322
|
|
|
167
|
-
|
|
168
|
-
console.log('
|
|
169
|
-
console.log('
|
|
170
|
-
console.log('
|
|
323
|
+
async function main() {
|
|
324
|
+
console.log('╔══════════════════════════════════════════════════════════════════╗');
|
|
325
|
+
console.log('║' + ' '.repeat(64) + '║');
|
|
326
|
+
console.log('║' + COLORS.cyan + ' 🚀 OVERMIND-MCP - INSTALLATION AUTOMATIQUE' + COLORS.reset + ' '.repeat(25) + '║');
|
|
327
|
+
console.log('║' + ' '.repeat(64) + '║');
|
|
328
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
171
329
|
console.log('');
|
|
172
|
-
|
|
330
|
+
|
|
331
|
+
// Banner
|
|
332
|
+
console.log(COLORS.cyan + 'Ce script va:' + COLORS.reset);
|
|
333
|
+
console.log(' ✓ Vérifier Docker');
|
|
334
|
+
console.log(' ✓ Installer PostgreSQL + pgvector (si absent)');
|
|
335
|
+
console.log(' ✓ Télécharger l\'infrastructure Docker');
|
|
336
|
+
console.log(' ✓ Démarrer tous les services');
|
|
337
|
+
console.log(' ✓ Valider l\'installation');
|
|
173
338
|
console.log('');
|
|
174
339
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
} else {
|
|
180
|
-
console.log(' Mode Avance (avec Docker):');
|
|
181
|
-
console.log(' $ overmind-setup --full');
|
|
182
|
-
console.log(' $ overmind create-agent ...');
|
|
183
|
-
console.log(' $ overmind run-agent ...');
|
|
184
|
-
console.log(' $ overmind-infra up/down/status');
|
|
340
|
+
// Step 1: Check Docker
|
|
341
|
+
const dockerOk = await checkDocker();
|
|
342
|
+
if (!dockerOk) {
|
|
343
|
+
return;
|
|
185
344
|
}
|
|
186
345
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
346
|
+
// Step 2: Setup .env
|
|
347
|
+
createEnvConfig();
|
|
348
|
+
|
|
349
|
+
// Step 3: Install PostgreSQL if needed
|
|
350
|
+
await setupPostgreSQL();
|
|
351
|
+
|
|
352
|
+
// Step 4: Download infrastructure
|
|
353
|
+
const downloaded = await setupInfrastructure();
|
|
354
|
+
|
|
355
|
+
// Step 5: Start infrastructure
|
|
356
|
+
if (downloaded) {
|
|
357
|
+
await startInfrastructure();
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Step 6: Validate services
|
|
361
|
+
if (downloaded) {
|
|
362
|
+
await validateServices();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Show summary
|
|
366
|
+
showSummary();
|
|
190
367
|
}
|
|
191
368
|
|
|
192
|
-
main
|
|
369
|
+
// Run main
|
|
370
|
+
main().catch((error) => {
|
|
371
|
+
console.error('\n❌ ERREUR FATALE:', error.message);
|
|
372
|
+
process.exit(1);
|
|
373
|
+
});
|