claude-flow 3.5.40 → 3.5.42
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/v3/@claude-flow/cli/dist/src/commands/hive-mind.js +25 -25
- package/v3/@claude-flow/cli/dist/src/mcp-server.js +2 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/hive-mind-tools.js +39 -12
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +11 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +66 -0
- package/v3/@claude-flow/cli/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.42",
|
|
4
4
|
"description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -71,36 +71,36 @@ ${workerTypes.map(type => `• ${type}: ${workerGroups[type].length} agents`).jo
|
|
|
71
71
|
🔧 AVAILABLE MCP TOOLS FOR HIVE MIND COORDINATION:
|
|
72
72
|
|
|
73
73
|
1️⃣ **COLLECTIVE INTELLIGENCE**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
mcp__ruflo__hive-mind_consensus - Democratic decision making
|
|
75
|
+
mcp__ruflo__hive-mind_memory - Share knowledge across the hive
|
|
76
|
+
mcp__ruflo__hive-mind_broadcast - Broadcast to all workers
|
|
77
|
+
mcp__ruflo__neural_patterns - Neural pattern recognition
|
|
78
78
|
|
|
79
79
|
2️⃣ **QUEEN COORDINATION**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
mcp__ruflo__hive-mind_status - Monitor swarm health
|
|
81
|
+
mcp__ruflo__task_create - Create and delegate tasks
|
|
82
|
+
mcp__ruflo__coordination_orchestrate - Orchestrate task distribution
|
|
83
|
+
mcp__ruflo__agent_spawn - Spawn additional workers
|
|
84
84
|
|
|
85
85
|
3️⃣ **WORKER MANAGEMENT**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
mcp__ruflo__agent_list - List all active agents
|
|
87
|
+
mcp__ruflo__agent_status - Check agent status
|
|
88
|
+
mcp__ruflo__agent_health - Check worker health
|
|
89
|
+
mcp__ruflo__hive-mind_join - Add agent to hive
|
|
90
|
+
mcp__ruflo__hive-mind_leave - Remove agent from hive
|
|
91
91
|
|
|
92
92
|
4️⃣ **TASK ORCHESTRATION**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
mcp__ruflo__task_assign - Assign tasks to workers
|
|
94
|
+
mcp__ruflo__task_status - Track task progress
|
|
95
|
+
mcp__ruflo__task_complete - Mark tasks complete
|
|
96
|
+
mcp__ruflo__workflow_create - Create workflows
|
|
97
97
|
|
|
98
98
|
5️⃣ **MEMORY & LEARNING**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
mcp__ruflo__memory_store - Store collective knowledge
|
|
100
|
+
mcp__ruflo__memory_retrieve - Access shared memory
|
|
101
|
+
mcp__ruflo__memory_search - Search memory patterns
|
|
102
|
+
mcp__ruflo__neural_train - Learn from experiences
|
|
103
|
+
mcp__ruflo__hooks_intelligence_pattern-store - Store patterns
|
|
104
104
|
|
|
105
105
|
📋 HIVE MIND EXECUTION PROTOCOL:
|
|
106
106
|
|
|
@@ -132,11 +132,11 @@ ${workerTypes.map(type => `• ${type}: ${workerGroups[type].length} agents`).jo
|
|
|
132
132
|
${objective}
|
|
133
133
|
|
|
134
134
|
💡 COORDINATION TIPS:
|
|
135
|
-
• Use
|
|
136
|
-
• Check worker status regularly with
|
|
135
|
+
• Use mcp__ruflo__hive-mind_broadcast for swarm-wide announcements
|
|
136
|
+
• Check worker status regularly with mcp__ruflo__hive-mind_status
|
|
137
137
|
• Store important decisions in shared memory for persistence
|
|
138
138
|
• Use consensus for any decisions affecting multiple workers
|
|
139
|
-
•
|
|
139
|
+
• Use mcp__ruflo__task_assign to assign tasks to workers, then mcp__ruflo__task_complete when done
|
|
140
140
|
|
|
141
141
|
🚀 BEGIN HIVE MIND COORDINATION NOW!
|
|
142
142
|
Start by checking the current hive status and then proceed with the objective.
|
|
@@ -252,7 +252,7 @@ export class MCPServerManager extends EventEmitter {
|
|
|
252
252
|
method: 'server.initialized',
|
|
253
253
|
params: {
|
|
254
254
|
serverInfo: {
|
|
255
|
-
name: '
|
|
255
|
+
name: 'ruflo',
|
|
256
256
|
version: VERSION,
|
|
257
257
|
capabilities: {
|
|
258
258
|
tools: { listChanged: true },
|
|
@@ -330,7 +330,7 @@ export class MCPServerManager extends EventEmitter {
|
|
|
330
330
|
id: message.id,
|
|
331
331
|
result: {
|
|
332
332
|
protocolVersion: '2024-11-05',
|
|
333
|
-
serverInfo: { name: '
|
|
333
|
+
serverInfo: { name: 'ruflo', version: '3.0.0' },
|
|
334
334
|
capabilities: {
|
|
335
335
|
tools: { listChanged: true },
|
|
336
336
|
resources: { subscribe: true, listChanged: true },
|
|
@@ -253,6 +253,29 @@ export const hiveMindTools = [
|
|
|
253
253
|
handler: async (input) => {
|
|
254
254
|
const state = loadHiveState();
|
|
255
255
|
const uptime = state.createdAt ? Date.now() - new Date(state.createdAt).getTime() : 0;
|
|
256
|
+
// Load agent store once for all workers
|
|
257
|
+
const agentStore = loadAgentStore();
|
|
258
|
+
// Compute real task metrics from task store
|
|
259
|
+
const taskStorePath = join(process.cwd(), '.claude-flow', 'tasks', 'store.json');
|
|
260
|
+
let pendingTaskCount = 0;
|
|
261
|
+
let activeTaskCount = 0;
|
|
262
|
+
let completedTaskCount = 0;
|
|
263
|
+
try {
|
|
264
|
+
if (existsSync(taskStorePath)) {
|
|
265
|
+
const taskStore = JSON.parse(readFileSync(taskStorePath, 'utf-8'));
|
|
266
|
+
for (const task of Object.values(taskStore.tasks || {})) {
|
|
267
|
+
if (task.status === 'pending')
|
|
268
|
+
pendingTaskCount++;
|
|
269
|
+
else if (task.status === 'in_progress')
|
|
270
|
+
activeTaskCount++;
|
|
271
|
+
else if (task.status === 'completed')
|
|
272
|
+
completedTaskCount++;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
catch { /* ignore */ }
|
|
277
|
+
const workerCount = Math.max(1, state.workers.length);
|
|
278
|
+
const realLoad = activeTaskCount / workerCount;
|
|
256
279
|
const status = {
|
|
257
280
|
// CLI expected fields
|
|
258
281
|
hiveId: `hive-${state.createdAt ? new Date(state.createdAt).getTime() : Date.now()}`,
|
|
@@ -263,23 +286,27 @@ export const hiveMindTools = [
|
|
|
263
286
|
id: state.queen.agentId,
|
|
264
287
|
agentId: state.queen.agentId,
|
|
265
288
|
status: 'active',
|
|
266
|
-
load:
|
|
267
|
-
tasksQueued:
|
|
289
|
+
load: Math.round(realLoad * 1000) / 1000,
|
|
290
|
+
tasksQueued: pendingTaskCount,
|
|
268
291
|
electedAt: state.queen.electedAt,
|
|
269
292
|
term: state.queen.term,
|
|
270
293
|
} : { id: 'N/A', status: 'offline', load: 0, tasksQueued: 0 },
|
|
271
|
-
workers: state.workers.map(w =>
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
294
|
+
workers: state.workers.map(w => {
|
|
295
|
+
const agent = agentStore.agents[w];
|
|
296
|
+
return {
|
|
297
|
+
id: w,
|
|
298
|
+
type: agent?.agentType || 'worker',
|
|
299
|
+
status: agent?.status || 'unknown',
|
|
300
|
+
currentTask: agent?.currentTask || null,
|
|
301
|
+
tasksCompleted: agent?.taskCount || 0,
|
|
302
|
+
};
|
|
303
|
+
}),
|
|
278
304
|
metrics: {
|
|
279
|
-
totalTasks:
|
|
280
|
-
completedTasks:
|
|
305
|
+
totalTasks: pendingTaskCount + activeTaskCount + completedTaskCount,
|
|
306
|
+
completedTasks: completedTaskCount,
|
|
307
|
+
activeTasks: activeTaskCount,
|
|
308
|
+
pendingTasks: pendingTaskCount,
|
|
281
309
|
failedTasks: 0,
|
|
282
|
-
avgTaskTime: 150,
|
|
283
310
|
consensusRounds: state.consensus.history.length,
|
|
284
311
|
memoryUsage: `${Object.keys(state.sharedMemory).length * 2} KB`,
|
|
285
312
|
},
|
|
@@ -157,10 +157,20 @@ export const memoryTools = [
|
|
|
157
157
|
const { storeEntry } = await getMemoryFunctions();
|
|
158
158
|
const key = input.key;
|
|
159
159
|
const namespace = input.namespace || 'default';
|
|
160
|
-
const
|
|
160
|
+
const rawValue = input.value;
|
|
161
|
+
const value = typeof rawValue === 'string' ? rawValue : (rawValue !== undefined ? JSON.stringify(rawValue) : '');
|
|
161
162
|
const tags = input.tags || [];
|
|
162
163
|
const ttl = input.ttl;
|
|
163
164
|
const upsert = input.upsert || false;
|
|
165
|
+
if (!value) {
|
|
166
|
+
return {
|
|
167
|
+
success: false,
|
|
168
|
+
key,
|
|
169
|
+
stored: false,
|
|
170
|
+
hasEmbedding: false,
|
|
171
|
+
error: 'Value is required and cannot be empty',
|
|
172
|
+
};
|
|
173
|
+
}
|
|
164
174
|
validateMemoryInput(key, value);
|
|
165
175
|
const startTime = performance.now();
|
|
166
176
|
try {
|
|
@@ -201,6 +201,28 @@ export const taskTools = [
|
|
|
201
201
|
task.completedAt = new Date().toISOString();
|
|
202
202
|
task.result = input.result || {};
|
|
203
203
|
saveTaskStore(store);
|
|
204
|
+
// Sync assigned agents back to idle and increment taskCount
|
|
205
|
+
if (task.assignedTo.length > 0) {
|
|
206
|
+
const agentStorePath = join(process.cwd(), STORAGE_DIR, 'agents.json');
|
|
207
|
+
try {
|
|
208
|
+
let agentStore = { agents: {} };
|
|
209
|
+
if (existsSync(agentStorePath)) {
|
|
210
|
+
agentStore = JSON.parse(readFileSync(agentStorePath, 'utf-8'));
|
|
211
|
+
}
|
|
212
|
+
for (const agentId of task.assignedTo) {
|
|
213
|
+
if (agentStore.agents[agentId]) {
|
|
214
|
+
agentStore.agents[agentId].status = 'idle';
|
|
215
|
+
agentStore.agents[agentId].currentTask = null;
|
|
216
|
+
agentStore.agents[agentId].taskCount =
|
|
217
|
+
(agentStore.agents[agentId].taskCount || 0) + 1;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
writeFileSync(agentStorePath, JSON.stringify(agentStore, null, 2), 'utf-8');
|
|
221
|
+
}
|
|
222
|
+
catch {
|
|
223
|
+
// Best-effort agent sync
|
|
224
|
+
}
|
|
225
|
+
}
|
|
204
226
|
return {
|
|
205
227
|
taskId: task.taskId,
|
|
206
228
|
status: task.status,
|
|
@@ -284,18 +306,62 @@ export const taskTools = [
|
|
|
284
306
|
return { taskId, error: 'Task not found' };
|
|
285
307
|
}
|
|
286
308
|
const previouslyAssigned = [...task.assignedTo];
|
|
309
|
+
// Load agent store to sync worker state
|
|
310
|
+
const agentStorePath = join(process.cwd(), STORAGE_DIR, 'agents.json');
|
|
311
|
+
let agentStore = { agents: {} };
|
|
312
|
+
try {
|
|
313
|
+
if (existsSync(agentStorePath)) {
|
|
314
|
+
agentStore = JSON.parse(readFileSync(agentStorePath, 'utf-8'));
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
catch { /* ignore */ }
|
|
287
318
|
if (input.unassign) {
|
|
319
|
+
// Revert previously assigned agents to idle
|
|
320
|
+
for (const agentId of previouslyAssigned) {
|
|
321
|
+
if (agentStore.agents[agentId]) {
|
|
322
|
+
agentStore.agents[agentId].status = 'idle';
|
|
323
|
+
agentStore.agents[agentId].currentTask = null;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
288
326
|
task.assignedTo = [];
|
|
289
327
|
}
|
|
290
328
|
else {
|
|
291
329
|
const agentIds = input.agentIds || [];
|
|
330
|
+
// Revert old agents to idle
|
|
331
|
+
for (const agentId of previouslyAssigned) {
|
|
332
|
+
if (!agentIds.includes(agentId) && agentStore.agents[agentId]) {
|
|
333
|
+
agentStore.agents[agentId].status = 'idle';
|
|
334
|
+
agentStore.agents[agentId].currentTask = null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// Set new agents to active
|
|
338
|
+
for (const agentId of agentIds) {
|
|
339
|
+
if (agentStore.agents[agentId]) {
|
|
340
|
+
agentStore.agents[agentId].status = 'active';
|
|
341
|
+
agentStore.agents[agentId].currentTask = taskId;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
292
344
|
task.assignedTo = agentIds;
|
|
345
|
+
// Auto-transition task to in_progress if pending
|
|
346
|
+
if (task.status === 'pending' && agentIds.length > 0) {
|
|
347
|
+
task.status = 'in_progress';
|
|
348
|
+
if (!task.startedAt) {
|
|
349
|
+
task.startedAt = new Date().toISOString();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
293
352
|
}
|
|
294
353
|
saveTaskStore(store);
|
|
354
|
+
// Save agent store
|
|
355
|
+
const agentDir = join(process.cwd(), STORAGE_DIR);
|
|
356
|
+
if (!existsSync(agentDir)) {
|
|
357
|
+
mkdirSync(agentDir, { recursive: true });
|
|
358
|
+
}
|
|
359
|
+
writeFileSync(agentStorePath, JSON.stringify(agentStore, null, 2), 'utf-8');
|
|
295
360
|
return {
|
|
296
361
|
taskId: task.taskId,
|
|
297
362
|
assignedTo: task.assignedTo,
|
|
298
363
|
previouslyAssigned,
|
|
364
|
+
status: task.status,
|
|
299
365
|
};
|
|
300
366
|
},
|
|
301
367
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.42",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|