overmind-mcp 2.0.0 → 2.0.1
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/CHANGELOG.md +339 -0
- package/DEPLOYMENT.md +418 -0
- package/README.md +103 -10
- package/SETUP_WINDOWS.md +362 -0
- package/SWARM_USAGE.md +444 -0
- package/docker-compose.overmind.yml +172 -0
- package/package.json +34 -11
- package/scripts/docker-manager.mjs +200 -0
- package/scripts/install-dependencies.mjs +283 -0
- package/scripts/postinstall.mjs +223 -0
- package/scripts/setup-overmind-db.mjs +199 -0
- package/scripts/setup-windows.js +264 -0
- package/scripts/setup.mjs +396 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
4
|
+
* SETUP WINDOWS SCRIPT
|
|
5
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
6
|
+
* Script d'installation automatique pour OverMind-MCP sur Windows
|
|
7
|
+
* avec PostgreSQL + pgvector existant en Docker.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* node scripts/setup-windows.js
|
|
11
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { execSync } from 'child_process';
|
|
15
|
+
import { existsSync, readFileSync, writeFileSync, copyFileSync } from 'fs';
|
|
16
|
+
import { join } from 'path';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
|
+
import { dirname } from 'path';
|
|
19
|
+
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
const projectRoot = join(__dirname, '..');
|
|
23
|
+
|
|
24
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
25
|
+
// UTILITIES
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
27
|
+
|
|
28
|
+
function runCommand(command, description) {
|
|
29
|
+
console.log(`\n🔧 ${description}`);
|
|
30
|
+
console.log(` $ ${command}`);
|
|
31
|
+
try {
|
|
32
|
+
execSync(command, { cwd: projectRoot, stdio: 'inherit' });
|
|
33
|
+
console.log(`✅ ${description} terminé`);
|
|
34
|
+
return true;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(`❌ Erreur: ${error.message}`);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function logSection(title) {
|
|
42
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
43
|
+
console.log(`║ ${title.padEnd(64)} ║`);
|
|
44
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
48
|
+
// CHECKS
|
|
49
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
50
|
+
|
|
51
|
+
function checkPrerequisites() {
|
|
52
|
+
logSection('VÉRIFICATION PRÉREQUIS');
|
|
53
|
+
|
|
54
|
+
// Check Node.js
|
|
55
|
+
try {
|
|
56
|
+
const nodeVersion = execSync('node --version', { encoding: 'utf8' }).trim();
|
|
57
|
+
console.log(`✅ Node.js: ${nodeVersion}`);
|
|
58
|
+
} catch {
|
|
59
|
+
console.error('❌ Node.js non trouvé. Installez Node.js 20+');
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Check pnpm
|
|
64
|
+
try {
|
|
65
|
+
const pnpmVersion = execSync('pnpm --version', { encoding: 'utf8' }).trim();
|
|
66
|
+
console.log(`✅ pnpm: ${pnpmVersion}`);
|
|
67
|
+
} catch {
|
|
68
|
+
console.error('❌ pnpm non trouvé. Installez pnpm:');
|
|
69
|
+
console.error(' npm install -g pnpm');
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Check Docker
|
|
74
|
+
try {
|
|
75
|
+
const dockerVersion = execSync('docker --version', { encoding: 'utf8' }).trim();
|
|
76
|
+
console.log(`✅ Docker: ${dockerVersion}`);
|
|
77
|
+
} catch {
|
|
78
|
+
console.error('❌ Docker non trouvé. Installez Docker Desktop:');
|
|
79
|
+
console.error(' https://www.docker.com/products/docker-desktop/');
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Check PostgreSQL container
|
|
84
|
+
try {
|
|
85
|
+
const pgContainers = execSync('docker ps --filter "name=postgres-pgvector" --format "{{.Names}}"', { encoding: 'utf8' }).trim();
|
|
86
|
+
if (pgContainers) {
|
|
87
|
+
console.log(`✅ PostgreSQL container: ${pgContainers}`);
|
|
88
|
+
} else {
|
|
89
|
+
console.error('❌ Container postgres-pgvector non trouvé');
|
|
90
|
+
console.error(' Assurez-vous que PostgreSQL + pgvector tourne en Docker');
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
} catch {
|
|
94
|
+
console.error('❌ Impossible de vérifier le container PostgreSQL');
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function checkEnvFile() {
|
|
102
|
+
logSection('VÉRIFICATION FICHIER .ENV');
|
|
103
|
+
|
|
104
|
+
const envPath = join(projectRoot, '.env');
|
|
105
|
+
const envExamplePath = join(projectRoot, '.env.example');
|
|
106
|
+
|
|
107
|
+
if (!existsSync(envPath)) {
|
|
108
|
+
console.log('ℹ️ .env non trouvé, création à partir de .env.example...');
|
|
109
|
+
if (existsSync(envExamplePath)) {
|
|
110
|
+
copyFileSync(envExamplePath, envPath);
|
|
111
|
+
console.log('✅ .env créé');
|
|
112
|
+
console.warn('⚠️ ÉDITEZ .env et changez:');
|
|
113
|
+
console.warn(' - POSTGRES_PASSWORD=votre_mot_de_passe');
|
|
114
|
+
console.warn(' - OVERMIND_EMBEDDING_KEY=votre_cle_api');
|
|
115
|
+
return false; // Arrêt pour permettre l'édition
|
|
116
|
+
} else {
|
|
117
|
+
console.error('❌ .env.example non trouvé');
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
console.log('✅ .env existe');
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
127
|
+
// SETUP STEPS
|
|
128
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
129
|
+
|
|
130
|
+
async function setupDatabase() {
|
|
131
|
+
logSection('INITIALISATION BASE DE DONNÉES');
|
|
132
|
+
|
|
133
|
+
return runCommand(
|
|
134
|
+
'node scripts/setup-overmind-db.js',
|
|
135
|
+
'Initialisation base OverMind'
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function startDockerServices() {
|
|
140
|
+
logSection('DÉMARRAGE SERVICES DOCKER');
|
|
141
|
+
|
|
142
|
+
return runCommand(
|
|
143
|
+
'docker-compose -f docker-compose.overmind.yml up -d',
|
|
144
|
+
'Démarrage RabbitMQ + Temporal'
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function buildProject() {
|
|
149
|
+
logSection('BUILD PROJET');
|
|
150
|
+
|
|
151
|
+
return runCommand(
|
|
152
|
+
'pnpm run build',
|
|
153
|
+
'Compilation TypeScript'
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function runTests() {
|
|
158
|
+
logSection('TESTS UNITAIRES');
|
|
159
|
+
|
|
160
|
+
return runCommand(
|
|
161
|
+
'pnpm run test -- --run',
|
|
162
|
+
'Exécution tests'
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
167
|
+
// MAIN
|
|
168
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
169
|
+
|
|
170
|
+
async function main() {
|
|
171
|
+
console.log('╔══════════════════════════════════════════════════════════════════╗');
|
|
172
|
+
console.log('║ ║');
|
|
173
|
+
console.log('║ OVERMIND-MCP: SETUP WINDOWS AUTOMATISÉ ║');
|
|
174
|
+
console.log('║ (PostgreSQL Existant + Docker) ║');
|
|
175
|
+
console.log('║ ║');
|
|
176
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
177
|
+
console.log('');
|
|
178
|
+
|
|
179
|
+
// Check prerequisites
|
|
180
|
+
if (!checkPrerequisites()) {
|
|
181
|
+
console.log('\n❌ PRÉREQUIS NON REMPLIS. Corrigez les problèmes ci-dessus et relancez.');
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Check .env file
|
|
186
|
+
const envReady = checkEnvFile();
|
|
187
|
+
if (!envReady) {
|
|
188
|
+
console.log('\n⏸️ SETUP EN PAUSE. Éditez .env avec vos credentials, puis relancez.');
|
|
189
|
+
console.log('\n Commande pour relancer:');
|
|
190
|
+
console.log(' node scripts/setup-windows.js');
|
|
191
|
+
process.exit(0);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Setup database
|
|
195
|
+
const dbSetup = await setupDatabase();
|
|
196
|
+
if (!dbSetup) {
|
|
197
|
+
console.log('\n❌ ERREUR INITIALISATION BASE DE DONNÉES');
|
|
198
|
+
process.exit(1);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Start Docker services
|
|
202
|
+
const dockerStarted = startDockerServices();
|
|
203
|
+
if (!dockerStarted) {
|
|
204
|
+
console.log('\n❌ ERREUR DÉMARRAGE SERVICES DOCKER');
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Build project
|
|
209
|
+
const projectBuilt = buildProject();
|
|
210
|
+
if (!projectBuilt) {
|
|
211
|
+
console.log('\n❌ ERREUR BUILD PROJET');
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Run tests
|
|
216
|
+
runTests();
|
|
217
|
+
|
|
218
|
+
// Success!
|
|
219
|
+
logSection('✅ SETUP TERMINÉ AVEC SUCCÈS');
|
|
220
|
+
|
|
221
|
+
console.log(`
|
|
222
|
+
🎉 OVERMIND-MCP EST PRÊT !
|
|
223
|
+
|
|
224
|
+
📋 SERVICES DÉMARRÉS:
|
|
225
|
+
✅ PostgreSQL (votre container existant)
|
|
226
|
+
✅ RabbitMQ (Message Broker)
|
|
227
|
+
✅ Temporal (Workflow Orchestrator)
|
|
228
|
+
✅ OverMind Agents (prêt à démarrer)
|
|
229
|
+
|
|
230
|
+
🌐 INTERFACES DISPONIBLES:
|
|
231
|
+
📊 RabbitMQ: http://localhost:15672
|
|
232
|
+
📈 Temporal: http://localhost:8088
|
|
233
|
+
🗄️ PostgreSQL: localhost:5432
|
|
234
|
+
|
|
235
|
+
🚀 POUR DÉMARRER OVERMIND:
|
|
236
|
+
pnpm run dev # Mode développement
|
|
237
|
+
pnpm run start # Mode production
|
|
238
|
+
|
|
239
|
+
📚 DOCUMENTATION:
|
|
240
|
+
- SETUP_WINDOWS.md (guide complet)
|
|
241
|
+
- DEPLOYMENT.md (déploiement avancé)
|
|
242
|
+
- SWARM_USAGE.md (utilisation Swarm)
|
|
243
|
+
|
|
244
|
+
💡 PREMIER TEST:
|
|
245
|
+
create_agent({
|
|
246
|
+
name: 'test-agent',
|
|
247
|
+
prompt: 'Tu es un agent de test',
|
|
248
|
+
runner: 'claude'
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
═════════════════════════════════════════════════════════════════════
|
|
252
|
+
`);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
256
|
+
// ENTRY POINT
|
|
257
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
258
|
+
|
|
259
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
260
|
+
main().catch((error) => {
|
|
261
|
+
console.error('\n❌ ERREUR FATALE:', error.message);
|
|
262
|
+
process.exit(1);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
4
|
+
* SETUP SCRIPT - Installation Automatique OverMind
|
|
5
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
6
|
+
* Script principal qui installe TOUTES les dépendances nécessaires à OverMind:
|
|
7
|
+
* - Docker (si pas présent)
|
|
8
|
+
* - PostgreSQL + pgvector (si pas présent)
|
|
9
|
+
* - RabbitMQ
|
|
10
|
+
* - Temporal
|
|
11
|
+
* - Configuration automatique
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* overmind-setup [--full]
|
|
15
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { execSync, spawn } from 'child_process';
|
|
19
|
+
import { copyFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
20
|
+
import { join } from 'path';
|
|
21
|
+
import { fileURLToPath } from 'url';
|
|
22
|
+
import { dirname } from 'path';
|
|
23
|
+
import { createInterface } from 'readline';
|
|
24
|
+
|
|
25
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
26
|
+
const __dirname = dirname(__filename);
|
|
27
|
+
const projectRoot = join(__dirname, '..');
|
|
28
|
+
const INSTALL_DIR = join(process.env.HOME || process.env.USERPROFILE || process.env.HOMEPATH, '.overmind');
|
|
29
|
+
|
|
30
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
31
|
+
// UTILS
|
|
32
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
33
|
+
|
|
34
|
+
function logSection(title) {
|
|
35
|
+
console.log('\n╔══════════════════════════════════════════════════════════════════╗');
|
|
36
|
+
console.log(`║ ${title.padEnd(64)} ║`);
|
|
37
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function runCommand(cmd, description) {
|
|
41
|
+
console.log(`\n🔧 ${description}`);
|
|
42
|
+
console.log(` $ ${cmd}`);
|
|
43
|
+
try {
|
|
44
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
45
|
+
console.log(`✅ ${description} terminé`);
|
|
46
|
+
return true;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(`❌ Erreur: ${error.message}`);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function runCommandAsync(cmd, description) {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
console.log(`\n🔧 ${description}`);
|
|
56
|
+
console.log(` $ ${cmd}`);
|
|
57
|
+
const child = spawn(cmd, { shell: true, stdio: 'inherit' });
|
|
58
|
+
|
|
59
|
+
child.on('close', (code) => {
|
|
60
|
+
if (code === 0) {
|
|
61
|
+
console.log(`✅ ${description} terminé`);
|
|
62
|
+
resolve(true);
|
|
63
|
+
} else {
|
|
64
|
+
console.error(`❌ Erreur (code ${code})`);
|
|
65
|
+
reject(new Error(`Command failed with code ${code}`));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
child.on('error', (err) => {
|
|
70
|
+
console.error('❌ Erreur:', err.message);
|
|
71
|
+
reject(err);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function promptYesNo(question) {
|
|
77
|
+
const rl = createInterface({
|
|
78
|
+
input: process.stdin,
|
|
79
|
+
output: process.stdout,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const answer = await new Promise((resolve) => {
|
|
83
|
+
rl.question(`${question} (y/N): `, (answer) => {
|
|
84
|
+
rl.close();
|
|
85
|
+
resolve(answer.toLowerCase().startsWith('y'));
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return answer;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
93
|
+
// CHECKS
|
|
94
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
95
|
+
|
|
96
|
+
function checkDocker() {
|
|
97
|
+
try {
|
|
98
|
+
execSync('docker --version', { stdio: 'pipe' });
|
|
99
|
+
return true;
|
|
100
|
+
} catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function checkPostgreSQL() {
|
|
106
|
+
try {
|
|
107
|
+
execSync('docker ps --filter "name=postgres" --format "{{.Names}}"', { stdio: 'pipe' });
|
|
108
|
+
return true;
|
|
109
|
+
} catch {
|
|
110
|
+
try {
|
|
111
|
+
execSync('psql --version', { stdio: 'pipe' });
|
|
112
|
+
return true;
|
|
113
|
+
} catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
120
|
+
// INSTALLATION STEPS
|
|
121
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
122
|
+
|
|
123
|
+
async function installDocker() {
|
|
124
|
+
logSection('INSTALLATION DOCKER');
|
|
125
|
+
|
|
126
|
+
if (checkDocker()) {
|
|
127
|
+
console.log('✅ Docker est déjà installé');
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log('ℹ️ Docker non trouvé.');
|
|
132
|
+
console.log('');
|
|
133
|
+
console.log('📥 Docker Desktop est requis pour OverMind-MCP:');
|
|
134
|
+
console.log(' - Windows: https://www.docker.com/products/docker-desktop/');
|
|
135
|
+
console.log(' - Mac: https://www.docker.com/products/docker-desktop/');
|
|
136
|
+
console.log('');
|
|
137
|
+
console.log('📋 Instructions:');
|
|
138
|
+
console.log(' 1. Téléchargez et installez Docker Desktop');
|
|
139
|
+
console.log(' 2. Démarrez Docker Desktop');
|
|
140
|
+
console.log(' 3. Relancez: overmind-setup --full');
|
|
141
|
+
console.log('');
|
|
142
|
+
|
|
143
|
+
const answer = await promptYesNo('Voulez-vous ouvrir le site de téléchargement maintenant ?');
|
|
144
|
+
if (answer) {
|
|
145
|
+
const url = process.platform === 'win32'
|
|
146
|
+
? 'https://www.docker.com/products/docker-desktop/'
|
|
147
|
+
: 'https://www.docker.com/products/docker-desktop/';
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
execSync(`start ${url}`, { stdio: 'inherit' });
|
|
151
|
+
console.log('✅ Navigateur ouvert. Attendez l\'installation de Docker.');
|
|
152
|
+
} catch {
|
|
153
|
+
console.log('⚠️ Impossible d\'ouvrir le navigateur automatiquement.');
|
|
154
|
+
console.log(` Ouvrez manuellement: ${url}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function installPostgreSQL() {
|
|
162
|
+
logSection('INSTALLATION POSTGRESQL + PGVECTOR');
|
|
163
|
+
|
|
164
|
+
if (checkPostgreSQL()) {
|
|
165
|
+
console.log('✅ PostgreSQL est déjà installé');
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
console.log('🐳 Installation PostgreSQL + pgvector en Docker...');
|
|
170
|
+
console.log('');
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
// Pull and start PostgreSQL container
|
|
174
|
+
console.log('📥 Téléchargement image pgvector/pgvector:pg16...');
|
|
175
|
+
execSync('docker pull pgvector/pgvector:pg16', { stdio: 'inherit' });
|
|
176
|
+
|
|
177
|
+
console.log('🚀 Démarrage container PostgreSQL...');
|
|
178
|
+
const runCommand = `docker run -d --name postgres-pgvector \\
|
|
179
|
+
-p 5432:5432 \\
|
|
180
|
+
-e POSTGRES_PASSWORD=overmind_temp_password_change_me \\
|
|
181
|
+
-e POSTGRES_USER=postgres \\
|
|
182
|
+
-v postgres_data:/var/lib/postgresql/data \\
|
|
183
|
+
--restart unless-stopped \\
|
|
184
|
+
pgvector/pgvector:pg16`;
|
|
185
|
+
|
|
186
|
+
await runCommandAsync(runCommand, 'Démarrage PostgreSQL');
|
|
187
|
+
|
|
188
|
+
// Wait for PostgreSQL to be ready
|
|
189
|
+
console.log('⏳ Attente démarrage PostgreSQL (30s)...');
|
|
190
|
+
await new Promise((resolve) => setTimeout(resolve, 30000));
|
|
191
|
+
|
|
192
|
+
// Verify pgvector
|
|
193
|
+
console.log('🔍 Vérification pgvector...');
|
|
194
|
+
await runCommandAsync(
|
|
195
|
+
'docker exec postgres-pgvector psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS vector;"',
|
|
196
|
+
'Activation pgvector'
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
console.log('✅ PostgreSQL + pgvector installés avec succès !');
|
|
200
|
+
return true;
|
|
201
|
+
|
|
202
|
+
} catch (error) {
|
|
203
|
+
console.error('❌ Erreur installation PostgreSQL:', error.message);
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function setupConfigurationFiles() {
|
|
209
|
+
logSection('CONFIGURATION OVERMIND');
|
|
210
|
+
|
|
211
|
+
// Create install directory
|
|
212
|
+
if (!existsSync(INSTALL_DIR)) {
|
|
213
|
+
mkdirSync(INSTALL_DIR, { recursive: true });
|
|
214
|
+
console.log('✅ Dossier créé:', INSTALL_DIR);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Copy docker-compose file
|
|
218
|
+
const dockerComposePath = join(projectRoot, 'docker-compose.overmind.yml');
|
|
219
|
+
const destComposePath = join(INSTALL_DIR, 'docker-compose.overmind.yml');
|
|
220
|
+
|
|
221
|
+
if (existsSync(dockerComposePath)) {
|
|
222
|
+
copyFileSync(dockerComposePath, destComposePath);
|
|
223
|
+
console.log('✅ docker-compose.overmind.yml copié');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Copy .env.example if .env doesn't exist
|
|
227
|
+
const envExamplePath = join(projectRoot, '.env.example');
|
|
228
|
+
const envPath = join(INSTALL_DIR, '.env');
|
|
229
|
+
|
|
230
|
+
if (!existsSync(envPath) && existsSync(envExamplePath)) {
|
|
231
|
+
copyFileSync(envExamplePath, envPath);
|
|
232
|
+
console.log('✅ .env créé (à éditer avec vos credentials)');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Copy docker-manager script
|
|
236
|
+
const dockerManagerPath = join(__dirname, 'docker-manager.js');
|
|
237
|
+
const destManagerPath = join(INSTALL_DIR, 'docker-manager.js');
|
|
238
|
+
|
|
239
|
+
copyFileSync(dockerManagerPath, destManagerPath);
|
|
240
|
+
console.log('✅ Scripts Docker installés');
|
|
241
|
+
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
async function startDockerServices() {
|
|
246
|
+
logSection('DÉMARRAGE SERVICES DOCKER');
|
|
247
|
+
|
|
248
|
+
const composeFile = join(INSTALL_DIR, 'docker-compose.overmind.yml');
|
|
249
|
+
|
|
250
|
+
console.log('🚀 Démarrage RabbitMQ + Temporal...');
|
|
251
|
+
try {
|
|
252
|
+
await runCommandAsync(
|
|
253
|
+
`docker-compose -f "${composeFile}" up -d`,
|
|
254
|
+
'Démarrage services'
|
|
255
|
+
);
|
|
256
|
+
console.log('✅ Services Docker démarrés');
|
|
257
|
+
console.log('');
|
|
258
|
+
console.log('🌐 Interfaces disponibles:');
|
|
259
|
+
console.log(' 📊 RabbitMQ: http://localhost:15672');
|
|
260
|
+
console.log(' 📈 Temporal: http://localhost:8088');
|
|
261
|
+
return true;
|
|
262
|
+
} catch (error) {
|
|
263
|
+
console.error('❌ Erreur démarrage Docker:', error.message);
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
async function createOvermindDatabase() {
|
|
269
|
+
logSection('CRÉATION BASE OVERMIND');
|
|
270
|
+
|
|
271
|
+
// Import and run setup-overmind-db.js
|
|
272
|
+
const setupDbPath = join(__dirname, 'setup-overmind-db.js');
|
|
273
|
+
|
|
274
|
+
try {
|
|
275
|
+
// Copy script to install dir
|
|
276
|
+
const destDbPath = join(INSTALL_DIR, 'setup-overmind-db.js');
|
|
277
|
+
copyFileSync(setupDbPath, destDbPath);
|
|
278
|
+
|
|
279
|
+
// Run it
|
|
280
|
+
await runCommandAsync(
|
|
281
|
+
`node "${destDbPath}"`,
|
|
282
|
+
'Initialisation DB OverMind'
|
|
283
|
+
);
|
|
284
|
+
return true;
|
|
285
|
+
} catch (error) {
|
|
286
|
+
console.error('❌ Erreur création DB:', error.message);
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
292
|
+
// MAIN
|
|
293
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
294
|
+
|
|
295
|
+
async function main() {
|
|
296
|
+
const args = process.argv.slice(2);
|
|
297
|
+
const isFull = args.includes('--full');
|
|
298
|
+
|
|
299
|
+
console.log('╔══════════════════════════════════════════════════════════════════╗');
|
|
300
|
+
console.log('║ ║');
|
|
301
|
+
console.log('║ 🧠 OVERMIND-MCP: SETUP AUTOMATISÉ COMPLET ║');
|
|
302
|
+
console.log('║ ║');
|
|
303
|
+
console.log('╚══════════════════════════════════════════════════════════════════╝');
|
|
304
|
+
console.log('');
|
|
305
|
+
|
|
306
|
+
if (!isFull) {
|
|
307
|
+
console.log('ℹ️ USAGE: overmind-setup [--full]');
|
|
308
|
+
console.log('');
|
|
309
|
+
console.log(' --full: Installe TOUTES les dépendances (Docker, PostgreSQL, etc.)');
|
|
310
|
+
console.log(' et configure OverMind automatiquement');
|
|
311
|
+
console.log('');
|
|
312
|
+
console.log(' Sans --full: Prépare juste les fichiers de configuration');
|
|
313
|
+
console.log('');
|
|
314
|
+
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Step 1: Check Docker
|
|
319
|
+
const hasDocker = checkDocker();
|
|
320
|
+
if (!hasDocker) {
|
|
321
|
+
const installed = await installDocker();
|
|
322
|
+
if (!installed) {
|
|
323
|
+
console.log('\n❌ SETUP ANNULÉ - Docker est requis pour le mode complet');
|
|
324
|
+
console.log(' Installez Docker Desktop et relancez: overmind-setup --full');
|
|
325
|
+
process.exit(1);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Step 2: Check PostgreSQL
|
|
330
|
+
const hasPostgreSQL = checkPostgreSQL();
|
|
331
|
+
if (!hasPostgreSQL) {
|
|
332
|
+
const installed = await installPostgreSQL();
|
|
333
|
+
if (!installed) {
|
|
334
|
+
console.log('\n❌ SETUP ANNULÉ - PostgreSQL est requis pour le mode complet');
|
|
335
|
+
process.exit(1);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Step 3: Setup configuration files
|
|
340
|
+
setupConfigurationFiles();
|
|
341
|
+
|
|
342
|
+
// Step 4: Start Docker services
|
|
343
|
+
const servicesStarted = await startDockerServices();
|
|
344
|
+
if (!servicesStarted) {
|
|
345
|
+
console.log('\n❌ SETUP ANNULÉ - Impossible de démarrer les services');
|
|
346
|
+
process.exit(1);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Step 5: Create OverMind database
|
|
350
|
+
const dbCreated = await createOvermindDatabase();
|
|
351
|
+
if (!dbCreated) {
|
|
352
|
+
console.log('\n❌ SETUP ANNULÉ - Impossible de créer la base OverMind');
|
|
353
|
+
process.exit(1);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Success!
|
|
357
|
+
logSection('✅ SETUP COMPLET TERMINÉ AVEC SUCCÈS');
|
|
358
|
+
|
|
359
|
+
console.log(`
|
|
360
|
+
🎉 OVERMIND-MCP EST PRÊT !
|
|
361
|
+
|
|
362
|
+
📋 SERVICES ACTIFS:
|
|
363
|
+
✅ PostgreSQL + pgvector (Vector DB 4096D)
|
|
364
|
+
✅ RabbitMQ (Message Broker)
|
|
365
|
+
✅ Temporal (Workflow Orchestrator)
|
|
366
|
+
✅ OverMind Agents (prêt à l'emploi)
|
|
367
|
+
|
|
368
|
+
🌐 INTERFACES:
|
|
369
|
+
📊 RabbitMQ Management: http://localhost:15672
|
|
370
|
+
📈 Temporal Web: http://localhost:8088
|
|
371
|
+
🗄️ PostgreSQL: localhost:5432
|
|
372
|
+
|
|
373
|
+
🚀 COMMANDES DISPONIBLES:
|
|
374
|
+
overmind create-agent --name expert --runner claude
|
|
375
|
+
overmind run-agent --runner claude --prompt "Analyse..."
|
|
376
|
+
overmind-infra up/down/status/logs
|
|
377
|
+
|
|
378
|
+
📚 DOCUMENTATION:
|
|
379
|
+
- https://deamondev888.github.io/overmind-mcp/
|
|
380
|
+
- https://github.com/DeamonDev888/overmind-mcp
|
|
381
|
+
- Discord: https://discord.gg/4AR82phtBz
|
|
382
|
+
|
|
383
|
+
💡 PREMIER TEST:
|
|
384
|
+
overmind create-agent --name test --runner claude --prompt "Test d'OverMind"
|
|
385
|
+
|
|
386
|
+
═══════════════════════════════════════════════════════════════════════
|
|
387
|
+
`);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Run main
|
|
391
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
392
|
+
main().catch((error) => {
|
|
393
|
+
console.error('\n❌ ERREUR FATALE:', error.message);
|
|
394
|
+
process.exit(1);
|
|
395
|
+
});
|
|
396
|
+
}
|