overmind-mcp 2.0.0 → 2.0.2
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/README.md +145 -139
- package/dist/server.d.ts +40 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +104 -61
- package/dist/server.js.map +1 -1
- package/dist/services/ClaudeRunner.d.ts.map +1 -1
- package/dist/services/ClaudeRunner.js +68 -47
- package/dist/services/ClaudeRunner.js.map +1 -1
- package/docs/INDEX.md +144 -0
- package/docs/README.md +128 -0
- package/docs/api/prompt/Claude_code.md +74 -0
- package/docs/api/prompt/Kilo.md +74 -0
- package/docs/api/prompt/Kilo_Hermes.md +170 -0
- package/docs/api/prompt/Minimax4.md +96 -0
- package/docs/changelog/CHANGELOG.add.md +106 -0
- package/docs/changelog/CHANGELOG.md +339 -0
- package/docs/guides/DEPLOYMENT.md +418 -0
- package/docs/guides/SWARM_USAGE.md +444 -0
- package/docs/index.html +569 -0
- package/docs/library.html +239 -0
- package/docs/prompt.html +1212 -0
- package/docs/script.js +428 -0
- package/docs/styles.css +2816 -0
- package/docs/tools.md +794 -0
- package/package.json +26 -11
- package/scripts/docker-manager.mjs +200 -0
- package/scripts/install-dependencies.mjs +462 -0
- package/scripts/postinstall.mjs +192 -0
- package/scripts/setup-overmind-db.mjs +199 -0
- package/scripts/setup-windows.js +264 -0
- package/scripts/setup.mjs +394 -0
- package/scripts/uninstall.mjs +224 -0
- package/dist/tools/metadata.d.ts +0 -20
- package/dist/tools/metadata.d.ts.map +0 -1
- package/dist/tools/metadata.js +0 -246
- package/dist/tools/metadata.js.map +0 -1
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
4
|
+
* INSTALL-DEPENDENCIES SCRIPT
|
|
5
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
6
|
+
* Script cross-platform qui détecte et installe uniquement ce qui manque :
|
|
7
|
+
* - Docker Desktop / Docker Engine
|
|
8
|
+
* - PostgreSQL + pgvector (détecte si déjà en Docker)
|
|
9
|
+
*
|
|
10
|
+
* Supporte: Windows (Docker Desktop), Linux (Docker Engine), macOS (Docker Desktop)
|
|
11
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { execSync, spawn } from 'child_process';
|
|
15
|
+
import { existsSync } from 'fs';
|
|
16
|
+
import { join } from 'path';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
|
+
import { dirname } from 'path';
|
|
19
|
+
import { createInterface } from 'readline';
|
|
20
|
+
|
|
21
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
+
const __dirname = dirname(__filename);
|
|
23
|
+
|
|
24
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
25
|
+
// UTILS
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
27
|
+
|
|
28
|
+
function logSection(title) {
|
|
29
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
30
|
+
console.log(`║ ${title.padEnd(64)} ║`);
|
|
31
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function runCommand(cmd, options = {}) {
|
|
35
|
+
try {
|
|
36
|
+
return execSync(cmd, { stdio: 'pipe', encoding: 'utf8', ...options });
|
|
37
|
+
} catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function runCommandAsync(cmd, description) {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
console.log(`🔧 ${description}`);
|
|
45
|
+
console.log(` $ ${cmd}`);
|
|
46
|
+
|
|
47
|
+
const child = spawn(cmd, { shell: true, stdio: 'inherit' });
|
|
48
|
+
|
|
49
|
+
child.on('close', (code) => {
|
|
50
|
+
if (code === 0) {
|
|
51
|
+
console.log(`✅ ${description} terminé`);
|
|
52
|
+
resolve(true);
|
|
53
|
+
} else {
|
|
54
|
+
console.error(`❌ Erreur (code ${code})`);
|
|
55
|
+
reject(new Error(`Command failed with code ${code}`));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
child.on('error', (err) => {
|
|
60
|
+
console.error('❌ Erreur:', err.message);
|
|
61
|
+
reject(err);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function promptYesNo(question) {
|
|
67
|
+
const rl = createInterface({
|
|
68
|
+
input: process.stdin,
|
|
69
|
+
output: process.stdout,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
return new Promise((resolve) => {
|
|
73
|
+
rl.question(`${question} (y/N): `, (answer) => {
|
|
74
|
+
rl.close();
|
|
75
|
+
resolve(answer.toLowerCase().startsWith('y'));
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function openUrl(url) {
|
|
81
|
+
const platform = process.platform;
|
|
82
|
+
|
|
83
|
+
if (platform === 'win32') {
|
|
84
|
+
runCommand(`start ${url}`, { stdio: 'ignore' });
|
|
85
|
+
} else if (platform === 'darwin') {
|
|
86
|
+
runCommand(`open ${url}`, { stdio: 'ignore' });
|
|
87
|
+
} else {
|
|
88
|
+
runCommand(`xdg-open ${url}`, { stdio: 'ignore' });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
93
|
+
// DOCKER DETECTION
|
|
94
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
95
|
+
|
|
96
|
+
async function checkDocker() {
|
|
97
|
+
logSection('VÉRIFICATION DOCKER');
|
|
98
|
+
|
|
99
|
+
// Check if Docker is installed
|
|
100
|
+
const version = runCommand('docker --version');
|
|
101
|
+
if (!version) {
|
|
102
|
+
console.log('❌ Docker non trouvé');
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log('✅ Docker détecté:', version.trim());
|
|
107
|
+
|
|
108
|
+
// Detect Docker Desktop vs Docker Engine
|
|
109
|
+
const platform = process.platform;
|
|
110
|
+
|
|
111
|
+
if (platform === 'win32' || platform === 'darwin') {
|
|
112
|
+
// Windows/macOS: Check Docker Desktop
|
|
113
|
+
const desktopStatus = runCommand('docker info --format "{{.OperatingSystem}}"');
|
|
114
|
+
if (desktopStatus?.includes('Docker Desktop')) {
|
|
115
|
+
console.log('✅ Docker Desktop détecté');
|
|
116
|
+
return { type: 'desktop', platform };
|
|
117
|
+
}
|
|
118
|
+
} else if (platform === 'linux') {
|
|
119
|
+
// Linux: Docker Engine
|
|
120
|
+
console.log('✅ Docker Engine (Linux) détecté');
|
|
121
|
+
return { type: 'engine', platform };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return { type: 'unknown', platform };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function installDockerIfNeeded() {
|
|
128
|
+
const dockerInfo = await checkDocker();
|
|
129
|
+
|
|
130
|
+
if (dockerInfo) {
|
|
131
|
+
return dockerInfo;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
console.log('');
|
|
135
|
+
console.log('📥 Installation Docker requise:');
|
|
136
|
+
console.log(' • Windows: Docker Desktop for Windows');
|
|
137
|
+
console.log(' • macOS: Docker Desktop for Mac');
|
|
138
|
+
console.log(' • Linux: Docker Engine (apt/yum/dnf)');
|
|
139
|
+
console.log('');
|
|
140
|
+
|
|
141
|
+
const answer = await promptYesNo('Voulez-vous ouvrir le site de téléchargement ?');
|
|
142
|
+
if (answer) {
|
|
143
|
+
const url = 'https://www.docker.com/products/docker-desktop/';
|
|
144
|
+
openUrl(url);
|
|
145
|
+
console.log('✅ Navigateur ouvert. Installez Docker, puis relancez ce script.');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
152
|
+
// POSTGRESQL + PGVECTOR DETECTION & INSTALLATION
|
|
153
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
154
|
+
|
|
155
|
+
async function detectExistingPostgreSQL() {
|
|
156
|
+
logSection('DÉTECTION POSTGRESQL EXISTANT');
|
|
157
|
+
|
|
158
|
+
// 1. Check native PostgreSQL (psql command)
|
|
159
|
+
const nativePg = runCommand('psql --version');
|
|
160
|
+
if (nativePg) {
|
|
161
|
+
console.log('✅ PostgreSQL natif détecté:', nativePg.trim());
|
|
162
|
+
|
|
163
|
+
// Check if pgvector is installed
|
|
164
|
+
const pgvectorCheck = runCommand('psql -U postgres -t -c "SELECT extname FROM pg_extension WHERE extname = \'vector\';"');
|
|
165
|
+
if (pgvectorCheck?.includes('vector')) {
|
|
166
|
+
console.log('✅ pgvector est installé');
|
|
167
|
+
return { type: 'native', hasPgvector: true };
|
|
168
|
+
} else {
|
|
169
|
+
console.log('⚠️ pgvector NON installé (installation manuelle requise)');
|
|
170
|
+
return { type: 'native', hasPgvector: false };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// 2. Check Docker containers with pgvector (multiple detection methods)
|
|
175
|
+
console.log('🔍 Recherche containers PostgreSQL avec pgvector...');
|
|
176
|
+
|
|
177
|
+
// Method A: Check by image name (pgvector/pgvector)
|
|
178
|
+
let containers = runCommand('docker ps --filter "ancestor=pgvector/pgvector" --format "{{.Names}}"', {
|
|
179
|
+
stdio: 'pipe'
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Method B: Check all containers with "pgvector" or "postgres" in name
|
|
183
|
+
if (!containers) {
|
|
184
|
+
containers = runCommand('docker ps --format "{{.Names}}" | grep -E "(pgvector|postgres)"', {
|
|
185
|
+
stdio: 'pipe',
|
|
186
|
+
shell: true
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (containers) {
|
|
191
|
+
const containerList = containers.trim().split('\n').filter(Boolean);
|
|
192
|
+
console.log(`✅ ${containerList.length} container(s) PostgreSQL détecté(s):`);
|
|
193
|
+
containerList.forEach(name => console.log(` • ${name}`));
|
|
194
|
+
|
|
195
|
+
// Check each container for pgvector
|
|
196
|
+
for (const container of containerList) {
|
|
197
|
+
try {
|
|
198
|
+
const pgvectorCheck = runCommand(
|
|
199
|
+
`docker exec ${container} psql -U postgres -t -c "SELECT extname FROM pg_extension WHERE extname = 'vector';" 2>&1`,
|
|
200
|
+
{ stdio: 'pipe' }
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
if (pgvectorCheck?.includes('vector')) {
|
|
204
|
+
console.log(`✅ pgvector actif dans ${container}`);
|
|
205
|
+
return { type: 'docker', container, hasPgvector: true };
|
|
206
|
+
}
|
|
207
|
+
} catch {
|
|
208
|
+
// Container might not be accessible, try next
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
console.log('⚠️ Containers trouvés mais SANS pgvector installé');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// 3. Check for any PostgreSQL container (might not have pgvector)
|
|
216
|
+
const allContainers = runCommand('docker ps --format "{{.Names}}"', {
|
|
217
|
+
stdio: 'pipe'
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
if (allContainers) {
|
|
221
|
+
const pgContainers = allContainers
|
|
222
|
+
.trim()
|
|
223
|
+
.split('\n')
|
|
224
|
+
.filter(name => name.toLowerCase().includes('postgres') || name.toLowerCase().includes('pgvector'));
|
|
225
|
+
|
|
226
|
+
if (pgContainers.length > 0) {
|
|
227
|
+
console.log(`⚠️ ${pgContainers.length} container(s) PostgreSQL détecté(s) SANS pgvector:`);
|
|
228
|
+
pgContainers.forEach(name => console.log(` • ${name}`));
|
|
229
|
+
console.log('');
|
|
230
|
+
console.log('💡 Le script va créer un nouveau container dédié.');
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (genericContainers) {
|
|
235
|
+
const containerList = genericContainers.trim().split('\n').filter(Boolean);
|
|
236
|
+
console.log(`⚠️ ${containerList.length} container(s) PostgreSQL détecté(s) SANS pgvector:`);
|
|
237
|
+
containerList.forEach(name => console.log(` • ${name}`));
|
|
238
|
+
console.log('');
|
|
239
|
+
console.log('💡 Ces containers n\'ont PAS pgvector. Le script va créer un nouveau container dédié.');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
async function waitForPostgreSQL(containerName, maxWait = 60) {
|
|
246
|
+
console.log(`⏳ Attente démarrage PostgreSQL (max ${maxWait}s)...`);
|
|
247
|
+
|
|
248
|
+
for (let i = 0; i < maxWait; i++) {
|
|
249
|
+
try {
|
|
250
|
+
execSync(
|
|
251
|
+
`docker exec ${containerName} pg_isready -U postgres`,
|
|
252
|
+
{ stdio: 'pipe', encoding: 'utf8' }
|
|
253
|
+
);
|
|
254
|
+
console.log('✅ PostgreSQL prêt !');
|
|
255
|
+
return true;
|
|
256
|
+
} catch {
|
|
257
|
+
process.stdout.write('.');
|
|
258
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
console.log('');
|
|
263
|
+
console.log('❌ Timeout: PostgreSQL n\'a pas démarré à temps');
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
async function installPostgreSQLDocker() {
|
|
268
|
+
logSection('INSTALLATION POSTGRESQL + PGVECTOR (DOCKER)');
|
|
269
|
+
|
|
270
|
+
const containerName = 'overmind-postgres-pgvector';
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
// Pull image
|
|
274
|
+
console.log('📥 Téléchargement image pgvector/pgvector:pg16...');
|
|
275
|
+
await runCommandAsync(
|
|
276
|
+
'docker pull pgvector/pgvector:pg16',
|
|
277
|
+
'Téléchargement image'
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
// Remove existing container if present
|
|
281
|
+
try {
|
|
282
|
+
execSync(`docker inspect ${containerName}`, { stdio: 'pipe' });
|
|
283
|
+
console.log(`⚠️ Container ${containerName} existe déjà. Suppression...`);
|
|
284
|
+
execSync(`docker rm -f ${containerName}`, { stdio: 'pipe' });
|
|
285
|
+
} catch {
|
|
286
|
+
// Container doesn't exist, that's fine
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Create volume if doesn't exist
|
|
290
|
+
try {
|
|
291
|
+
execSync('docker volume create overmind_postgres_data', { stdio: 'pipe' });
|
|
292
|
+
} catch {
|
|
293
|
+
// Volume might already exist
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Run container
|
|
297
|
+
console.log('🚀 Démarrage container PostgreSQL...');
|
|
298
|
+
const runCommand = [
|
|
299
|
+
'docker', 'run', '-d',
|
|
300
|
+
'--name', containerName,
|
|
301
|
+
'-p', '5432:5432',
|
|
302
|
+
'-e', 'POSTGRES_PASSWORD=overmind_temp_password_change_me',
|
|
303
|
+
'-e', 'POSTGRES_USER=postgres',
|
|
304
|
+
'-v', 'overmind_postgres_data:/var/lib/postgresql/data',
|
|
305
|
+
'--restart', 'unless-stopped',
|
|
306
|
+
'pgvector/pgvector:pg16'
|
|
307
|
+
].join(' ');
|
|
308
|
+
|
|
309
|
+
await runCommandAsync(runCommand, 'Démarrage PostgreSQL');
|
|
310
|
+
|
|
311
|
+
// Wait for PostgreSQL to be ready
|
|
312
|
+
const ready = await waitForPostgreSQL(containerName);
|
|
313
|
+
if (!ready) {
|
|
314
|
+
throw new Error('PostgreSQL n\'a pas démarré');
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Test connection
|
|
318
|
+
console.log('🔍 Test connexion PostgreSQL...');
|
|
319
|
+
await runCommandAsync(
|
|
320
|
+
`docker exec ${containerName} psql -U postgres -c "SELECT version();"`,
|
|
321
|
+
'Test connexion'
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
// Enable pgvector
|
|
325
|
+
console.log('🔧 Activation extension pgvector...');
|
|
326
|
+
await runCommandAsync(
|
|
327
|
+
`docker exec ${containerName} psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS vector;"`,
|
|
328
|
+
'Activation pgvector'
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
// Verify pgvector
|
|
332
|
+
console.log('✅ Vérification pgvector...');
|
|
333
|
+
const result = runCommand(
|
|
334
|
+
`docker exec ${containerName} psql -U postgres -t -c "SELECT extname FROM pg_extension WHERE extname = 'vector';"`,
|
|
335
|
+
{ encoding: 'utf8', stdio: 'pipe' }
|
|
336
|
+
).trim();
|
|
337
|
+
|
|
338
|
+
if (result.includes('vector')) {
|
|
339
|
+
console.log('✅ pgvector installé avec succès !');
|
|
340
|
+
} else {
|
|
341
|
+
throw new Error('pgvector non trouvé');
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
console.log('');
|
|
345
|
+
console.log('🎉 PostgreSQL + pgvector installés !');
|
|
346
|
+
console.log('');
|
|
347
|
+
console.log('📋 Détails:');
|
|
348
|
+
console.log(` Container: ${containerName}`);
|
|
349
|
+
console.log(' Port: 5432');
|
|
350
|
+
console.log(' User: postgres');
|
|
351
|
+
console.log(' Password: overmind_temp_password_change_me (À CHANGER !)');
|
|
352
|
+
console.log(' Extension: vector (pgvector)');
|
|
353
|
+
|
|
354
|
+
return { type: 'docker', container: containerName, hasPgvector: true };
|
|
355
|
+
|
|
356
|
+
} catch (error) {
|
|
357
|
+
console.error('❌ Erreur installation PostgreSQL:', error.message);
|
|
358
|
+
console.error('');
|
|
359
|
+
console.log('💡 Solution manuelle:');
|
|
360
|
+
console.log(` docker run -d --name ${containerName} \\`);
|
|
361
|
+
console.log(' -p 5432:5432 \\');
|
|
362
|
+
console.log(' -e POSTGRES_PASSWORD=votre_pass \\');
|
|
363
|
+
console.log(' -e POSTGRES_USER=postgres \\');
|
|
364
|
+
console.log(' -v overmind_postgres_data:/var/lib/postgresql/data \\');
|
|
365
|
+
console.log(' --restart unless-stopped \\');
|
|
366
|
+
console.log(' pgvector/pgvector:pg16');
|
|
367
|
+
console.log('');
|
|
368
|
+
console.log('Ou en une ligne (Windows):');
|
|
369
|
+
console.log(` docker run -d --name ${containerName} -p 5432:5432 -e POSTGRES_PASSWORD=votre_pass -e POSTGRES_USER=postgres -v overmind_postgres_data:/var/lib/postgresql/data --restart unless-stopped pgvector/pgvector:pg16`);
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
375
|
+
// MAIN
|
|
376
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
377
|
+
|
|
378
|
+
async function main() {
|
|
379
|
+
console.log('╔══════════════════════════════════════════════════════════════════╗');
|
|
380
|
+
console.log('║ ║');
|
|
381
|
+
console.log('║ 🗄️️ INSTALLATION POSTGRESQL + PGVECTOR ║');
|
|
382
|
+
console.log('║ Détection & Installation Automatique ║');
|
|
383
|
+
console.log('║ ║');
|
|
384
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
385
|
+
console.log('');
|
|
386
|
+
|
|
387
|
+
// Step 1: Check/Install Docker
|
|
388
|
+
const dockerInfo = await installDockerIfNeeded();
|
|
389
|
+
if (!dockerInfo) {
|
|
390
|
+
console.log('\n⚠️ Relancez ce script après avoir installé Docker.');
|
|
391
|
+
process.exit(1);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
console.log('');
|
|
395
|
+
console.log(`📊 Plateforme: ${dockerInfo.type} (${dockerInfo.platform})`);
|
|
396
|
+
console.log('');
|
|
397
|
+
|
|
398
|
+
// Step 2: Detect existing PostgreSQL
|
|
399
|
+
const existingPg = await detectExistingPostgreSQL();
|
|
400
|
+
|
|
401
|
+
if (existingPg && existingPg.hasPgvector) {
|
|
402
|
+
console.log('');
|
|
403
|
+
console.log('✅ PostgreSQL + pgvector sont déjà installés !');
|
|
404
|
+
|
|
405
|
+
if (existingPg.type === 'docker') {
|
|
406
|
+
console.log(` Container: ${existingPg.container}`);
|
|
407
|
+
console.log(' Port: 5432');
|
|
408
|
+
console.log(' User: postgres');
|
|
409
|
+
console.log(' Extension: vector (pgvector)');
|
|
410
|
+
} else if (existingPg.type === 'native') {
|
|
411
|
+
console.log(' Installation native détectée');
|
|
412
|
+
console.log(' Extension: vector (pgvector)');
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
console.log('');
|
|
416
|
+
console.log('🎉 Rien à installer !');
|
|
417
|
+
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Step 3: Install PostgreSQL + pgvector
|
|
422
|
+
console.log('');
|
|
423
|
+
console.log('📦 Installation de PostgreSQL + pgvector requise...');
|
|
424
|
+
|
|
425
|
+
const installResult = await installPostgreSQLDocker();
|
|
426
|
+
if (!installResult) {
|
|
427
|
+
console.log('\n⚠️ Installation échouée. Vérifiez les erreurs ci-dessus.');
|
|
428
|
+
process.exit(1);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// Success
|
|
432
|
+
logSection('✅ INSTALLATION TERMINÉE');
|
|
433
|
+
|
|
434
|
+
console.log(`
|
|
435
|
+
🎉 PostgreSQL + pgvector sont prêts !
|
|
436
|
+
|
|
437
|
+
📋 PROCHAINE ÉTAPE:
|
|
438
|
+
→ Relancez: overmind-setup --full
|
|
439
|
+
Ou manuellement: overmind-setup
|
|
440
|
+
|
|
441
|
+
💡 RAPPEL:
|
|
442
|
+
• Container: ${installResult.container}
|
|
443
|
+
• Port: 5432
|
|
444
|
+
• User: postgres
|
|
445
|
+
• Password: overmind_temp_password_change_me (CHANGEZ-LE !)
|
|
446
|
+
• Extension: vector (pgvector)
|
|
447
|
+
|
|
448
|
+
═════════════════════════════════════════════════════════════════════
|
|
449
|
+
`);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Run main
|
|
453
|
+
// Check if this file is being run directly (not imported)
|
|
454
|
+
const modulePath = fileURLToPath(import.meta.url);
|
|
455
|
+
const isMainModule = process.argv[1] === modulePath;
|
|
456
|
+
|
|
457
|
+
if (isMainModule) {
|
|
458
|
+
main().catch((error) => {
|
|
459
|
+
console.error('\n❌ ERREUR FATALE:', error.message);
|
|
460
|
+
process.exit(1);
|
|
461
|
+
});
|
|
462
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* POSTINSTALL SCRIPT — OverMind-MCP
|
|
4
|
+
* Executeur apres `npm install -g overmind-mcp`
|
|
5
|
+
* Detecte l'environnement et affiche les prochaines etapes.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { execSync } from 'child_process';
|
|
9
|
+
import { platform } from 'os';
|
|
10
|
+
import { dirname } from 'path';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = dirname(__filename);
|
|
15
|
+
|
|
16
|
+
function detectDocker() {
|
|
17
|
+
try {
|
|
18
|
+
const version = execSync('docker --version', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
19
|
+
console.log('[OK] Docker detecte: ' + version.split(',')[0]);
|
|
20
|
+
return true;
|
|
21
|
+
} catch {
|
|
22
|
+
console.log('[ERR] Docker non trouve');
|
|
23
|
+
console.log(' -> Installez Docker Desktop: https://www.docker.com/products/docker-desktop/');
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function detectPostgreSQL() {
|
|
29
|
+
try {
|
|
30
|
+
const containers = execSync(
|
|
31
|
+
'docker ps --filter "name=postgres-pgvector" --format "{{.Names}}"',
|
|
32
|
+
{ encoding: 'utf8', stdio: 'pipe' }
|
|
33
|
+
).trim();
|
|
34
|
+
if (containers) {
|
|
35
|
+
console.log('[OK] PostgreSQL detecte (Docker): ' + containers);
|
|
36
|
+
return { hasPG: true, type: 'docker', name: containers };
|
|
37
|
+
}
|
|
38
|
+
} catch {}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
execSync('psql --version', { stdio: 'pipe' });
|
|
42
|
+
console.log('[OK] PostgreSQL detecte (natif)');
|
|
43
|
+
return { hasPG: true, type: 'native' };
|
|
44
|
+
} catch {}
|
|
45
|
+
|
|
46
|
+
console.log('[ERR] PostgreSQL non trouve');
|
|
47
|
+
console.log(' -> Installe par: overmind-setup --full');
|
|
48
|
+
return { hasPG: false };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function detectPgVector() {
|
|
52
|
+
try {
|
|
53
|
+
if (platform() === 'win32') {
|
|
54
|
+
const r = execSync(
|
|
55
|
+
"docker exec postgres-pgvector psql -U postgres -t -c \"SELECT 1 FROM pg_extension WHERE extname='vector';\"",
|
|
56
|
+
{ encoding: 'utf8', stdio: 'pipe' }
|
|
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 {}
|
|
71
|
+
}
|
|
72
|
+
} catch {}
|
|
73
|
+
|
|
74
|
+
console.log('[ERR] pgvector non trouve');
|
|
75
|
+
console.log(' -> Installe par: overmind-setup --full');
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function detectNodeVersion() {
|
|
80
|
+
try {
|
|
81
|
+
console.log('[OK] Node.js: ' + execSync('node --version', { encoding: 'utf8' }).trim());
|
|
82
|
+
return true;
|
|
83
|
+
} catch {
|
|
84
|
+
console.log('[ERR] Node.js non trouve');
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function bar(label, ok) {
|
|
90
|
+
const pad = (s) => (' ' + s).slice(-18);
|
|
91
|
+
const okStr = ok ? '[OK]' : '[ERR]';
|
|
92
|
+
console.log(' ' + okStr + ' ' + pad(label));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function main() {
|
|
96
|
+
console.log('');
|
|
97
|
+
console.log('================================================================');
|
|
98
|
+
console.log(' BRAIN OVERMIND-MCP v2.0.0 - INSTALLATION');
|
|
99
|
+
console.log('================================================================');
|
|
100
|
+
console.log('');
|
|
101
|
+
|
|
102
|
+
console.log('[CHECK] Detection de votre environnement...');
|
|
103
|
+
console.log('');
|
|
104
|
+
|
|
105
|
+
const hasDocker = detectDocker();
|
|
106
|
+
const pgInfo = detectPostgreSQL();
|
|
107
|
+
const hasPgVector = detectPgVector();
|
|
108
|
+
detectNodeVersion();
|
|
109
|
+
|
|
110
|
+
console.log('');
|
|
111
|
+
console.log('================================================================');
|
|
112
|
+
console.log(' MODE DETECTE');
|
|
113
|
+
console.log('================================================================');
|
|
114
|
+
|
|
115
|
+
if (hasDocker && pgInfo.hasPG && hasPgVector) {
|
|
116
|
+
console.log(' [GO] MODE COMPLET (Docker + PostgreSQL + pgvector)');
|
|
117
|
+
console.log('');
|
|
118
|
+
console.log(' OverMind fonctionne avec TOUTES les features:');
|
|
119
|
+
bar('Swarm Orchestration', true);
|
|
120
|
+
bar('Workflows Long-Running', true);
|
|
121
|
+
bar('Vector DB (4096D)', true);
|
|
122
|
+
bar('Observabilite complete', true);
|
|
123
|
+
console.log('');
|
|
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');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
console.log('');
|
|
150
|
+
console.log('================================================================');
|
|
151
|
+
console.log(' PROCHAINES ETAPES');
|
|
152
|
+
console.log('================================================================');
|
|
153
|
+
console.log('');
|
|
154
|
+
|
|
155
|
+
if (!pgInfo.hasPG || !hasPgVector) {
|
|
156
|
+
console.log(' Etape 1: Installer les dependances manquantes');
|
|
157
|
+
console.log(' -> overmind-setup --full');
|
|
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
|
+
}
|
|
166
|
+
|
|
167
|
+
console.log(' DOCUMENTATION:');
|
|
168
|
+
console.log(' -> https://deamondev888.github.io/overmind-mcp/');
|
|
169
|
+
console.log(' -> https://github.com/DeamonDev888/overmind-mcp');
|
|
170
|
+
console.log(' -> Discord: https://discord.gg/4AR82phtBz');
|
|
171
|
+
console.log('');
|
|
172
|
+
console.log(' UTILISATION RAPIDE:');
|
|
173
|
+
console.log('');
|
|
174
|
+
|
|
175
|
+
if (!hasDocker) {
|
|
176
|
+
console.log(' Mode Simple (sans Docker):');
|
|
177
|
+
console.log(' $ overmind create-agent --name expert --runner claude --prompt "Tu es un expert..."');
|
|
178
|
+
console.log(' $ overmind run-agent --runner claude --prompt "Analyse ce code..."');
|
|
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');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
console.log('');
|
|
188
|
+
console.log('================================================================');
|
|
189
|
+
console.log('');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
main();
|