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

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 (102) hide show
  1. package/package.json +12 -4
  2. package/.agentic-flow/intelligence.json +0 -17
  3. package/.claude-flow/agents/store.json +0 -16
  4. package/.claude-flow/daemon-state.json +0 -123
  5. package/.claude-flow/daemon-test.log +0 -0
  6. package/.claude-flow/daemon.log +0 -0
  7. package/.claude-flow/daemon2.log +0 -0
  8. package/.claude-flow/daemon3.log +0 -0
  9. package/.claude-flow/hive-mind/state.json +0 -51
  10. package/.claude-flow/metrics/agent-metrics.json +0 -1
  11. package/.claude-flow/metrics/codebase-map.json +0 -11
  12. package/.claude-flow/metrics/consolidation.json +0 -6
  13. package/.claude-flow/metrics/performance.json +0 -87
  14. package/.claude-flow/metrics/security-audit.json +0 -10
  15. package/.claude-flow/metrics/task-metrics.json +0 -10
  16. package/.claude-flow/metrics/test-gaps.json +0 -6
  17. package/__tests__/README.md +0 -140
  18. package/__tests__/TEST_SUMMARY.md +0 -144
  19. package/__tests__/cli.test.ts +0 -558
  20. package/__tests__/commands.test.ts +0 -726
  21. package/__tests__/config-adapter.test.ts +0 -362
  22. package/__tests__/config-loading.test.ts +0 -106
  23. package/__tests__/coverage/.tmp/coverage-0.json +0 -1
  24. package/__tests__/coverage/.tmp/coverage-1.json +0 -1
  25. package/__tests__/coverage/.tmp/coverage-2.json +0 -1
  26. package/__tests__/coverage/.tmp/coverage-3.json +0 -1
  27. package/__tests__/coverage/.tmp/coverage-4.json +0 -1
  28. package/__tests__/coverage/.tmp/coverage-5.json +0 -1
  29. package/__tests__/mcp-client.test.ts +0 -480
  30. package/__tests__/p1-commands.test.ts +0 -1064
  31. package/agents/architect.yaml +0 -11
  32. package/agents/coder.yaml +0 -11
  33. package/agents/reviewer.yaml +0 -10
  34. package/agents/security-architect.yaml +0 -10
  35. package/agents/tester.yaml +0 -10
  36. package/docs/CONFIG_LOADING.md +0 -236
  37. package/docs/IMPLEMENTATION_COMPLETE.md +0 -421
  38. package/docs/MCP_CLIENT_GUIDE.md +0 -620
  39. package/docs/REFACTORING_SUMMARY.md +0 -247
  40. package/scripts/publish.sh +0 -46
  41. package/src/commands/agent.ts +0 -955
  42. package/src/commands/claims.ts +0 -317
  43. package/src/commands/completions.ts +0 -558
  44. package/src/commands/config.ts +0 -452
  45. package/src/commands/daemon.ts +0 -621
  46. package/src/commands/deployment.ts +0 -323
  47. package/src/commands/doctor.ts +0 -382
  48. package/src/commands/embeddings.ts +0 -686
  49. package/src/commands/hive-mind.ts +0 -928
  50. package/src/commands/hooks.ts +0 -2603
  51. package/src/commands/index.ts +0 -154
  52. package/src/commands/init.ts +0 -597
  53. package/src/commands/mcp.ts +0 -753
  54. package/src/commands/memory.ts +0 -1161
  55. package/src/commands/migrate.ts +0 -447
  56. package/src/commands/neural.ts +0 -253
  57. package/src/commands/performance.ts +0 -292
  58. package/src/commands/plugins.ts +0 -316
  59. package/src/commands/process.ts +0 -695
  60. package/src/commands/providers.ts +0 -259
  61. package/src/commands/security.ts +0 -288
  62. package/src/commands/session.ts +0 -891
  63. package/src/commands/start.ts +0 -457
  64. package/src/commands/status.ts +0 -736
  65. package/src/commands/swarm.ts +0 -648
  66. package/src/commands/task.ts +0 -792
  67. package/src/commands/workflow.ts +0 -742
  68. package/src/config-adapter.ts +0 -210
  69. package/src/index.ts +0 -443
  70. package/src/infrastructure/in-memory-repositories.ts +0 -310
  71. package/src/init/claudemd-generator.ts +0 -631
  72. package/src/init/executor.ts +0 -762
  73. package/src/init/helpers-generator.ts +0 -628
  74. package/src/init/index.ts +0 -60
  75. package/src/init/mcp-generator.ts +0 -83
  76. package/src/init/settings-generator.ts +0 -284
  77. package/src/init/statusline-generator.ts +0 -211
  78. package/src/init/types.ts +0 -447
  79. package/src/mcp-client.ts +0 -241
  80. package/src/mcp-server.ts +0 -577
  81. package/src/mcp-tools/agent-tools.ts +0 -466
  82. package/src/mcp-tools/config-tools.ts +0 -370
  83. package/src/mcp-tools/hive-mind-tools.ts +0 -521
  84. package/src/mcp-tools/hooks-tools.ts +0 -1888
  85. package/src/mcp-tools/index.ts +0 -16
  86. package/src/mcp-tools/memory-tools.ts +0 -270
  87. package/src/mcp-tools/session-tools.ts +0 -359
  88. package/src/mcp-tools/swarm-tools.ts +0 -105
  89. package/src/mcp-tools/task-tools.ts +0 -347
  90. package/src/mcp-tools/types.ts +0 -33
  91. package/src/mcp-tools/workflow-tools.ts +0 -573
  92. package/src/output.ts +0 -639
  93. package/src/parser.ts +0 -417
  94. package/src/prompt.ts +0 -619
  95. package/src/services/index.ts +0 -15
  96. package/src/services/worker-daemon.ts +0 -726
  97. package/src/suggest.ts +0 -245
  98. package/src/types.ts +0 -287
  99. package/tmp.json +0 -0
  100. package/tsconfig.json +0 -16
  101. package/tsconfig.tsbuildinfo +0 -1
  102. package/vitest.config.ts +0 -13
@@ -1,11 +0,0 @@
1
- # architect agent configuration
2
- type: architect
3
- version: "3.0.0"
4
- capabilities:
5
- - system-design
6
- - api-design
7
- - documentation
8
- optimizations:
9
- - context-caching
10
- - memory-persistence
11
- createdAt: "2026-01-07T04:38:55.779Z"
package/agents/coder.yaml DELETED
@@ -1,11 +0,0 @@
1
- # coder agent configuration
2
- type: coder
3
- version: "3.0.0"
4
- capabilities:
5
- - code-generation
6
- - refactoring
7
- - debugging
8
- optimizations:
9
- - flash-attention
10
- - token-reduction
11
- createdAt: "2026-01-07T04:38:55.778Z"
@@ -1,10 +0,0 @@
1
- # reviewer agent configuration
2
- type: reviewer
3
- version: "3.0.0"
4
- capabilities:
5
- - code-review
6
- - quality-analysis
7
- - best-practices
8
- optimizations:
9
- - incremental-analysis
10
- createdAt: "2026-01-07T04:38:55.779Z"
@@ -1,10 +0,0 @@
1
- # security-architect agent configuration
2
- type: security-architect
3
- version: "3.0.0"
4
- capabilities:
5
- - threat-modeling
6
- - vulnerability-analysis
7
- - security-review
8
- optimizations:
9
- - pattern-matching
10
- createdAt: "2026-01-07T04:38:55.779Z"
@@ -1,10 +0,0 @@
1
- # tester agent configuration
2
- type: tester
3
- version: "3.0.0"
4
- capabilities:
5
- - unit-testing
6
- - integration-testing
7
- - coverage
8
- optimizations:
9
- - parallel-execution
10
- createdAt: "2026-01-07T04:38:55.779Z"
@@ -1,236 +0,0 @@
1
- # CLI Configuration Loading
2
-
3
- ## Overview
4
-
5
- The CLI module now supports loading configuration from multiple sources with proper validation and type conversion.
6
-
7
- ## Implementation
8
-
9
- ### Files Added/Modified
10
-
11
- 1. **`src/config-adapter.ts`** (NEW)
12
- - Converts between `SystemConfig` (from `@claude-flow/shared`) and `V3Config` (CLI-specific format)
13
- - Provides bidirectional conversion functions:
14
- - `systemConfigToV3Config()` - Convert SystemConfig to V3Config
15
- - `v3ConfigToSystemConfig()` - Convert V3Config to SystemConfig
16
-
17
- 2. **`src/index.ts`** (MODIFIED)
18
- - Implemented `loadConfig()` method (previously TODO)
19
- - Loads configuration from file or default search paths
20
- - Handles errors gracefully (config loading is optional)
21
- - Displays warnings when config validation fails
22
-
23
- 3. **`__tests__/config-adapter.test.ts`** (NEW)
24
- - Unit tests for config conversion functions
25
- - Tests minimal configs, missing fields, and round-trip conversion
26
- - Verifies different coordination strategies
27
-
28
- 4. **`__tests__/config-loading.test.ts`** (NEW)
29
- - Integration tests for config loading
30
- - Tests file loading, missing files, and invalid JSON
31
-
32
- ## Configuration Sources
33
-
34
- The CLI loads configuration in the following priority order:
35
-
36
- 1. **Explicit file path** - When `--config` flag is provided
37
- 2. **Auto-discovery** - Searches for config files in:
38
- - Current working directory
39
- - Parent directory
40
- - `~/.claude-flow/`
41
-
42
- ### Supported Config Files
43
-
44
- - `claude-flow.config.json`
45
- - `claude-flow.config.js`
46
- - `claude-flow.json`
47
- - `.claude-flow.json`
48
-
49
- ## Environment Variables
50
-
51
- Configuration can also be overridden via environment variables:
52
-
53
- - `CLAUDE_FLOW_MAX_AGENTS` - Maximum concurrent agents
54
- - `CLAUDE_FLOW_DATA_DIR` - Data directory path
55
- - `CLAUDE_FLOW_MEMORY_TYPE` - Memory backend type
56
- - `CLAUDE_FLOW_MCP_TRANSPORT` - MCP transport type
57
- - `CLAUDE_FLOW_MCP_PORT` - MCP server port
58
- - `CLAUDE_FLOW_SWARM_TOPOLOGY` - Swarm topology type
59
-
60
- ## Configuration Schema
61
-
62
- ### V3Config (CLI Format)
63
-
64
- ```typescript
65
- interface V3Config {
66
- version: string;
67
- projectRoot: string;
68
-
69
- agents: {
70
- defaultType: string;
71
- autoSpawn: boolean;
72
- maxConcurrent: number;
73
- timeout: number;
74
- providers: ProviderConfig[];
75
- };
76
-
77
- swarm: {
78
- topology: 'hierarchical' | 'mesh' | 'ring' | 'star' | 'hybrid';
79
- maxAgents: number;
80
- autoScale: boolean;
81
- coordinationStrategy: 'consensus' | 'leader' | 'distributed';
82
- healthCheckInterval: number;
83
- };
84
-
85
- memory: {
86
- backend: 'agentdb' | 'sqlite' | 'memory' | 'hybrid';
87
- persistPath: string;
88
- cacheSize: number;
89
- enableHNSW: boolean;
90
- vectorDimension: number;
91
- };
92
-
93
- mcp: {
94
- serverHost: string;
95
- serverPort: number;
96
- autoStart: boolean;
97
- transportType: 'stdio' | 'http' | 'websocket';
98
- tools: string[];
99
- };
100
-
101
- cli: {
102
- colorOutput: boolean;
103
- interactive: boolean;
104
- verbosity: 'quiet' | 'normal' | 'verbose' | 'debug';
105
- outputFormat: 'text' | 'json' | 'table';
106
- progressStyle: 'bar' | 'spinner' | 'dots' | 'none';
107
- };
108
-
109
- hooks: {
110
- enabled: boolean;
111
- autoExecute: boolean;
112
- hooks: HookDefinition[];
113
- };
114
- }
115
- ```
116
-
117
- ## Usage Examples
118
-
119
- ### Command Line
120
-
121
- ```bash
122
- # Use default config search paths
123
- claude-flow agent spawn -t coder
124
-
125
- # Use specific config file
126
- claude-flow agent spawn -t coder --config ./custom-config.json
127
-
128
- # Override with environment variables
129
- CLAUDE_FLOW_MAX_AGENTS=20 claude-flow swarm init
130
- ```
131
-
132
- ### Example Config File
133
-
134
- ```json
135
- {
136
- "orchestrator": {
137
- "lifecycle": {
138
- "autoStart": true,
139
- "maxConcurrentAgents": 15,
140
- "shutdownTimeoutMs": 30000,
141
- "cleanupOrphanedAgents": true
142
- },
143
- "session": {
144
- "dataDir": "./data",
145
- "persistState": true,
146
- "stateFile": "session.json"
147
- },
148
- "monitoring": {
149
- "enabled": true,
150
- "metricsIntervalMs": 5000,
151
- "healthCheckIntervalMs": 10000
152
- }
153
- },
154
- "swarm": {
155
- "topology": "hierarchical-mesh",
156
- "maxAgents": 15
157
- },
158
- "memory": {
159
- "type": "hybrid",
160
- "agentdb": {
161
- "dimensions": 1536,
162
- "indexType": "hnsw"
163
- }
164
- },
165
- "mcp": {
166
- "enabled": true,
167
- "transport": {
168
- "type": "stdio",
169
- "host": "localhost",
170
- "port": 3000
171
- },
172
- "enabledTools": ["agent/*", "swarm/*", "memory/*"]
173
- },
174
- "logging": {
175
- "level": "info",
176
- "pretty": true,
177
- "destination": "console",
178
- "format": "text"
179
- },
180
- "hooks": {
181
- "enabled": true,
182
- "autoExecute": false,
183
- "definitions": []
184
- }
185
- }
186
- ```
187
-
188
- ## Error Handling
189
-
190
- The config loading implementation handles errors gracefully:
191
-
192
- 1. **File not found** - Falls back to default configuration
193
- 2. **Invalid JSON** - Logs warning and uses defaults
194
- 3. **Validation errors** - Displays warnings for invalid fields
195
- 4. **Missing required fields** - Merges with default values
196
-
197
- Debug mode (`DEBUG=1`) provides additional error details.
198
-
199
- ## Testing
200
-
201
- All tests pass successfully:
202
-
203
- ```bash
204
- # Run config adapter unit tests
205
- npx vitest run __tests__/config-adapter.test.ts
206
-
207
- # Run config loading integration tests
208
- npx vitest run __tests__/config-loading.test.ts
209
- ```
210
-
211
- ### Test Coverage
212
-
213
- - ✅ SystemConfig to V3Config conversion
214
- - ✅ V3Config to SystemConfig conversion
215
- - ✅ Round-trip conversion preserves values
216
- - ✅ Handles missing optional fields
217
- - ✅ Different coordination strategies
218
- - ✅ File loading
219
- - ✅ Missing file handling
220
- - ✅ Invalid JSON handling
221
-
222
- ## Architecture Decisions
223
-
224
- 1. **Adapter Pattern** - Separates SystemConfig (shared) from V3Config (CLI-specific)
225
- 2. **Optional Loading** - Config files are optional, failures don't crash CLI
226
- 3. **Validation** - Uses existing Zod schemas from `@claude-flow/shared`
227
- 4. **Merge Strategy** - Merges loaded config with defaults
228
- 5. **Environment Priority** - Environment variables override file config
229
-
230
- ## Future Enhancements
231
-
232
- - [ ] TypeScript config support (`.ts` files)
233
- - [ ] Config validation command (`claude-flow config validate`)
234
- - [ ] Config migration tool (v2 → v3)
235
- - [ ] Interactive config setup wizard
236
- - [ ] Schema documentation generation