claude-flow 2.7.38 → 2.7.39
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/bin/claude-flow +12 -6
- package/dist/src/cli/help-formatter.js +5 -3
- package/dist/src/cli/simple-cli.js +172 -182
- package/dist/src/core/version.js +2 -2
- package/dist/src/memory/swarm-memory.js +348 -416
- package/dist/src/utils/metrics-reader.js +39 -37
- package/package.json +1 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
3
|
import { exec } from 'child_process';
|
|
4
4
|
import { promisify } from 'util';
|
|
5
5
|
const execAsync = promisify(exec);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
let MetricsReader = class MetricsReader {
|
|
7
|
+
constructor(){
|
|
8
|
+
this.metricsDir = '.claude-flow/metrics';
|
|
9
|
+
this.sessionsDir = '.claude-flow/sessions';
|
|
10
|
+
}
|
|
9
11
|
async getSystemMetrics() {
|
|
10
12
|
try {
|
|
11
13
|
const filePath = path.join(this.metricsDir, 'system-metrics.json');
|
|
@@ -16,6 +18,15 @@ export class MetricsReader {
|
|
|
16
18
|
return null;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
21
|
+
async getTaskQueue() {
|
|
22
|
+
try {
|
|
23
|
+
const queueFile = '.claude-flow/tasks/queue.json';
|
|
24
|
+
const content = await fs.readFile(queueFile, 'utf8');
|
|
25
|
+
return JSON.parse(content);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
19
30
|
async getTaskMetrics() {
|
|
20
31
|
try {
|
|
21
32
|
const filePath = path.join(this.metricsDir, 'task-metrics.json');
|
|
@@ -36,30 +47,30 @@ export class MetricsReader {
|
|
|
36
47
|
}
|
|
37
48
|
async getActiveAgents() {
|
|
38
49
|
try {
|
|
39
|
-
const perfMetrics = await this.getPerformanceMetrics();
|
|
40
|
-
const sessionFiles = await this.getSessionFiles();
|
|
41
50
|
const agents = [];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
51
|
+
const agentsDir = '.claude-flow/agents';
|
|
52
|
+
try {
|
|
53
|
+
const agentFiles = await fs.readdir(agentsDir);
|
|
54
|
+
for (const file of agentFiles){
|
|
55
|
+
if (file.endsWith('.json')) {
|
|
56
|
+
try {
|
|
57
|
+
const content = await fs.readFile(path.join(agentsDir, file), 'utf8');
|
|
58
|
+
const agent = JSON.parse(content);
|
|
59
|
+
agents.push(agent);
|
|
60
|
+
} catch {}
|
|
48
61
|
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (agents.length === 0
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
lastActivity: Date.now() - i * 1000
|
|
62
|
-
});
|
|
62
|
+
}
|
|
63
|
+
} catch {}
|
|
64
|
+
if (agents.length === 0) {
|
|
65
|
+
const sessionFiles = await this.getSessionFiles();
|
|
66
|
+
for (const file of sessionFiles){
|
|
67
|
+
try {
|
|
68
|
+
const content = await fs.readFile(path.join(this.sessionsDir, 'pair', file), 'utf8');
|
|
69
|
+
const sessionData = JSON.parse(content);
|
|
70
|
+
if (sessionData.agents && Array.isArray(sessionData.agents)) {
|
|
71
|
+
agents.push(...sessionData.agents);
|
|
72
|
+
}
|
|
73
|
+
} catch {}
|
|
63
74
|
}
|
|
64
75
|
}
|
|
65
76
|
return agents;
|
|
@@ -135,7 +146,7 @@ export class MetricsReader {
|
|
|
135
146
|
}
|
|
136
147
|
async getMCPServerStatus() {
|
|
137
148
|
try {
|
|
138
|
-
const { stdout } = await execAsync('ps aux | grep -E "mcp
|
|
149
|
+
const { stdout } = await execAsync('ps aux | grep -E "mcp" | grep -v grep | wc -l');
|
|
139
150
|
const processCount = parseInt(stdout.trim(), 10);
|
|
140
151
|
const { stdout: orchestratorOut } = await execAsync('ps aux | grep -E "claude-flow start" | grep -v grep | wc -l');
|
|
141
152
|
const orchestratorRunning = parseInt(orchestratorOut.trim(), 10) > 0;
|
|
@@ -164,15 +175,6 @@ export class MetricsReader {
|
|
|
164
175
|
};
|
|
165
176
|
}
|
|
166
177
|
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
//# sourceMappingURL=metrics-reader.js.map processCount: 0,
|
|
170
|
-
orchestratorRunning: false,
|
|
171
|
-
port: null,
|
|
172
|
-
connections: 0
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
178
|
};
|
|
177
179
|
export { MetricsReader };
|
|
178
180
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.39",
|
|
4
4
|
"description": "Enterprise-grade AI agent orchestration with WASM-powered ReasoningBank memory and AgentDB vector database (always uses latest agentic-flow)",
|
|
5
5
|
"mcpName": "io.github.ruvnet/claude-flow",
|
|
6
6
|
"main": "cli.mjs",
|