claude-flow 2.7.39 → 2.7.40
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Claude-Flow Smart Dispatcher - Detects and uses the best available runtime
|
|
3
3
|
# Enhanced with NPX cache error handling and retry logic
|
|
4
4
|
|
|
5
|
-
VERSION="2.7.
|
|
5
|
+
VERSION="2.7.40"
|
|
6
6
|
|
|
7
7
|
# Determine the correct path based on how the script is invoked
|
|
8
8
|
if [ -L "$0" ]; then
|
package/dist/src/core/version.js
CHANGED
|
@@ -12,7 +12,7 @@ try {
|
|
|
12
12
|
BUILD_DATE = new Date().toISOString().split('T')[0];
|
|
13
13
|
} catch (error) {
|
|
14
14
|
console.warn('Warning: Could not read version from package.json, using fallback');
|
|
15
|
-
VERSION = '2.0.0-alpha.
|
|
15
|
+
VERSION = '2.0.0-alpha.91';
|
|
16
16
|
BUILD_DATE = new Date().toISOString().split('T')[0];
|
|
17
17
|
}
|
|
18
18
|
export { VERSION, BUILD_DATE };
|
|
@@ -23,4 +23,4 @@ export function displayVersion() {
|
|
|
23
23
|
console.log(getVersionString());
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=version.js.
|
|
26
|
+
//# sourceMappingURL=version.js.mapp
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import path from 'path';
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
import * as 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
|
-
|
|
9
|
-
this.sessionsDir = '.claude-flow/sessions';
|
|
10
|
-
}
|
|
6
|
+
export class MetricsReader {
|
|
7
|
+
metricsDir = '.claude-flow/metrics';
|
|
8
|
+
sessionsDir = '.claude-flow/sessions';
|
|
11
9
|
async getSystemMetrics() {
|
|
12
10
|
try {
|
|
13
11
|
const filePath = path.join(this.metricsDir, 'system-metrics.json');
|
|
@@ -18,15 +16,6 @@ let MetricsReader = class MetricsReader {
|
|
|
18
16
|
return null;
|
|
19
17
|
}
|
|
20
18
|
}
|
|
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
|
-
}
|
|
30
19
|
async getTaskMetrics() {
|
|
31
20
|
try {
|
|
32
21
|
const filePath = path.join(this.metricsDir, 'task-metrics.json');
|
|
@@ -47,30 +36,30 @@ let MetricsReader = class MetricsReader {
|
|
|
47
36
|
}
|
|
48
37
|
async getActiveAgents() {
|
|
49
38
|
try {
|
|
39
|
+
const perfMetrics = await this.getPerformanceMetrics();
|
|
40
|
+
const sessionFiles = await this.getSessionFiles();
|
|
50
41
|
const agents = [];
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
const content = await fs.readFile(path.join(agentsDir, file), 'utf8');
|
|
58
|
-
const agent = JSON.parse(content);
|
|
59
|
-
agents.push(agent);
|
|
60
|
-
} catch {}
|
|
42
|
+
for (const file of sessionFiles){
|
|
43
|
+
try {
|
|
44
|
+
const content = await fs.readFile(path.join(this.sessionsDir, 'pair', file), 'utf8');
|
|
45
|
+
const sessionData = JSON.parse(content);
|
|
46
|
+
if (sessionData.agents && Array.isArray(sessionData.agents)) {
|
|
47
|
+
agents.push(...sessionData.agents);
|
|
61
48
|
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (agents.length === 0) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
49
|
+
} catch {}
|
|
50
|
+
}
|
|
51
|
+
if (agents.length === 0 && perfMetrics) {
|
|
52
|
+
const activeCount = perfMetrics.activeAgents || 0;
|
|
53
|
+
const totalCount = perfMetrics.totalAgents || 0;
|
|
54
|
+
for(let i = 0; i < totalCount; i++){
|
|
55
|
+
agents.push({
|
|
56
|
+
id: `agent-${i + 1}`,
|
|
57
|
+
name: `Agent ${i + 1}`,
|
|
58
|
+
type: i === 0 ? 'orchestrator' : 'worker',
|
|
59
|
+
status: i < activeCount ? 'active' : 'idle',
|
|
60
|
+
activeTasks: i < activeCount ? 1 : 0,
|
|
61
|
+
lastActivity: Date.now() - i * 1000
|
|
62
|
+
});
|
|
74
63
|
}
|
|
75
64
|
}
|
|
76
65
|
return agents;
|
|
@@ -146,7 +135,7 @@ let MetricsReader = class MetricsReader {
|
|
|
146
135
|
}
|
|
147
136
|
async getMCPServerStatus() {
|
|
148
137
|
try {
|
|
149
|
-
const { stdout } = await execAsync('ps aux | grep -E "mcp" | grep -v grep | wc -l');
|
|
138
|
+
const { stdout } = await execAsync('ps aux | grep -E "mcp-server\\.js|claude-flow mcp start" | grep -v grep | wc -l');
|
|
150
139
|
const processCount = parseInt(stdout.trim(), 10);
|
|
151
140
|
const { stdout: orchestratorOut } = await execAsync('ps aux | grep -E "claude-flow start" | grep -v grep | wc -l');
|
|
152
141
|
const orchestratorRunning = parseInt(orchestratorOut.trim(), 10) > 0;
|
|
@@ -175,7 +164,6 @@ let MetricsReader = class MetricsReader {
|
|
|
175
164
|
};
|
|
176
165
|
}
|
|
177
166
|
}
|
|
178
|
-
}
|
|
179
|
-
export { MetricsReader };
|
|
167
|
+
}
|
|
180
168
|
|
|
181
169
|
//# sourceMappingURL=metrics-reader.js.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.40",
|
|
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",
|
|
7
7
|
"bin": {
|
|
8
|
-
"claude-flow": "bin/claude-flow
|
|
8
|
+
"claude-flow": "bin/claude-flow"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"preinstall": "node -e \"if(process.platform === 'win32' && process.env.npm_config_user_agent && process.env.npm_config_user_agent.includes('npm')) { console.warn('⚠️ Warning: On Windows, it is recommended to use pnpm to install this package to avoid potential native dependency build issues.'); console.warn('💡 Try: pnpm install or pnpx claude-flow@alpha'); }\"",
|