overmind-mcp 2.3.1 → 2.3.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/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/orchestration/dispatcher.d.ts +3 -3
- package/dist/lib/orchestration/dispatcher.d.ts.map +1 -1
- package/dist/lib/orchestration/dispatcher.js +1 -56
- package/dist/lib/orchestration/dispatcher.js.map +1 -1
- package/dist/lib/telemetry.d.ts +17 -5
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js +20 -65
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/services/ClaudeRunner.d.ts.map +1 -1
- package/dist/services/ClaudeRunner.js.map +1 -1
- package/dist/services/GeminiRunner.d.ts.map +1 -1
- package/dist/services/GeminiRunner.js.map +1 -1
- package/dist/services/KiloRunner.d.ts.map +1 -1
- package/dist/services/KiloRunner.js.map +1 -1
- package/dist/tools/run_agents_parallel.d.ts +3 -3
- package/package.json +1 -12
- package/scripts/auto-install.mjs +0 -5
- package/scripts/uninstall.mjs +2 -15
- package/dist/bin/rabbitmq-worker.d.ts +0 -2
- package/dist/bin/rabbitmq-worker.d.ts.map +0 -1
- package/dist/bin/rabbitmq-worker.js +0 -63
- package/dist/bin/rabbitmq-worker.js.map +0 -1
- package/dist/bin/temporal-worker.d.ts +0 -2
- package/dist/bin/temporal-worker.d.ts.map +0 -1
- package/dist/bin/temporal-worker.js +0 -24
- package/dist/bin/temporal-worker.js.map +0 -1
- package/dist/lib/broker/rabbitmq.d.ts +0 -28
- package/dist/lib/broker/rabbitmq.d.ts.map +0 -1
- package/dist/lib/broker/rabbitmq.js +0 -67
- package/dist/lib/broker/rabbitmq.js.map +0 -1
- package/dist/lib/broker/rabbitmqDispatch.d.ts +0 -23
- package/dist/lib/broker/rabbitmqDispatch.d.ts.map +0 -1
- package/dist/lib/broker/rabbitmqDispatch.js +0 -77
- package/dist/lib/broker/rabbitmqDispatch.js.map +0 -1
- package/dist/lib/workflow/temporal/activities.d.ts +0 -15
- package/dist/lib/workflow/temporal/activities.d.ts.map +0 -1
- package/dist/lib/workflow/temporal/activities.js +0 -18
- package/dist/lib/workflow/temporal/activities.js.map +0 -1
- package/dist/lib/workflow/temporal/client.d.ts +0 -8
- package/dist/lib/workflow/temporal/client.d.ts.map +0 -1
- package/dist/lib/workflow/temporal/client.js +0 -48
- package/dist/lib/workflow/temporal/client.js.map +0 -1
- package/dist/lib/workflow/temporal/dispatch.d.ts +0 -13
- package/dist/lib/workflow/temporal/dispatch.d.ts.map +0 -1
- package/dist/lib/workflow/temporal/dispatch.js +0 -19
- package/dist/lib/workflow/temporal/dispatch.js.map +0 -1
- package/dist/lib/workflow/temporal/workflows.d.ts +0 -31
- package/dist/lib/workflow/temporal/workflows.d.ts.map +0 -1
- package/dist/lib/workflow/temporal/workflows.js +0 -79
- package/dist/lib/workflow/temporal/workflows.js.map +0 -1
- package/docs/ASYNC_AGENT_INTEGRATION.md +0 -311
- package/docs/INDEX.md +0 -149
- package/docs/tools.md +0 -819
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { proxyActivities, defineSignal, defineQuery, setHandler, condition } from '@temporalio/workflow';
|
|
2
|
-
const activities = proxyActivities({
|
|
3
|
-
startToCloseTimeout: '15 minutes',
|
|
4
|
-
retry: {
|
|
5
|
-
maximumAttempts: 2,
|
|
6
|
-
},
|
|
7
|
-
});
|
|
8
|
-
export async function orchestrateAgentsWorkflow(agents) {
|
|
9
|
-
return Promise.all(agents.map((agent) => activities.runAgentActivity({
|
|
10
|
-
runner: agent.runner,
|
|
11
|
-
prompt: agent.prompt,
|
|
12
|
-
agentName: agent.agentName,
|
|
13
|
-
model: agent.model,
|
|
14
|
-
path: agent.path,
|
|
15
|
-
})));
|
|
16
|
-
}
|
|
17
|
-
// Signals pour contrôle externe
|
|
18
|
-
const cancelSignal = defineSignal('cancel');
|
|
19
|
-
const pauseSignal = defineSignal('pause');
|
|
20
|
-
const resumeSignal = defineSignal('resume');
|
|
21
|
-
// Query pour état en temps réel
|
|
22
|
-
const stateQuery = defineQuery('state');
|
|
23
|
-
export async function longRunningWorkflow(input) {
|
|
24
|
-
const { batches } = input;
|
|
25
|
-
const state = {
|
|
26
|
-
totalBatches: batches.length,
|
|
27
|
-
completedBatches: 0,
|
|
28
|
-
failedBatches: 0,
|
|
29
|
-
errors: [],
|
|
30
|
-
};
|
|
31
|
-
let cancelled = false;
|
|
32
|
-
let paused = false;
|
|
33
|
-
// Gestionnaires de signaux
|
|
34
|
-
setHandler(cancelSignal, () => {
|
|
35
|
-
cancelled = true;
|
|
36
|
-
});
|
|
37
|
-
setHandler(pauseSignal, () => {
|
|
38
|
-
paused = true;
|
|
39
|
-
});
|
|
40
|
-
setHandler(resumeSignal, () => {
|
|
41
|
-
paused = false;
|
|
42
|
-
});
|
|
43
|
-
setHandler(stateQuery, () => state);
|
|
44
|
-
// Exécuter les batches avec parallélisme limitée
|
|
45
|
-
for (let i = 0; i < batches.length; i++) {
|
|
46
|
-
if (cancelled) {
|
|
47
|
-
state.errors.push('Workflow annulé par signal externe');
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
// Attendre si paused
|
|
51
|
-
await condition(() => !paused);
|
|
52
|
-
const batch = batches[i];
|
|
53
|
-
state.currentBatch = batch.id;
|
|
54
|
-
batch.status = 'running';
|
|
55
|
-
batch.startedAt = Date.now();
|
|
56
|
-
try {
|
|
57
|
-
const results = await Promise.all(batch.tasks.map((task) => activities.runAgentActivity({
|
|
58
|
-
runner: task.runner,
|
|
59
|
-
prompt: task.prompt,
|
|
60
|
-
agentName: task.agentName,
|
|
61
|
-
model: task.model,
|
|
62
|
-
path: task.path,
|
|
63
|
-
})));
|
|
64
|
-
batch.status = 'completed';
|
|
65
|
-
batch.completedAt = Date.now();
|
|
66
|
-
batch.results = results;
|
|
67
|
-
state.completedBatches++;
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
batch.status = 'failed';
|
|
71
|
-
batch.completedAt = Date.now();
|
|
72
|
-
batch.errors = [error instanceof Error ? error.message : String(error)];
|
|
73
|
-
state.failedBatches++;
|
|
74
|
-
state.errors.push(batch.errors[0]);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
state.currentBatch = undefined;
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=workflows.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../../src/lib/workflow/temporal/workflows.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
# OverMind Async Agent Integration — Process Registry & PID Tracking
|
|
2
|
-
|
|
3
|
-
> **Problème résolu** : Les agents IA sont invoked en async via MCP, mais le seul lien avec le processus fils est le `sessionId` (généré par le runner, opaque pour OverMind). Si le processus parent meurt, le `sessionId` est perdu et le child process devient orphelin.
|
|
4
|
-
>
|
|
5
|
-
> **Solution** : Un **Process Registry** qui stocke le mapping `pid ↔ sessionId ↔ agentName`, persistant dans `sessions.json`, permettant de :
|
|
6
|
-
> - Se rattacher à un agent en cours via son PID
|
|
7
|
-
> - Vérifier si un agent est encore vivant
|
|
8
|
-
> - Tuer un agent par son PID
|
|
9
|
-
> - Streamer output en temps réel
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 1. Architecture
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
┌──────────────────────────────────────────────────────────────┐
|
|
17
|
-
│ MCP Tool: run_agent() (async, non-blocking) │
|
|
18
|
-
│ │
|
|
19
|
-
│ 1. Spawn child process (claude/kilo/gemini/etc.) │
|
|
20
|
-
│ 2. Register { pid, sessionId, agentName, runner, ts } │
|
|
21
|
-
│ 3. Return immediately with { sessionId, pid } │
|
|
22
|
-
│ → Client can poll / attach to PID │
|
|
23
|
-
│ │
|
|
24
|
-
│ ┌──────────────────┐ ┌──────────────────────────────┐ │
|
|
25
|
-
│ │ Process Registry │◄──│ child.on('data') │ │
|
|
26
|
-
│ │ (sessions.json) │ │ → buffers output │ │
|
|
27
|
-
│ │ │ │ → checks liveliness │ │
|
|
28
|
-
│ │ { pid, sessionId,│ └──────────────────────────────┘ │
|
|
29
|
-
│ │ agentName, │ │
|
|
30
|
-
│ │ runner, status,│ ┌──────────────────────────────┐ │
|
|
31
|
-
│ │ startedAt } │ │ MCP Tool: get_agent_status() │ │
|
|
32
|
-
│ └──────────────────┘ │ → returns live output │ │
|
|
33
|
-
│ │ → pid / alive / output so far │ │
|
|
34
|
-
│ └──────────────────────────────┘ │
|
|
35
|
-
└──────────────────────────────────────────────────────────────┘
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 2. Sessions JSON — Nouveau Format
|
|
41
|
-
|
|
42
|
-
**Avant** (sessions.json) :
|
|
43
|
-
```json
|
|
44
|
-
{
|
|
45
|
-
"kilo:sniper_analyst": { "id": "sess_abc123", "ts": 1746892800000 }
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
**Après** (sessions.json + process registry) :
|
|
50
|
-
```json
|
|
51
|
-
{
|
|
52
|
-
"kilo:sniper_analyst": {
|
|
53
|
-
"id": "sess_abc123",
|
|
54
|
-
"ts": 1746892800000,
|
|
55
|
-
"pid": 12345,
|
|
56
|
-
"status": "running",
|
|
57
|
-
"outputBuffer": ""
|
|
58
|
-
},
|
|
59
|
-
"claude:planner": {
|
|
60
|
-
"id": "sess_def456",
|
|
61
|
-
"ts": 1746892900000,
|
|
62
|
-
"pid": 67890,
|
|
63
|
-
"status": "running",
|
|
64
|
-
"outputBuffer": "Thinking...\n"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Le champ `status` peut être :
|
|
70
|
-
- `running` — processus actif, PID valide
|
|
71
|
-
- `done` — terminé avec succès (garde le last output pour retrieval)
|
|
72
|
-
- `failed` — terminé avec erreur
|
|
73
|
-
- `orphaned` — le parent a crash mais le child tourne encore
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## 3. Runner Changes — Spawn & Register
|
|
78
|
-
|
|
79
|
-
Chaque runner (Claude, Kilo, Gemini, Hermes, etc.) doit :
|
|
80
|
-
|
|
81
|
-
1. **Stocker le PID** dès le `spawn()` :
|
|
82
|
-
```typescript
|
|
83
|
-
const child = spawn(command, args, options);
|
|
84
|
-
// Immediately register
|
|
85
|
-
await registerProcess(child.pid, {
|
|
86
|
-
sessionId: undefined, // filled when runner gives us sessionId
|
|
87
|
-
agentName,
|
|
88
|
-
runner,
|
|
89
|
-
startedAt: Date.now(),
|
|
90
|
-
status: 'running',
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
2. **Mettre à jour avec le sessionId** dès qu'il est reçu :
|
|
95
|
-
```typescript
|
|
96
|
-
child.stdout?.on('data', (d) => {
|
|
97
|
-
const chunk = d.toString();
|
|
98
|
-
outputBuffer += chunk;
|
|
99
|
-
// Si le sessionId arrive pour la première fois
|
|
100
|
-
if (sessionId && !currentSessionId) {
|
|
101
|
-
currentSessionId = sessionId;
|
|
102
|
-
await updateProcessSession(sessionId, child.pid);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
3. **Marquer `done/failed`** à `child.on('close')` :
|
|
108
|
-
```typescript
|
|
109
|
-
child.on('close', async (code) => {
|
|
110
|
-
await updateProcessStatus(child.pid, code === 0 ? 'done' : 'failed');
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
4. **Cleanup à la terminaison** :
|
|
115
|
-
```typescript
|
|
116
|
-
// Supprimer après 1h ( TTL ) ou sur explicit delete
|
|
117
|
-
await unregisterProcess(pid);
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## 4. Nouvelles Fonctions Registry
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
// ─── Register a new running process ───────────────────────────
|
|
126
|
-
/**
|
|
127
|
-
* Called immediately after spawn(). Records the PID before the sessionId
|
|
128
|
-
* is known (sessionId arrives later from stdout).
|
|
129
|
-
*/
|
|
130
|
-
export async function registerProcess(
|
|
131
|
-
pid: number,
|
|
132
|
-
meta: {
|
|
133
|
-
agentName: string;
|
|
134
|
-
runner: string;
|
|
135
|
-
startedAt: number;
|
|
136
|
-
configPath?: string;
|
|
137
|
-
},
|
|
138
|
-
): Promise<void> { ... }
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Called when the runner emits a sessionId for the first time.
|
|
142
|
-
* Links sessionId ↔ pid in the registry.
|
|
143
|
-
*/
|
|
144
|
-
export async function linkSessionToPid(
|
|
145
|
-
sessionId: string,
|
|
146
|
-
pid: number,
|
|
147
|
-
configPath?: string,
|
|
148
|
-
): Promise<void> { ... }
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Update output buffer for live streaming.
|
|
152
|
-
*/
|
|
153
|
-
export async function appendOutput(
|
|
154
|
-
pid: number,
|
|
155
|
-
chunk: string,
|
|
156
|
-
configPath?: string,
|
|
157
|
-
): Promise<void> { ... }
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Get current status + output buffer for a process.
|
|
161
|
-
*/
|
|
162
|
-
export async function getProcessStatus(
|
|
163
|
-
agentName: string,
|
|
164
|
-
runner?: string,
|
|
165
|
-
configPath?: string,
|
|
166
|
-
): Promise<ProcessStatus | null> { ... }
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Kill a running agent by PID (Windows: taskkill /F /T /PID; Unix: SIGKILL).
|
|
170
|
-
*/
|
|
171
|
-
export async function killAgent(
|
|
172
|
-
agentName: string,
|
|
173
|
-
runner?: string,
|
|
174
|
-
configPath?: string,
|
|
175
|
-
): Promise<boolean> { ... }
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Unregister (cleanup) a process entry.
|
|
179
|
-
*/
|
|
180
|
-
export async function unregisterProcess(
|
|
181
|
-
pid: number,
|
|
182
|
-
configPath?: string,
|
|
183
|
-
): Promise<void> { ... }
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## 5. TTL & Cleanup
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
const PROCESS_TTL_MS = 60 * 60 * 1000; // 1 hour after 'done'/'failed'
|
|
192
|
-
const ORPHAN_CHECK_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
|
193
|
-
|
|
194
|
-
// On startup, scan for:
|
|
195
|
-
// 1. 'running' entries where the PID no longer exists → mark 'orphaned'
|
|
196
|
-
// 2. 'done'/'failed' entries older than PROCESS_TTL_MS → unregister
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## 6. Nouveaux Outils MCP
|
|
202
|
-
|
|
203
|
-
### `get_agent_status`
|
|
204
|
-
```typescript
|
|
205
|
-
{
|
|
206
|
-
agentName: string;
|
|
207
|
-
runner?: string; // defaults to 'claude' if omitted
|
|
208
|
-
}
|
|
209
|
-
// Returns:
|
|
210
|
-
// { status, pid, outputBuffer, startedAt, sessionId }
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### `stream_agent_output`
|
|
214
|
-
```typescript
|
|
215
|
-
{
|
|
216
|
-
agentName: string;
|
|
217
|
-
runner?: string;
|
|
218
|
-
sinceTimestamp?: number; // only return output after this ts
|
|
219
|
-
}
|
|
220
|
-
// Returns:
|
|
221
|
-
// { output: string, status, isComplete: boolean }
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### `kill_agent`
|
|
225
|
-
```typescript
|
|
226
|
-
{
|
|
227
|
-
agentName: string;
|
|
228
|
-
runner?: string;
|
|
229
|
-
}
|
|
230
|
-
// Returns:
|
|
231
|
-
// { killed: boolean, pid: number }
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### `wait_agent`
|
|
235
|
-
```typescript
|
|
236
|
-
{
|
|
237
|
-
agentName: string;
|
|
238
|
-
runner?: string;
|
|
239
|
-
timeoutMs?: number; // default: 900000 (15 min)
|
|
240
|
-
}
|
|
241
|
-
// Polls until status !== 'running', returns final result
|
|
242
|
-
// Returns:
|
|
243
|
-
// { status, result, exitCode }
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## 7. Flux Complet — Async Agent Lifecycle
|
|
249
|
-
|
|
250
|
-
```
|
|
251
|
-
Client OverMind MCP Runner
|
|
252
|
-
│ │ │
|
|
253
|
-
│ run_agent() │ │
|
|
254
|
-
│─────────────────────────►│ │
|
|
255
|
-
│ │ spawn(child) │
|
|
256
|
-
│ │───────────────────────────►│
|
|
257
|
-
│ │ registerProcess(pid) │
|
|
258
|
-
│ │ Return { sessionId, pid } │
|
|
259
|
-
│ { sessionId, pid } │ │
|
|
260
|
-
│◄──────────────────────────│ │
|
|
261
|
-
│ │ │
|
|
262
|
-
│ get_agent_status() │ │
|
|
263
|
-
│─────────────────────────►│ │
|
|
264
|
-
│ │ getProcessStatus() │
|
|
265
|
-
│ { status, outputBuffer }│ │
|
|
266
|
-
│◄──────────────────────────│ │
|
|
267
|
-
│ │ stdout.on('data') │
|
|
268
|
-
│ │◄──────────────────────────│
|
|
269
|
-
│ │ appendOutput(pid, chunk) │
|
|
270
|
-
│ │ │
|
|
271
|
-
│ stream_agent_output() │ │
|
|
272
|
-
│─────────────────────────►│ │
|
|
273
|
-
│ { output, status } │ │
|
|
274
|
-
│◄──────────────────────────│ │
|
|
275
|
-
│ │ child.on('close') │
|
|
276
|
-
│ │◄──────────────────────────│
|
|
277
|
-
│ │ updateProcessStatus(done) │
|
|
278
|
-
│ │ │
|
|
279
|
-
│ wait_agent() │ │
|
|
280
|
-
│─────────────────────────►│ │
|
|
281
|
-
│ Polls until done │ │
|
|
282
|
-
│ { status, result } │ │
|
|
283
|
-
│◄──────────────────────────│ │
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## 8. Backward Compatibility
|
|
289
|
-
|
|
290
|
-
- Les champs existants (`id`, `ts`) dans `sessions.json` ne changent pas
|
|
291
|
-
- `status`, `pid`, `outputBuffer` sont **ajoutés** (optionnels)
|
|
292
|
-
- Le `sessionId` reste le même — les outils existants (`autoResume`) continuent de fonctionner
|
|
293
|
-
- Si `pid` n'existe pas dans une entrée (sessions anciennes), le status est déduit de `ts` :
|
|
294
|
-
- `ts` < 30 jours + pas de `pid` → `done` (legacy)
|
|
295
|
-
- `ts` récent + pas de `pid` → `running` (legacy, mais incertain)
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
## 9. Implémentation Minimale — Checklist
|
|
300
|
-
|
|
301
|
-
- [ ] `src/lib/processRegistry.ts` — nouvelles fonctions (register, link, append, status, kill, unregister)
|
|
302
|
-
- [ ] `src/lib/sessions.ts` — ajout champs `pid`, `status`, `outputBuffer`
|
|
303
|
-
- [ ] Chaque runner (8 fichiers) — ajouter `registerProcess()` après `spawn()`
|
|
304
|
-
- [ ] Chaque runner — ajouter `appendOutput()` dans `stdout.on('data')`
|
|
305
|
-
- [ ] Chaque runner — ajouter `updateProcessStatus()` dans `child.on('close')`
|
|
306
|
-
- [ ] `src/tools/get_agent_status.ts` — nouvel outil MCP
|
|
307
|
-
- [ ] `src/tools/stream_agent_output.ts` — nouvel outil MCP
|
|
308
|
-
- [ ] `src/tools/kill_agent.ts` — nouvel outil MCP
|
|
309
|
-
- [ ] `src/tools/wait_agent.ts` — nouvel outil MCP
|
|
310
|
-
- [ ] `server.ts` — register les 4 nouveaux outils
|
|
311
|
-
- [ ] Tests dans `src/__tests__/processRegistry.test.ts`
|
package/docs/INDEX.md
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
# Documentation OverMind-MCP
|
|
2
|
-
|
|
3
|
-
Bienvenue dans la documentation centralisée d'OverMind-MCP.
|
|
4
|
-
|
|
5
|
-
> **Note** : Le site web cyberpunk avec animations est disponible dans ce dossier. Ce fichier INDEX.md sert de table des matières pour la documentation technique.
|
|
6
|
-
|
|
7
|
-
## 📑 Structure
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Workflow/
|
|
11
|
-
├── dock../docker/docker-compose.yml # Stack principale (9 services)
|
|
12
|
-
├── docker-compose.exporters.yml # Exporters métriques
|
|
13
|
-
├── scripts/ # Scripts setup/gestion
|
|
14
|
-
│ ├── setup.mjs
|
|
15
|
-
│ ├── install-dependencies.mjs
|
|
16
|
-
│ └── docker-manager.mjs
|
|
17
|
-
│
|
|
18
|
-
└── docs/ # Documentation
|
|
19
|
-
├── index.html # Site web cyberpunk
|
|
20
|
-
├── INDEX.md # Ce fichier (table des matières)
|
|
21
|
-
├── guides/ # Guides utilisateur
|
|
22
|
-
│ ├── README.md # Guide principal
|
|
23
|
-
│ ├── DEPLOYMENT.md # Guide déploiement
|
|
24
|
-
│ └── SWARM_USAGE.md # Guide Swarm
|
|
25
|
-
├── api/ # Documentation API
|
|
26
|
-
│ ├── prompt/ # Prompts système
|
|
27
|
-
│ └── tools.md # Référence outils
|
|
28
|
-
└── changelog/ # Historique versions
|
|
29
|
-
├── CHANGELOG.md
|
|
30
|
-
└── CHANGELOG.add.md
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 🚀 Par où commencer ?
|
|
34
|
-
|
|
35
|
-
1. **Nouveau utilisateur ?** → Commencez par [`guides/README.md`](./guides/README.md)
|
|
36
|
-
2. **Veut déployer en production ?** → Voir [`guides/DEPLOYMENT.md`](./guides/DEPLOYMENT.md)
|
|
37
|
-
3. **Intéressé par le Swarm ?** → Lire [`guides/SWARM_USAGE.md`](./guides/SWARM_USAGE.md)
|
|
38
|
-
4. **Besoin de la référence API ?** → Consulter [`api/tools.md`](./api/tools.md)
|
|
39
|
-
|
|
40
|
-
## 📚 Guides Utilisateur
|
|
41
|
-
|
|
42
|
-
### [`guides/README.md`](./guides/README.md)
|
|
43
|
-
Guide principal d'utilisation :
|
|
44
|
-
- Installation et setup
|
|
45
|
-
- Configuration des agents
|
|
46
|
-
- Utilisation des runners
|
|
47
|
-
- Exemples pratiques
|
|
48
|
-
|
|
49
|
-
### [`guides/DEPLOYMENT.md`](./guides/DEPLOYMENT.md)
|
|
50
|
-
Guide complet de déploiement :
|
|
51
|
-
- Prérequis système
|
|
52
|
-
- Configuration Docker Compose
|
|
53
|
-
- Setup infrastructure (PostgreSQL, RabbitMQ, Temporal)
|
|
54
|
-
- Sécurité et maintenance
|
|
55
|
-
- Monitoring avec Prometheus/Grafana
|
|
56
|
-
|
|
57
|
-
### [`guides/SWARM_USAGE.md`](./guides/SWARM_USAGE.md)
|
|
58
|
-
Guide d'orchestration Swarm :
|
|
59
|
-
- Configuration du swarm
|
|
60
|
-
- Allocation dynamique de tâches
|
|
61
|
-
- Workflows long-running
|
|
62
|
-
- Exemples concrets
|
|
63
|
-
- Monitoring et debug
|
|
64
|
-
|
|
65
|
-
## 🏗️ Infrastructure
|
|
66
|
-
|
|
67
|
-
### Docker Compose
|
|
68
|
-
- **[`../dock../docker/docker-compose.yml`](../dock../docker/docker-compose.yml)** - Stack principale (9 services)
|
|
69
|
-
- RabbitMQ (Message Broker)
|
|
70
|
-
- Temporal (Workflow Orchestrator)
|
|
71
|
-
- PostgreSQL + pgvector (Vector DB)
|
|
72
|
-
- Redis (Cache)
|
|
73
|
-
- Prometheus (Metrics)
|
|
74
|
-
- Grafana (Dashboards)
|
|
75
|
-
- Jaeger (Tracing)
|
|
76
|
-
- OpenTelemetry Collector
|
|
77
|
-
- Node Exporter
|
|
78
|
-
|
|
79
|
-
- **[`../docker-compose.exporters.yml`](../docker-compose.exporters.yml)** - Exporters de métriques
|
|
80
|
-
- RabbitMQ Exporter
|
|
81
|
-
- PostgreSQL Exporter
|
|
82
|
-
- Redis Exporter
|
|
83
|
-
|
|
84
|
-
### Scripts Setup
|
|
85
|
-
Voir [`../scripts/`](../scripts/) :
|
|
86
|
-
- `setup.mjs` - Setup interactif complet
|
|
87
|
-
- `install-dependencies.mjs` - Installation Docker/PostgreSQL
|
|
88
|
-
- `docker-manager.mjs` - Gestion infrastructure (up/down/logs/status)
|
|
89
|
-
- `postinstall.mjs` - Post-installation NPM
|
|
90
|
-
|
|
91
|
-
## 🔌 API & Référence
|
|
92
|
-
|
|
93
|
-
### [`api/prompt/`](./api/prompt/)
|
|
94
|
-
Documentation des prompts système pour chaque runner :
|
|
95
|
-
- Claude Code
|
|
96
|
-
- Kilo (code, architect, ask, debug)
|
|
97
|
-
- Hermes
|
|
98
|
-
- Minimax 4
|
|
99
|
-
|
|
100
|
-
## 🛠️ Reference des Outils
|
|
101
|
-
|
|
102
|
-
### [`agent_control.md`](./agent_control.md)
|
|
103
|
-
Contrôle unifié du cycle de vie des agents OverMind via le Process Registry.
|
|
104
|
-
- Remplace les 4 outils précédents : get_agent_status, stream_agent_output, kill_agent, wait_agent
|
|
105
|
-
- Patterns async : fire & forget, blocking wait, orchestration séquentielle, fan-out parallèle
|
|
106
|
-
- Dashboard temps réel par PID
|
|
107
|
-
- Lookup par sessionId, timestamp, PID
|
|
108
|
-
- Codes d'erreur structurés
|
|
109
|
-
|
|
110
|
-
### [`api/tools.md`](./api/tools.md)
|
|
111
|
-
Référence complète des outils MCP (14 outils)
|
|
112
|
-
|
|
113
|
-
## 📝 Changelog
|
|
114
|
-
|
|
115
|
-
### [`changelog/CHANGELOG.md`](./changelog/CHANGELOG.md)
|
|
116
|
-
Historique complet des versions :
|
|
117
|
-
- Toutes les versions de 1.x à 2.0.0
|
|
118
|
-
- Features, bug fixes, breaking changes
|
|
119
|
-
- Notes de migration
|
|
120
|
-
|
|
121
|
-
### [`changelog/CHANGELOG.add.md`](./changelog/CHANGELOG.add.md)
|
|
122
|
-
Notes détaillées de la v2.0.0 :
|
|
123
|
-
- Swarm Orchestration
|
|
124
|
-
- Long-Running Workflows
|
|
125
|
-
- Infrastructure Docker complète
|
|
126
|
-
- Observabilité de niveau production
|
|
127
|
-
|
|
128
|
-
## 🔍 Recherche Rapide
|
|
129
|
-
|
|
130
|
-
### Je veux...
|
|
131
|
-
|
|
132
|
-
- **Installer OverMind** → [`guides/README.md`](./guides/README.md)
|
|
133
|
-
- **Déployer en production** → [`guides/DEPLOYMENT.md`](./guides/DEPLOYMENT.md)
|
|
134
|
-
- **Créer un agent** → [`guides/README.md`](./guides/README.md)
|
|
135
|
-
- **Utiliser le Swarm** → [`guides/SWARM_USAGE.md`](./guides/SWARM_USAGE.md)
|
|
136
|
-
- **Voir la référence API** → [`tools.md`](./tools.md)
|
|
137
|
-
- **Setup Docker** → [`../dock../docker/docker-compose.yml`](../dock../docker/docker-compose.yml)
|
|
138
|
-
- **Voir les nouveautés** → [`changelog/CHANGELOG.md`](./changelog/CHANGELOG.md)
|
|
139
|
-
- **Debug un problème** → [`guides/DEPLOYMENT.md`](./guides/DEPLOYMENT.md) (section Monitoring)
|
|
140
|
-
|
|
141
|
-
## 📖 Ressources Externes
|
|
142
|
-
|
|
143
|
-
- **GitHub** : https://github.com/DeamonDev888/overmind-mcp
|
|
144
|
-
- **Discord** : https://discord.gg/4AR82phtBz
|
|
145
|
-
- **Site Web** : https://deamondev888.github.io/overmind-mcp/
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
**Retour au README principal** : [`../README.md`](../README.md)
|