@claude-flow/cli 3.0.0-alpha.6 → 3.0.0-alpha.8
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/.agentic-flow/intelligence.json +4 -4
- package/.claude-flow/agents/store.json +16 -0
- package/.claude-flow/daemon-state.json +123 -0
- package/.claude-flow/hive-mind/state.json +51 -0
- package/.claude-flow/metrics/codebase-map.json +11 -0
- package/.claude-flow/metrics/consolidation.json +6 -0
- package/.claude-flow/metrics/performance.json +12 -84
- package/.claude-flow/metrics/security-audit.json +10 -0
- package/.claude-flow/metrics/task-metrics.json +3 -3
- package/.claude-flow/metrics/test-gaps.json +6 -0
- package/agents/architect.yaml +1 -1
- package/agents/coder.yaml +1 -1
- package/agents/reviewer.yaml +1 -1
- package/agents/security-architect.yaml +1 -1
- package/agents/tester.yaml +1 -1
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +42 -26
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/daemon.d.ts +8 -0
- package/dist/src/commands/daemon.d.ts.map +1 -0
- package/dist/src/commands/daemon.js +351 -0
- package/dist/src/commands/daemon.js.map +1 -0
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +252 -35
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/index.d.ts +1 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +4 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/start.js +2 -2
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +22 -12
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +13 -1
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +350 -14
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +262 -15
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +447 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +46 -7
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +2 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +2 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.d.ts +1 -1
- package/dist/src/mcp-tools/session-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +237 -22
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +219 -17
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.js +481 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/dist/src/services/index.d.ts +7 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +6 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/worker-daemon.d.ts +153 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +567 -0
- package/dist/src/services/worker-daemon.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/commands/agent.ts +42 -28
- package/src/commands/daemon.ts +395 -0
- package/src/commands/hive-mind.ts +229 -63
- package/src/commands/index.ts +4 -1
- package/src/commands/start.ts +2 -2
- package/src/index.ts +5 -2
- package/src/init/settings-generator.ts +22 -12
- package/src/mcp-client.ts +13 -1
- package/src/mcp-tools/agent-tools.ts +388 -14
- package/src/mcp-tools/config-tools.ts +297 -15
- package/src/mcp-tools/hive-mind-tools.ts +521 -0
- package/src/mcp-tools/hooks-tools.ts +46 -7
- package/src/mcp-tools/index.ts +2 -0
- package/src/mcp-tools/session-tools.ts +280 -23
- package/src/mcp-tools/task-tools.ts +265 -20
- package/src/mcp-tools/workflow-tools.ts +573 -0
- package/src/services/index.ts +15 -0
- package/src/services/worker-daemon.ts +726 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"patterns": {
|
|
3
3
|
"command:": {
|
|
4
|
-
"success": 0.
|
|
5
|
-
"failure": -0.
|
|
4
|
+
"success": 0.9999970936785837,
|
|
5
|
+
"failure": -0.3587852317595
|
|
6
6
|
}
|
|
7
7
|
},
|
|
8
8
|
"sequences": {},
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"dirPatterns": {},
|
|
11
11
|
"errorPatterns": [],
|
|
12
12
|
"metrics": {
|
|
13
|
-
"totalRoutes":
|
|
14
|
-
"successfulRoutes":
|
|
13
|
+
"totalRoutes": 133,
|
|
14
|
+
"successfulRoutes": 121,
|
|
15
15
|
"routingHistory": []
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"agents": {
|
|
3
|
+
"agent-1767755470442-q0onj8": {
|
|
4
|
+
"agentId": "agent-1767755470442-q0onj8",
|
|
5
|
+
"agentType": "coder",
|
|
6
|
+
"status": "idle",
|
|
7
|
+
"health": 1,
|
|
8
|
+
"taskCount": 0,
|
|
9
|
+
"config": {
|
|
10
|
+
"provider": "anthropic"
|
|
11
|
+
},
|
|
12
|
+
"createdAt": "2026-01-07T03:11:10.442Z"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"version": "3.0.0"
|
|
16
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"running": true,
|
|
3
|
+
"startedAt": "2026-01-07T03:07:50.010Z",
|
|
4
|
+
"workers": {
|
|
5
|
+
"map": {
|
|
6
|
+
"runCount": 7,
|
|
7
|
+
"successCount": 7,
|
|
8
|
+
"failureCount": 0,
|
|
9
|
+
"averageDurationMs": 0.5714285714285714,
|
|
10
|
+
"isRunning": false,
|
|
11
|
+
"nextRun": "2026-01-07T03:37:50.197Z",
|
|
12
|
+
"lastRun": "2026-01-07T03:37:50.198Z"
|
|
13
|
+
},
|
|
14
|
+
"audit": {
|
|
15
|
+
"runCount": 4,
|
|
16
|
+
"successCount": 4,
|
|
17
|
+
"failureCount": 0,
|
|
18
|
+
"averageDurationMs": 0.25,
|
|
19
|
+
"isRunning": false,
|
|
20
|
+
"nextRun": "2026-01-07T03:47:50.117Z",
|
|
21
|
+
"lastRun": "2026-01-07T03:37:50.117Z"
|
|
22
|
+
},
|
|
23
|
+
"optimize": {
|
|
24
|
+
"runCount": 3,
|
|
25
|
+
"successCount": 3,
|
|
26
|
+
"failureCount": 0,
|
|
27
|
+
"averageDurationMs": 0,
|
|
28
|
+
"isRunning": false,
|
|
29
|
+
"nextRun": "2026-01-07T03:52:50.090Z",
|
|
30
|
+
"lastRun": "2026-01-07T03:37:50.089Z"
|
|
31
|
+
},
|
|
32
|
+
"consolidate": {
|
|
33
|
+
"runCount": 2,
|
|
34
|
+
"successCount": 2,
|
|
35
|
+
"failureCount": 0,
|
|
36
|
+
"averageDurationMs": 1,
|
|
37
|
+
"isRunning": false,
|
|
38
|
+
"nextRun": "2026-01-07T04:07:50.089Z",
|
|
39
|
+
"lastRun": "2026-01-07T03:37:50.089Z"
|
|
40
|
+
},
|
|
41
|
+
"testgaps": {
|
|
42
|
+
"runCount": 2,
|
|
43
|
+
"successCount": 2,
|
|
44
|
+
"failureCount": 0,
|
|
45
|
+
"averageDurationMs": 0,
|
|
46
|
+
"isRunning": false,
|
|
47
|
+
"nextRun": "2026-01-07T03:47:50.072Z",
|
|
48
|
+
"lastRun": "2026-01-07T03:27:50.072Z"
|
|
49
|
+
},
|
|
50
|
+
"predict": {
|
|
51
|
+
"runCount": 0,
|
|
52
|
+
"successCount": 0,
|
|
53
|
+
"failureCount": 0,
|
|
54
|
+
"averageDurationMs": 0,
|
|
55
|
+
"isRunning": false
|
|
56
|
+
},
|
|
57
|
+
"document": {
|
|
58
|
+
"runCount": 0,
|
|
59
|
+
"successCount": 0,
|
|
60
|
+
"failureCount": 0,
|
|
61
|
+
"averageDurationMs": 0,
|
|
62
|
+
"isRunning": false
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"config": {
|
|
66
|
+
"autoStart": true,
|
|
67
|
+
"logDir": "/workspaces/claude-flow/v3/@claude-flow/cli/.claude-flow/logs",
|
|
68
|
+
"stateFile": "/workspaces/claude-flow/v3/@claude-flow/cli/.claude-flow/daemon-state.json",
|
|
69
|
+
"maxConcurrent": 3,
|
|
70
|
+
"workers": [
|
|
71
|
+
{
|
|
72
|
+
"type": "map",
|
|
73
|
+
"intervalMs": 300000,
|
|
74
|
+
"priority": "normal",
|
|
75
|
+
"description": "Codebase mapping",
|
|
76
|
+
"enabled": true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "audit",
|
|
80
|
+
"intervalMs": 600000,
|
|
81
|
+
"priority": "critical",
|
|
82
|
+
"description": "Security analysis",
|
|
83
|
+
"enabled": true
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "optimize",
|
|
87
|
+
"intervalMs": 900000,
|
|
88
|
+
"priority": "high",
|
|
89
|
+
"description": "Performance optimization",
|
|
90
|
+
"enabled": true
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "consolidate",
|
|
94
|
+
"intervalMs": 1800000,
|
|
95
|
+
"priority": "low",
|
|
96
|
+
"description": "Memory consolidation",
|
|
97
|
+
"enabled": true
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "testgaps",
|
|
101
|
+
"intervalMs": 1200000,
|
|
102
|
+
"priority": "normal",
|
|
103
|
+
"description": "Test coverage analysis",
|
|
104
|
+
"enabled": true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "predict",
|
|
108
|
+
"intervalMs": 120000,
|
|
109
|
+
"priority": "low",
|
|
110
|
+
"description": "Predictive preloading",
|
|
111
|
+
"enabled": false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "document",
|
|
115
|
+
"intervalMs": 3600000,
|
|
116
|
+
"priority": "low",
|
|
117
|
+
"description": "Auto-documentation",
|
|
118
|
+
"enabled": false
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"savedAt": "2026-01-07T03:37:50.198Z"
|
|
123
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"initialized": true,
|
|
3
|
+
"topology": "hierarchical-mesh",
|
|
4
|
+
"workers": [
|
|
5
|
+
"worker-alpha",
|
|
6
|
+
"worker-beta",
|
|
7
|
+
"worker-test-1"
|
|
8
|
+
],
|
|
9
|
+
"consensus": {
|
|
10
|
+
"pending": [
|
|
11
|
+
{
|
|
12
|
+
"proposalId": "proposal-1767755978528-6nwb20",
|
|
13
|
+
"type": "feature",
|
|
14
|
+
"value": "new-feature-request",
|
|
15
|
+
"proposedBy": "system",
|
|
16
|
+
"proposedAt": "2026-01-07T03:19:38.528Z",
|
|
17
|
+
"votes": {},
|
|
18
|
+
"status": "pending"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"history": []
|
|
22
|
+
},
|
|
23
|
+
"sharedMemory": {
|
|
24
|
+
"session/context": "{\"task\":\"fix formatting\",\"phase\":\"completed\"}",
|
|
25
|
+
"decisions/architecture": "null-checks-pattern",
|
|
26
|
+
"broadcasts": [
|
|
27
|
+
{
|
|
28
|
+
"messageId": "msg-1767755540633-dos7u7",
|
|
29
|
+
"message": "Formatting fixes complete",
|
|
30
|
+
"priority": "normal",
|
|
31
|
+
"fromId": "system",
|
|
32
|
+
"timestamp": "2026-01-07T03:12:20.634Z"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"messageId": "msg-1767755807511-4a6fbz",
|
|
36
|
+
"message": "Test broadcast message",
|
|
37
|
+
"priority": "normal",
|
|
38
|
+
"fromId": "system",
|
|
39
|
+
"timestamp": "2026-01-07T03:16:47.511Z"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"test/data": "Hello World"
|
|
43
|
+
},
|
|
44
|
+
"createdAt": "2026-01-07T03:11:24.276Z",
|
|
45
|
+
"updatedAt": "2026-01-07T03:19:38.528Z",
|
|
46
|
+
"queen": {
|
|
47
|
+
"agentId": "queen-1767755484276",
|
|
48
|
+
"electedAt": "2026-01-07T03:11:24.276Z",
|
|
49
|
+
"term": 1
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timestamp": "2026-01-07T03:37:50.198Z",
|
|
3
|
+
"projectRoot": "/workspaces/claude-flow/v3/@claude-flow/cli",
|
|
4
|
+
"structure": {
|
|
5
|
+
"hasPackageJson": true,
|
|
6
|
+
"hasTsConfig": true,
|
|
7
|
+
"hasClaudeConfig": false,
|
|
8
|
+
"hasClaudeFlow": true
|
|
9
|
+
},
|
|
10
|
+
"scannedAt": 1767757070198
|
|
11
|
+
}
|
|
@@ -1,87 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"basicOperations": 0,
|
|
15
|
-
"autoModeSelections": 0,
|
|
16
|
-
"modeOverrides": 0,
|
|
17
|
-
"currentMode": "auto"
|
|
18
|
-
},
|
|
19
|
-
"operations": {
|
|
20
|
-
"store": {
|
|
21
|
-
"count": 0,
|
|
22
|
-
"totalDuration": 0,
|
|
23
|
-
"errors": 0
|
|
24
|
-
},
|
|
25
|
-
"retrieve": {
|
|
26
|
-
"count": 0,
|
|
27
|
-
"totalDuration": 0,
|
|
28
|
-
"errors": 0
|
|
29
|
-
},
|
|
30
|
-
"query": {
|
|
31
|
-
"count": 0,
|
|
32
|
-
"totalDuration": 0,
|
|
33
|
-
"errors": 0
|
|
34
|
-
},
|
|
35
|
-
"list": {
|
|
36
|
-
"count": 0,
|
|
37
|
-
"totalDuration": 0,
|
|
38
|
-
"errors": 0
|
|
39
|
-
},
|
|
40
|
-
"delete": {
|
|
41
|
-
"count": 0,
|
|
42
|
-
"totalDuration": 0,
|
|
43
|
-
"errors": 0
|
|
44
|
-
},
|
|
45
|
-
"search": {
|
|
46
|
-
"count": 0,
|
|
47
|
-
"totalDuration": 0,
|
|
48
|
-
"errors": 0
|
|
49
|
-
},
|
|
50
|
-
"init": {
|
|
51
|
-
"count": 0,
|
|
52
|
-
"totalDuration": 0,
|
|
53
|
-
"errors": 0
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"performance": {
|
|
57
|
-
"avgOperationDuration": 0,
|
|
58
|
-
"minOperationDuration": null,
|
|
59
|
-
"maxOperationDuration": null,
|
|
60
|
-
"slowOperations": 0,
|
|
61
|
-
"fastOperations": 0,
|
|
62
|
-
"totalOperationTime": 0
|
|
63
|
-
},
|
|
64
|
-
"storage": {
|
|
65
|
-
"totalEntries": 0,
|
|
66
|
-
"reasoningbankEntries": 0,
|
|
67
|
-
"basicEntries": 0,
|
|
68
|
-
"databaseSize": 0,
|
|
69
|
-
"lastBackup": null,
|
|
70
|
-
"growthRate": 0
|
|
71
|
-
},
|
|
72
|
-
"errors": {
|
|
73
|
-
"total": 0,
|
|
74
|
-
"byType": {},
|
|
75
|
-
"byOperation": {},
|
|
76
|
-
"recent": []
|
|
77
|
-
},
|
|
78
|
-
"reasoningbank": {
|
|
79
|
-
"semanticSearches": 0,
|
|
80
|
-
"sqlFallbacks": 0,
|
|
81
|
-
"embeddingGenerated": 0,
|
|
82
|
-
"consolidations": 0,
|
|
83
|
-
"avgQueryTime": 0,
|
|
84
|
-
"cacheHits": 0,
|
|
85
|
-
"cacheMisses": 0
|
|
2
|
+
"timestamp": "2026-01-07T03:37:50.090Z",
|
|
3
|
+
"memoryUsage": {
|
|
4
|
+
"rss": 65044480,
|
|
5
|
+
"heapTotal": 11042816,
|
|
6
|
+
"heapUsed": 9247808,
|
|
7
|
+
"external": 2145622,
|
|
8
|
+
"arrayBuffers": 24811
|
|
9
|
+
},
|
|
10
|
+
"uptime": 1594.301482026,
|
|
11
|
+
"optimizations": {
|
|
12
|
+
"cacheHitRate": 0.78,
|
|
13
|
+
"avgResponseTime": 45
|
|
86
14
|
}
|
|
87
15
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"id": "cmd-hooks-
|
|
3
|
+
"id": "cmd-hooks-1767756988616",
|
|
4
4
|
"type": "hooks",
|
|
5
5
|
"success": true,
|
|
6
|
-
"duration":
|
|
7
|
-
"timestamp":
|
|
6
|
+
"duration": 2.273775999999998,
|
|
7
|
+
"timestamp": 1767756988618,
|
|
8
8
|
"metadata": {}
|
|
9
9
|
}
|
|
10
10
|
]
|
package/agents/architect.yaml
CHANGED
package/agents/coder.yaml
CHANGED
package/agents/reviewer.yaml
CHANGED
package/agents/tester.yaml
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAm3B1E,eAAO,MAAM,YAAY,EAAE,OA8B1B,CAAC;AAoCF,eAAe,YAAY,CAAC"}
|
|
@@ -270,17 +270,19 @@ const statusCommand = {
|
|
|
270
270
|
if (status.metrics) {
|
|
271
271
|
output.writeln();
|
|
272
272
|
output.writeln(output.bold('Metrics'));
|
|
273
|
+
const avgExecTime = status.metrics.averageExecutionTime ?? 0;
|
|
274
|
+
const uptime = status.metrics.uptime ?? 0;
|
|
273
275
|
output.printTable({
|
|
274
276
|
columns: [
|
|
275
277
|
{ key: 'metric', header: 'Metric', width: 25 },
|
|
276
278
|
{ key: 'value', header: 'Value', width: 15, align: 'right' }
|
|
277
279
|
],
|
|
278
280
|
data: [
|
|
279
|
-
{ metric: 'Tasks Completed', value: status.metrics.tasksCompleted },
|
|
280
|
-
{ metric: 'Tasks In Progress', value: status.metrics.tasksInProgress },
|
|
281
|
-
{ metric: 'Tasks Failed', value: status.metrics.tasksFailed },
|
|
282
|
-
{ metric: 'Avg Execution Time', value: `${
|
|
283
|
-
{ metric: 'Uptime', value: `${(
|
|
281
|
+
{ metric: 'Tasks Completed', value: status.metrics.tasksCompleted ?? 0 },
|
|
282
|
+
{ metric: 'Tasks In Progress', value: status.metrics.tasksInProgress ?? 0 },
|
|
283
|
+
{ metric: 'Tasks Failed', value: status.metrics.tasksFailed ?? 0 },
|
|
284
|
+
{ metric: 'Avg Execution Time', value: `${avgExecTime.toFixed(2)}ms` },
|
|
285
|
+
{ metric: 'Uptime', value: `${(uptime / 1000 / 60).toFixed(1)}m` }
|
|
284
286
|
]
|
|
285
287
|
});
|
|
286
288
|
}
|
|
@@ -492,14 +494,16 @@ const poolCommand = {
|
|
|
492
494
|
return { success: true, data: result };
|
|
493
495
|
}
|
|
494
496
|
output.writeln();
|
|
497
|
+
const utilization = result.utilization ?? 0;
|
|
495
498
|
output.printBox([
|
|
496
|
-
`Pool ID: ${result.poolId}`,
|
|
497
|
-
`Current Size: ${result.currentSize}`,
|
|
498
|
-
`Min/Max: ${result.minSize}/${result.maxSize}`,
|
|
499
|
+
`Pool ID: ${result.poolId ?? 'default'}`,
|
|
500
|
+
`Current Size: ${result.currentSize ?? 0}`,
|
|
501
|
+
`Min/Max: ${result.minSize ?? 0}/${result.maxSize ?? 100}`,
|
|
499
502
|
`Auto-Scale: ${result.autoScale ? 'Yes' : 'No'}`,
|
|
500
|
-
`Utilization: ${(
|
|
503
|
+
`Utilization: ${(utilization * 100).toFixed(1)}%`
|
|
501
504
|
].join('\n'), 'Agent Pool');
|
|
502
|
-
|
|
505
|
+
const agents = result.agents ?? [];
|
|
506
|
+
if (agents.length > 0) {
|
|
503
507
|
output.writeln();
|
|
504
508
|
output.writeln(output.bold('Pool Agents'));
|
|
505
509
|
output.printTable({
|
|
@@ -508,7 +512,7 @@ const poolCommand = {
|
|
|
508
512
|
{ key: 'type', header: 'Type', width: 15 },
|
|
509
513
|
{ key: 'status', header: 'Status', width: 12, format: formatStatus }
|
|
510
514
|
],
|
|
511
|
-
data:
|
|
515
|
+
data: agents
|
|
512
516
|
});
|
|
513
517
|
}
|
|
514
518
|
return { success: true, data: result };
|
|
@@ -569,43 +573,55 @@ const healthCommand = {
|
|
|
569
573
|
output.writeln();
|
|
570
574
|
output.writeln(output.bold('Agent Health'));
|
|
571
575
|
output.writeln();
|
|
572
|
-
// Overall summary
|
|
576
|
+
// Overall summary with null checks
|
|
577
|
+
const overall = result.overall ?? { healthy: 0, degraded: 0, unhealthy: 0, avgCpu: 0, avgMemory: 0 };
|
|
578
|
+
const avgCpu = overall.avgCpu ?? 0;
|
|
579
|
+
const avgMemory = overall.avgMemory ?? 0;
|
|
573
580
|
output.printBox([
|
|
574
|
-
`Healthy: ${output.success(String(
|
|
575
|
-
`Degraded: ${output.warning(String(
|
|
576
|
-
`Unhealthy: ${output.error(String(
|
|
577
|
-
`Avg CPU: ${
|
|
578
|
-
`Avg Memory: ${(
|
|
581
|
+
`Healthy: ${output.success(String(overall.healthy ?? 0))}`,
|
|
582
|
+
`Degraded: ${output.warning(String(overall.degraded ?? 0))}`,
|
|
583
|
+
`Unhealthy: ${output.error(String(overall.unhealthy ?? 0))}`,
|
|
584
|
+
`Avg CPU: ${avgCpu.toFixed(1)}%`,
|
|
585
|
+
`Avg Memory: ${(avgMemory * 100).toFixed(1)}%`
|
|
579
586
|
].join(' | '), 'Overall Status');
|
|
587
|
+
const healthAgents = result.agents ?? [];
|
|
580
588
|
output.writeln();
|
|
581
589
|
output.printTable({
|
|
582
590
|
columns: [
|
|
583
591
|
{ key: 'id', header: 'Agent ID', width: 18 },
|
|
584
592
|
{ key: 'type', header: 'Type', width: 12 },
|
|
585
593
|
{ key: 'health', header: 'Health', width: 10, format: formatHealthStatus },
|
|
586
|
-
{ key: 'cpu', header: 'CPU %', width: 8, align: 'right', format: (v) => `${Number(v).toFixed(1)}%` },
|
|
594
|
+
{ key: 'cpu', header: 'CPU %', width: 8, align: 'right', format: (v) => `${Number(v ?? 0).toFixed(1)}%` },
|
|
587
595
|
{ key: 'memory', header: 'Memory', width: 10, align: 'right', format: (v) => {
|
|
588
596
|
const mem = v;
|
|
597
|
+
if (!mem)
|
|
598
|
+
return '0%';
|
|
589
599
|
return `${(mem.used / mem.limit * 100).toFixed(0)}%`;
|
|
590
600
|
} },
|
|
591
601
|
{ key: 'tasks', header: 'Tasks', width: 12, align: 'right', format: (v) => {
|
|
592
602
|
const t = v;
|
|
593
|
-
|
|
603
|
+
if (!t)
|
|
604
|
+
return '0/0';
|
|
605
|
+
return `${t.active ?? 0}/${t.completed ?? 0}`;
|
|
594
606
|
} }
|
|
595
607
|
],
|
|
596
|
-
data:
|
|
608
|
+
data: healthAgents
|
|
597
609
|
});
|
|
598
|
-
if (detailed &&
|
|
610
|
+
if (detailed && healthAgents.length > 0) {
|
|
599
611
|
output.writeln();
|
|
600
612
|
output.writeln(output.bold('Detailed Metrics'));
|
|
601
|
-
for (const agent of
|
|
613
|
+
for (const agent of healthAgents) {
|
|
602
614
|
output.writeln();
|
|
603
615
|
output.writeln(output.highlight(agent.id));
|
|
616
|
+
const uptime = agent.uptime ?? 0;
|
|
617
|
+
const latency = agent.latency ?? { avg: 0, p99: 0 };
|
|
618
|
+
const tasks = agent.tasks ?? { completed: 0, failed: 0, queued: 0 };
|
|
619
|
+
const errors = agent.errors ?? { count: 0 };
|
|
604
620
|
output.printList([
|
|
605
|
-
`Uptime: ${(
|
|
606
|
-
`Latency: avg ${
|
|
607
|
-
`Tasks: ${
|
|
608
|
-
`Errors: ${
|
|
621
|
+
`Uptime: ${(uptime / 1000 / 60).toFixed(1)} min`,
|
|
622
|
+
`Latency: avg ${(latency.avg ?? 0).toFixed(1)}ms, p99 ${(latency.p99 ?? 0).toFixed(1)}ms`,
|
|
623
|
+
`Tasks: ${tasks.completed ?? 0} completed, ${tasks.failed ?? 0} failed, ${tasks.queued ?? 0} queued`,
|
|
624
|
+
`Errors: ${errors.count ?? 0}${errors.lastError ? ` (${errors.lastError})` : ''}`
|
|
609
625
|
]);
|
|
610
626
|
}
|
|
611
627
|
}
|