@claude-flow/cli 3.0.0-alpha.13 → 3.0.0-alpha.15

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.
Files changed (106) hide show
  1. package/dist/src/commands/doctor.d.ts.map +1 -1
  2. package/dist/src/commands/doctor.js +75 -2
  3. package/dist/src/commands/doctor.js.map +1 -1
  4. package/dist/tsconfig.tsbuildinfo +1 -1
  5. package/package.json +12 -4
  6. package/.agentic-flow/intelligence.json +0 -17
  7. package/.claude-flow/agents/store.json +0 -16
  8. package/.claude-flow/daemon-state.json +0 -123
  9. package/.claude-flow/daemon-test.log +0 -0
  10. package/.claude-flow/daemon.log +0 -0
  11. package/.claude-flow/daemon2.log +0 -0
  12. package/.claude-flow/daemon3.log +0 -0
  13. package/.claude-flow/hive-mind/state.json +0 -51
  14. package/.claude-flow/metrics/agent-metrics.json +0 -1
  15. package/.claude-flow/metrics/codebase-map.json +0 -11
  16. package/.claude-flow/metrics/consolidation.json +0 -6
  17. package/.claude-flow/metrics/performance.json +0 -87
  18. package/.claude-flow/metrics/security-audit.json +0 -10
  19. package/.claude-flow/metrics/task-metrics.json +0 -10
  20. package/.claude-flow/metrics/test-gaps.json +0 -6
  21. package/__tests__/README.md +0 -140
  22. package/__tests__/TEST_SUMMARY.md +0 -144
  23. package/__tests__/cli.test.ts +0 -558
  24. package/__tests__/commands.test.ts +0 -726
  25. package/__tests__/config-adapter.test.ts +0 -362
  26. package/__tests__/config-loading.test.ts +0 -106
  27. package/__tests__/coverage/.tmp/coverage-0.json +0 -1
  28. package/__tests__/coverage/.tmp/coverage-1.json +0 -1
  29. package/__tests__/coverage/.tmp/coverage-2.json +0 -1
  30. package/__tests__/coverage/.tmp/coverage-3.json +0 -1
  31. package/__tests__/coverage/.tmp/coverage-4.json +0 -1
  32. package/__tests__/coverage/.tmp/coverage-5.json +0 -1
  33. package/__tests__/mcp-client.test.ts +0 -480
  34. package/__tests__/p1-commands.test.ts +0 -1064
  35. package/agents/architect.yaml +0 -11
  36. package/agents/coder.yaml +0 -11
  37. package/agents/reviewer.yaml +0 -10
  38. package/agents/security-architect.yaml +0 -10
  39. package/agents/tester.yaml +0 -10
  40. package/docs/CONFIG_LOADING.md +0 -236
  41. package/docs/IMPLEMENTATION_COMPLETE.md +0 -421
  42. package/docs/MCP_CLIENT_GUIDE.md +0 -620
  43. package/docs/REFACTORING_SUMMARY.md +0 -247
  44. package/scripts/publish.sh +0 -46
  45. package/src/commands/agent.ts +0 -955
  46. package/src/commands/claims.ts +0 -317
  47. package/src/commands/completions.ts +0 -558
  48. package/src/commands/config.ts +0 -452
  49. package/src/commands/daemon.ts +0 -621
  50. package/src/commands/deployment.ts +0 -323
  51. package/src/commands/doctor.ts +0 -382
  52. package/src/commands/embeddings.ts +0 -686
  53. package/src/commands/hive-mind.ts +0 -928
  54. package/src/commands/hooks.ts +0 -2603
  55. package/src/commands/index.ts +0 -154
  56. package/src/commands/init.ts +0 -597
  57. package/src/commands/mcp.ts +0 -753
  58. package/src/commands/memory.ts +0 -1161
  59. package/src/commands/migrate.ts +0 -447
  60. package/src/commands/neural.ts +0 -253
  61. package/src/commands/performance.ts +0 -292
  62. package/src/commands/plugins.ts +0 -316
  63. package/src/commands/process.ts +0 -695
  64. package/src/commands/providers.ts +0 -259
  65. package/src/commands/security.ts +0 -288
  66. package/src/commands/session.ts +0 -891
  67. package/src/commands/start.ts +0 -457
  68. package/src/commands/status.ts +0 -736
  69. package/src/commands/swarm.ts +0 -648
  70. package/src/commands/task.ts +0 -792
  71. package/src/commands/workflow.ts +0 -742
  72. package/src/config-adapter.ts +0 -210
  73. package/src/index.ts +0 -443
  74. package/src/infrastructure/in-memory-repositories.ts +0 -310
  75. package/src/init/claudemd-generator.ts +0 -631
  76. package/src/init/executor.ts +0 -762
  77. package/src/init/helpers-generator.ts +0 -628
  78. package/src/init/index.ts +0 -60
  79. package/src/init/mcp-generator.ts +0 -83
  80. package/src/init/settings-generator.ts +0 -284
  81. package/src/init/statusline-generator.ts +0 -211
  82. package/src/init/types.ts +0 -447
  83. package/src/mcp-client.ts +0 -241
  84. package/src/mcp-server.ts +0 -577
  85. package/src/mcp-tools/agent-tools.ts +0 -466
  86. package/src/mcp-tools/config-tools.ts +0 -370
  87. package/src/mcp-tools/hive-mind-tools.ts +0 -521
  88. package/src/mcp-tools/hooks-tools.ts +0 -1888
  89. package/src/mcp-tools/index.ts +0 -16
  90. package/src/mcp-tools/memory-tools.ts +0 -270
  91. package/src/mcp-tools/session-tools.ts +0 -359
  92. package/src/mcp-tools/swarm-tools.ts +0 -105
  93. package/src/mcp-tools/task-tools.ts +0 -347
  94. package/src/mcp-tools/types.ts +0 -33
  95. package/src/mcp-tools/workflow-tools.ts +0 -573
  96. package/src/output.ts +0 -639
  97. package/src/parser.ts +0 -417
  98. package/src/prompt.ts +0 -619
  99. package/src/services/index.ts +0 -15
  100. package/src/services/worker-daemon.ts +0 -726
  101. package/src/suggest.ts +0 -245
  102. package/src/types.ts +0 -287
  103. package/tmp.json +0 -0
  104. package/tsconfig.json +0 -16
  105. package/tsconfig.tsbuildinfo +0 -1
  106. package/vitest.config.ts +0 -13
@@ -1,362 +0,0 @@
1
- /**
2
- * Config Adapter Tests
3
- */
4
-
5
- import { describe, it, expect } from 'vitest';
6
- import { systemConfigToV3Config, v3ConfigToSystemConfig } from '../src/config-adapter.js';
7
- import type { SystemConfig } from '@claude-flow/shared';
8
- import type { V3Config } from '../src/types.js';
9
-
10
- describe('ConfigAdapter', () => {
11
- describe('systemConfigToV3Config', () => {
12
- it('should convert minimal SystemConfig to V3Config', () => {
13
- const systemConfig: SystemConfig = {
14
- orchestrator: {
15
- lifecycle: {
16
- autoStart: true,
17
- maxConcurrentAgents: 10,
18
- shutdownTimeoutMs: 30000,
19
- cleanupOrphanedAgents: true,
20
- },
21
- session: {
22
- dataDir: '/test/data',
23
- persistState: true,
24
- stateFile: 'session.json',
25
- },
26
- monitoring: {
27
- enabled: true,
28
- metricsIntervalMs: 5000,
29
- healthCheckIntervalMs: 10000,
30
- },
31
- },
32
- swarm: {
33
- topology: 'hierarchical-mesh',
34
- maxAgents: 15,
35
- },
36
- memory: {
37
- type: 'hybrid',
38
- },
39
- mcp: {
40
- enabled: true,
41
- transport: {
42
- type: 'stdio',
43
- host: 'localhost',
44
- port: 3000,
45
- },
46
- enabledTools: ['agent/*', 'swarm/*'],
47
- security: {
48
- requireAuth: false,
49
- allowedOrigins: ['*'],
50
- rateLimiting: {
51
- enabled: true,
52
- maxRequestsPerMinute: 100,
53
- },
54
- },
55
- },
56
- logging: {
57
- level: 'info',
58
- pretty: true,
59
- destination: 'console',
60
- format: 'text',
61
- },
62
- hooks: {
63
- enabled: true,
64
- autoExecute: true,
65
- definitions: [],
66
- },
67
- };
68
-
69
- const v3Config = systemConfigToV3Config(systemConfig);
70
-
71
- expect(v3Config.version).toBe('3.0.0');
72
- expect(v3Config.projectRoot).toBe('/test/data');
73
- expect(v3Config.agents.maxConcurrent).toBe(10);
74
- expect(v3Config.agents.autoSpawn).toBe(false); // Default is false for safety
75
- expect(v3Config.swarm.topology).toBe('hybrid'); // 'hierarchical-mesh' normalizes to 'hybrid'
76
- expect(v3Config.swarm.maxAgents).toBe(15);
77
- expect(v3Config.memory.backend).toBe('hybrid');
78
- expect(v3Config.mcp.serverHost).toBe('localhost');
79
- expect(v3Config.mcp.serverPort).toBe(3000);
80
- expect(v3Config.mcp.autoStart).toBe(false); // Default is false for safety
81
- expect(v3Config.cli.colorOutput).toBe(true);
82
- expect(v3Config.cli.verbosity).toBe('normal'); // Default verbosity level
83
- expect(v3Config.hooks.enabled).toBe(false); // Default is false
84
- expect(v3Config.hooks.autoExecute).toBe(false); // Default is false
85
- });
86
-
87
- it('should handle missing optional fields', () => {
88
- const minimalConfig: SystemConfig = {
89
- orchestrator: {
90
- lifecycle: {
91
- autoStart: false,
92
- maxConcurrentAgents: 5,
93
- shutdownTimeoutMs: 30000,
94
- cleanupOrphanedAgents: true,
95
- },
96
- session: {
97
- dataDir: '/data',
98
- persistState: true,
99
- stateFile: 'session.json',
100
- },
101
- monitoring: {
102
- enabled: true,
103
- metricsIntervalMs: 5000,
104
- healthCheckIntervalMs: 10000,
105
- },
106
- },
107
- swarm: {
108
- topology: 'mesh',
109
- maxAgents: 10,
110
- },
111
- memory: {
112
- type: 'sqlite',
113
- },
114
- mcp: {
115
- enabled: false,
116
- transport: {
117
- type: 'http',
118
- host: '127.0.0.1',
119
- port: 8080,
120
- },
121
- enabledTools: [],
122
- security: {
123
- requireAuth: false,
124
- allowedOrigins: ['*'],
125
- rateLimiting: {
126
- enabled: true,
127
- maxRequestsPerMinute: 100,
128
- },
129
- },
130
- },
131
- logging: {
132
- level: 'debug',
133
- pretty: false,
134
- destination: 'file',
135
- format: 'json',
136
- },
137
- hooks: {
138
- enabled: false,
139
- autoExecute: false,
140
- definitions: [],
141
- },
142
- };
143
-
144
- const v3Config = systemConfigToV3Config(minimalConfig);
145
-
146
- expect(v3Config.agents.maxConcurrent).toBe(5);
147
- expect(v3Config.agents.autoSpawn).toBe(false);
148
- expect(v3Config.memory.backend).toBe('sqlite');
149
- expect(v3Config.mcp.autoStart).toBe(false);
150
- expect(v3Config.cli.colorOutput).toBe(true); // Default is always true
151
- });
152
- });
153
-
154
- describe('v3ConfigToSystemConfig', () => {
155
- it('should convert V3Config to SystemConfig', () => {
156
- const v3Config: V3Config = {
157
- version: '3.0.0',
158
- projectRoot: '/test/project',
159
- agents: {
160
- defaultType: 'coder',
161
- autoSpawn: true,
162
- maxConcurrent: 20,
163
- timeout: 60000,
164
- providers: [],
165
- },
166
- swarm: {
167
- topology: 'hierarchical',
168
- maxAgents: 20,
169
- autoScale: true,
170
- coordinationStrategy: 'consensus',
171
- healthCheckInterval: 15000,
172
- },
173
- memory: {
174
- backend: 'agentdb',
175
- persistPath: '/test/memory',
176
- cacheSize: 500000,
177
- enableHNSW: true,
178
- vectorDimension: 768,
179
- },
180
- mcp: {
181
- serverHost: '0.0.0.0',
182
- serverPort: 4000,
183
- autoStart: true,
184
- transportType: 'websocket',
185
- tools: ['memory/*'],
186
- },
187
- cli: {
188
- colorOutput: true,
189
- interactive: true,
190
- verbosity: 'verbose',
191
- outputFormat: 'json',
192
- progressStyle: 'bar',
193
- },
194
- hooks: {
195
- enabled: true,
196
- autoExecute: false,
197
- hooks: [
198
- {
199
- name: 'test-hook',
200
- event: 'pre-task',
201
- handler: '/path/to/handler.js',
202
- priority: 10,
203
- enabled: true,
204
- },
205
- ],
206
- },
207
- };
208
-
209
- const systemConfig = v3ConfigToSystemConfig(v3Config);
210
-
211
- // Core orchestrator conversion (autoStart not mapped)
212
- expect(systemConfig.orchestrator?.lifecycle?.maxConcurrentAgents).toBe(20);
213
- expect(systemConfig.orchestrator?.session?.dataDir).toBe('/test/project');
214
- expect(systemConfig.swarm?.topology).toBe('hierarchical');
215
- expect(systemConfig.swarm?.maxAgents).toBe(20);
216
- expect(systemConfig.swarm?.autoScale?.enabled).toBe(true);
217
- expect(systemConfig.swarm?.coordination?.consensusRequired).toBe(true);
218
- expect(systemConfig.memory?.type).toBe('agentdb');
219
- expect(systemConfig.memory?.path).toBe('/test/memory');
220
- expect(systemConfig.memory?.agentdb?.dimensions).toBe(768);
221
- expect(systemConfig.memory?.agentdb?.indexType).toBe('hnsw');
222
- // MCP enabled not mapped, just transport
223
- expect(systemConfig.mcp?.transport?.type).toBe('websocket');
224
- expect(systemConfig.mcp?.transport?.host).toBe('0.0.0.0');
225
- expect(systemConfig.mcp?.transport?.port).toBe(4000);
226
- // logging and hooks not included in v3ConfigToSystemConfig conversion
227
- });
228
-
229
- it('should handle different coordination strategies', () => {
230
- const leaderConfig: V3Config = {
231
- version: '3.0.0',
232
- projectRoot: '/test',
233
- agents: {
234
- defaultType: 'coder',
235
- autoSpawn: false,
236
- maxConcurrent: 10,
237
- timeout: 30000,
238
- providers: [],
239
- },
240
- swarm: {
241
- topology: 'star',
242
- maxAgents: 10,
243
- autoScale: false,
244
- coordinationStrategy: 'leader',
245
- healthCheckInterval: 5000,
246
- },
247
- memory: {
248
- backend: 'memory',
249
- persistPath: '/data',
250
- cacheSize: 100000,
251
- enableHNSW: false,
252
- vectorDimension: 1536,
253
- },
254
- mcp: {
255
- serverHost: 'localhost',
256
- serverPort: 3000,
257
- autoStart: false,
258
- transportType: 'stdio',
259
- tools: [],
260
- },
261
- cli: {
262
- colorOutput: true,
263
- interactive: true,
264
- verbosity: 'normal',
265
- outputFormat: 'text',
266
- progressStyle: 'spinner',
267
- },
268
- hooks: {
269
- enabled: false,
270
- autoExecute: false,
271
- hooks: [],
272
- },
273
- };
274
-
275
- const systemConfig = v3ConfigToSystemConfig(leaderConfig);
276
-
277
- expect(systemConfig.swarm?.coordination?.consensusRequired).toBe(false);
278
- expect(systemConfig.memory?.agentdb?.indexType).toBe('flat');
279
- });
280
- });
281
-
282
- describe('round-trip conversion', () => {
283
- it('should preserve key config values through round-trip', () => {
284
- const originalSystemConfig: SystemConfig = {
285
- orchestrator: {
286
- lifecycle: {
287
- autoStart: true,
288
- maxConcurrentAgents: 12,
289
- shutdownTimeoutMs: 30000,
290
- cleanupOrphanedAgents: true,
291
- },
292
- session: {
293
- dataDir: '/test/roundtrip',
294
- persistState: true,
295
- stateFile: 'session.json',
296
- },
297
- monitoring: {
298
- enabled: true,
299
- metricsIntervalMs: 5000,
300
- healthCheckIntervalMs: 8000,
301
- },
302
- },
303
- swarm: {
304
- topology: 'hierarchical-mesh',
305
- maxAgents: 12,
306
- },
307
- memory: {
308
- type: 'hybrid',
309
- path: '/test/memory',
310
- agentdb: {
311
- dimensions: 1536,
312
- indexType: 'hnsw',
313
- efConstruction: 200,
314
- m: 16,
315
- quantization: 'none',
316
- },
317
- },
318
- mcp: {
319
- enabled: true,
320
- transport: {
321
- type: 'http',
322
- host: '127.0.0.1',
323
- port: 5000,
324
- },
325
- enabledTools: ['test/*'],
326
- security: {
327
- requireAuth: false,
328
- allowedOrigins: ['*'],
329
- rateLimiting: {
330
- enabled: true,
331
- maxRequestsPerMinute: 100,
332
- },
333
- },
334
- },
335
- logging: {
336
- level: 'warn',
337
- pretty: true,
338
- destination: 'console',
339
- format: 'text',
340
- },
341
- hooks: {
342
- enabled: true,
343
- autoExecute: true,
344
- definitions: [],
345
- },
346
- };
347
-
348
- const v3Config = systemConfigToV3Config(originalSystemConfig);
349
- const roundTripConfig = v3ConfigToSystemConfig(v3Config);
350
-
351
- // Core values preserved through round-trip
352
- expect(roundTripConfig.orchestrator?.lifecycle?.maxConcurrentAgents).toBe(12);
353
- expect(roundTripConfig.swarm?.topology).toBe('hierarchical-mesh');
354
- expect(roundTripConfig.swarm?.maxAgents).toBe(12);
355
- expect(roundTripConfig.memory?.type).toBe('hybrid');
356
- expect(roundTripConfig.memory?.path).toBe('/test/memory');
357
- expect(roundTripConfig.mcp?.transport?.type).toBe('http');
358
- expect(roundTripConfig.mcp?.transport?.port).toBe(5000);
359
- // Note: logging is not included in v3ConfigToSystemConfig
360
- });
361
- });
362
- });
@@ -1,106 +0,0 @@
1
- /**
2
- * Config Loading Integration Tests
3
- */
4
-
5
- import { describe, it, expect, beforeEach, afterEach } from 'vitest';
6
- import { mkdtemp, rm, writeFile } from 'fs/promises';
7
- import { join } from 'path';
8
- import { tmpdir } from 'os';
9
- import { CLI } from '../src/index.js';
10
-
11
- describe('Config Loading', () => {
12
- let tempDir: string;
13
-
14
- beforeEach(async () => {
15
- tempDir = await mkdtemp(join(tmpdir(), 'cli-config-test-'));
16
- });
17
-
18
- afterEach(async () => {
19
- await rm(tempDir, { recursive: true, force: true });
20
- });
21
-
22
- it('should load config from file when specified', async () => {
23
- const configPath = join(tempDir, 'claude-flow.config.json');
24
- const config = {
25
- orchestrator: {
26
- lifecycle: {
27
- autoStart: true,
28
- maxConcurrentAgents: 10,
29
- shutdownTimeoutMs: 30000,
30
- cleanupOrphanedAgents: true,
31
- },
32
- session: {
33
- dataDir: tempDir,
34
- persistState: true,
35
- stateFile: 'session.json',
36
- },
37
- monitoring: {
38
- enabled: true,
39
- metricsIntervalMs: 5000,
40
- healthCheckIntervalMs: 10000,
41
- },
42
- },
43
- swarm: {
44
- topology: 'hierarchical-mesh',
45
- maxAgents: 15,
46
- },
47
- memory: {
48
- type: 'hybrid',
49
- },
50
- mcp: {
51
- enabled: true,
52
- transport: {
53
- type: 'stdio',
54
- host: 'localhost',
55
- port: 3000,
56
- },
57
- enabledTools: [],
58
- security: {
59
- requireAuth: false,
60
- allowedOrigins: ['*'],
61
- rateLimiting: {
62
- enabled: true,
63
- maxRequestsPerMinute: 100,
64
- },
65
- },
66
- },
67
- logging: {
68
- level: 'info',
69
- pretty: true,
70
- destination: 'console',
71
- format: 'text',
72
- },
73
- hooks: {
74
- enabled: true,
75
- autoExecute: false,
76
- definitions: [],
77
- },
78
- };
79
-
80
- await writeFile(configPath, JSON.stringify(config, null, 2));
81
-
82
- // Create CLI instance and verify config loading works
83
- const cli = new CLI();
84
-
85
- // The config loading is tested indirectly through the CLI's run method
86
- // but we've already tested the adapter functions in config-adapter.test.ts
87
- expect(cli).toBeDefined();
88
- });
89
-
90
- it('should handle missing config file gracefully', async () => {
91
- const cli = new CLI();
92
-
93
- // Should not throw when config file doesn't exist
94
- expect(cli).toBeDefined();
95
- });
96
-
97
- it('should handle invalid config file gracefully', async () => {
98
- const configPath = join(tempDir, 'claude-flow.config.json');
99
- await writeFile(configPath, '{ invalid json }');
100
-
101
- const cli = new CLI();
102
-
103
- // Should not throw when config file is invalid
104
- expect(cli).toBeDefined();
105
- });
106
- });
@@ -1 +0,0 @@
1
- {"result":[]}
@@ -1 +0,0 @@
1
- {"result":[]}
@@ -1 +0,0 @@
1
- {"result":[]}
@@ -1 +0,0 @@
1
- {"result":[]}
@@ -1 +0,0 @@
1
- {"result":[]}
@@ -1 +0,0 @@
1
- {"result":[]}