claude-flow 2.7.33 → 2.7.35

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 (99) hide show
  1. package/.claude/settings.local.json +9 -2
  2. package/.claude/skills/agentic-jujutsu/SKILL.md +1 -1
  3. package/CHANGELOG.md +140 -0
  4. package/bin/claude-flow +1 -1
  5. package/dist/src/cli/commands/mcp.js +61 -7
  6. package/dist/src/cli/commands/mcp.js.map +1 -1
  7. package/dist/src/cli/init/index.js +55 -33
  8. package/dist/src/cli/init/index.js.map +1 -1
  9. package/dist/src/cli/simple-cli.js +182 -172
  10. package/dist/src/cli/simple-cli.js.map +1 -1
  11. package/dist/src/cli/simple-commands/init/agent-copier.js +9 -3
  12. package/dist/src/cli/simple-commands/init/agent-copier.js.map +1 -1
  13. package/dist/src/core/DatabaseManager.js +39 -9
  14. package/dist/src/core/DatabaseManager.js.map +1 -1
  15. package/dist/src/mcp/async/job-manager-mcp25.js +240 -0
  16. package/dist/src/mcp/async/job-manager-mcp25.js.map +1 -0
  17. package/dist/src/mcp/index.js +8 -0
  18. package/dist/src/mcp/index.js.map +1 -1
  19. package/dist/src/mcp/protocol/version-negotiation.js +182 -0
  20. package/dist/src/mcp/protocol/version-negotiation.js.map +1 -0
  21. package/dist/src/mcp/registry/mcp-registry-client-2025.js +210 -0
  22. package/dist/src/mcp/registry/mcp-registry-client-2025.js.map +1 -0
  23. package/dist/src/mcp/server-factory.js +189 -0
  24. package/dist/src/mcp/server-factory.js.map +1 -0
  25. package/dist/src/mcp/server-mcp-2025.js +283 -0
  26. package/dist/src/mcp/server-mcp-2025.js.map +1 -0
  27. package/dist/src/mcp/tool-registry-progressive.js +319 -0
  28. package/dist/src/mcp/tool-registry-progressive.js.map +1 -0
  29. package/dist/src/mcp/tools/_template.js +62 -0
  30. package/dist/src/mcp/tools/_template.js.map +1 -0
  31. package/dist/src/mcp/tools/loader.js +228 -0
  32. package/dist/src/mcp/tools/loader.js.map +1 -0
  33. package/dist/src/mcp/tools/system/search.js +224 -0
  34. package/dist/src/mcp/tools/system/search.js.map +1 -0
  35. package/dist/src/mcp/tools/system/status.js +168 -0
  36. package/dist/src/mcp/tools/system/status.js.map +1 -0
  37. package/dist/src/mcp/validation/schema-validator-2025.js +198 -0
  38. package/dist/src/mcp/validation/schema-validator-2025.js.map +1 -0
  39. package/dist/src/utils/error-recovery.js +215 -0
  40. package/dist/src/utils/error-recovery.js.map +1 -0
  41. package/dist/src/utils/metrics-reader.js +10 -0
  42. package/dist/src/utils/metrics-reader.js.map +1 -1
  43. package/docs/.claude-flow/metrics/performance.json +3 -3
  44. package/docs/.claude-flow/metrics/task-metrics.json +3 -3
  45. package/docs/.github-release-issue-v2.7.33.md +488 -0
  46. package/docs/AGENTDB_BRANCH_MERGE_VERIFICATION.md +436 -0
  47. package/docs/AUTOMATIC_ERROR_RECOVERY_v2.7.35.md +321 -0
  48. package/docs/BRANCH_REVIEW_SUMMARY.md +439 -0
  49. package/docs/CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md +384 -0
  50. package/docs/DEEP_CODE_REVIEW_v2.7.33.md +1159 -0
  51. package/docs/DOCKER_TEST_RESULTS_v2.7.35.md +305 -0
  52. package/docs/MCP_2025_FEATURE_CONFIRMATION.md +698 -0
  53. package/docs/NPM_PUBLISH_GUIDE_v2.7.33.md +628 -0
  54. package/docs/REGRESSION_TEST_REPORT_v2.7.33.md +397 -0
  55. package/docs/RELEASE_NOTES_v2.7.33.md +618 -0
  56. package/docs/RELEASE_READINESS_SUMMARY.md +377 -0
  57. package/docs/RELEASE_SUMMARY_v2.7.33.md +456 -0
  58. package/docs/agentic-flow-agentdb-mcp-integration.md +1198 -0
  59. package/docs/features/automatic-error-recovery.md +333 -0
  60. package/docs/github-issues/README.md +88 -0
  61. package/docs/github-issues/wsl-enotempty-automatic-recovery.md +470 -0
  62. package/docs/mcp-2025-implementation-summary.md +459 -0
  63. package/docs/mcp-spec-2025-implementation-plan.md +1330 -0
  64. package/docs/phase-1-2-implementation-summary.md +676 -0
  65. package/docs/regression-analysis-phase-1-2.md +555 -0
  66. package/docs/troubleshooting/wsl-better-sqlite3-error.md +239 -0
  67. package/package.json +5 -2
  68. package/scripts/create-github-issue.sh +64 -0
  69. package/scripts/test-docker-wsl.sh +198 -0
  70. package/src/cli/commands/mcp.ts +86 -9
  71. package/src/cli/init/index.ts +72 -42
  72. package/src/cli/simple-commands/init/agent-copier.js +10 -5
  73. package/src/core/DatabaseManager.ts +55 -9
  74. package/src/mcp/async/job-manager-mcp25.ts +456 -0
  75. package/src/mcp/index.ts +60 -0
  76. package/src/mcp/protocol/version-negotiation.ts +329 -0
  77. package/src/mcp/registry/mcp-registry-client-2025.ts +334 -0
  78. package/src/mcp/server-factory.ts +426 -0
  79. package/src/mcp/server-mcp-2025.ts +507 -0
  80. package/src/mcp/tool-registry-progressive.ts +539 -0
  81. package/src/mcp/tools/_template.ts +174 -0
  82. package/src/mcp/tools/loader.ts +362 -0
  83. package/src/mcp/tools/system/search.ts +276 -0
  84. package/src/mcp/tools/system/status.ts +206 -0
  85. package/src/mcp/validation/schema-validator-2025.ts +294 -0
  86. package/src/utils/error-recovery.ts +325 -0
  87. package/docs/AGENTDB_V1.6.1_DEEP_REVIEW.md +0 -386
  88. package/docs/AGENT_FOLDER_STRUCTURE_FIX.md +0 -192
  89. package/docs/RECENT_RELEASES_SUMMARY.md +0 -375
  90. package/docs/V2.7.31_RELEASE_NOTES.md +0 -375
  91. /package/.claude/agents/analysis/{analyze-code-quality.md → code-review/analyze-code-quality.md} +0 -0
  92. /package/.claude/agents/architecture/{arch-system-design.md → system-design/arch-system-design.md} +0 -0
  93. /package/.claude/agents/data/{data-ml-model.md → ml/data-ml-model.md} +0 -0
  94. /package/.claude/agents/development/{dev-backend-api.md → backend/dev-backend-api.md} +0 -0
  95. /package/.claude/agents/devops/{ops-cicd-github.md → ci-cd/ops-cicd-github.md} +0 -0
  96. /package/.claude/agents/documentation/{docs-api-openapi.md → api-docs/docs-api-openapi.md} +0 -0
  97. /package/.claude/agents/specialized/{spec-mobile-react-native.md → mobile/spec-mobile-react-native.md} +0 -0
  98. /package/.claude/agents/testing/{tdd-london-swarm.md → unit/tdd-london-swarm.md} +0 -0
  99. /package/.claude/agents/testing/{production-validator.md → validation/production-validator.md} +0 -0
@@ -0,0 +1,333 @@
1
+ # Automatic Error Recovery
2
+
3
+ Claude-Flow v2.7.35+ includes intelligent automatic error recovery that handles common installation and initialization issues without manual intervention.
4
+
5
+ ## Overview
6
+
7
+ The error recovery system automatically detects and fixes:
8
+
9
+ - ✅ **npm/npx cache errors** (ENOTEMPTY, better-sqlite3 issues)
10
+ - ✅ **WSL-specific problems** (Windows Subsystem for Linux)
11
+ - ✅ **Database initialization failures** (SQLite fallback to JSON)
12
+ - ✅ **Dependency installation issues**
13
+ - ✅ **Permission and file locking problems**
14
+
15
+ ## How It Works
16
+
17
+ ### 1. Error Detection
18
+
19
+ The system automatically detects common error patterns:
20
+
21
+ ```typescript
22
+ // Detects npm cache errors
23
+ if (error.includes('ENOTEMPTY') && error.includes('npm')) {
24
+ // Automatic recovery triggered
25
+ }
26
+
27
+ // Detects better-sqlite3 issues
28
+ if (error.includes('better-sqlite3')) {
29
+ // Automatic recovery triggered
30
+ }
31
+ ```
32
+
33
+ ### 2. Automatic Recovery Actions
34
+
35
+ When an error is detected, the system:
36
+
37
+ 1. **Cleans npm/npx cache** (`npm cache clean --force`)
38
+ 2. **Removes corrupted cache directories** (`~/.npm/_npx`)
39
+ 3. **Fixes file permissions** (WSL-specific)
40
+ 4. **Applies WSL optimizations** (if running on WSL)
41
+ 5. **Retries the operation** with exponential backoff
42
+
43
+ ### 3. Retry Logic
44
+
45
+ ```typescript
46
+ // Automatic retry with backoff
47
+ retryWithRecovery(operation, {
48
+ maxRetries: 5, // Try up to 5 times
49
+ delay: 1000, // Start with 1s delay
50
+ exponentialBackoff: true // 1s, 2s, 4s, 8s, 16s
51
+ });
52
+ ```
53
+
54
+ ### 4. Intelligent Fallback
55
+
56
+ If SQLite continues to fail:
57
+
58
+ ```typescript
59
+ // Automatic fallback to JSON storage
60
+ if (sqliteInitFails && retries > maxRetries) {
61
+ console.log('🔄 Switching to JSON storage...');
62
+ switchToJSONProvider();
63
+ }
64
+ ```
65
+
66
+ ## Using Error Recovery
67
+
68
+ ### Automatic (Default)
69
+
70
+ ```bash
71
+ # Standard initialization with automatic recovery
72
+ npx claude-flow@alpha init
73
+
74
+ # Force mode with extended retries (5 attempts)
75
+ npx claude-flow@alpha init --force
76
+ ```
77
+
78
+ ### Manual Recovery Commands
79
+
80
+ For advanced users, manual recovery tools are also available:
81
+
82
+ ```bash
83
+ # Clean npm cache manually
84
+ npm cache clean --force
85
+ rm -rf ~/.npm/_npx
86
+
87
+ # Check WSL environment
88
+ npx claude-flow@alpha diagnose --wsl
89
+
90
+ # Verify dependencies
91
+ npx claude-flow@alpha verify --deps
92
+ ```
93
+
94
+ ## Recovery Process Flow
95
+
96
+ ```
97
+ ┌─────────────────────────┐
98
+ │ Initialize Command │
99
+ └───────────┬─────────────┘
100
+
101
+
102
+ ┌─────────────────────────┐
103
+ │ Detect WSL? Apply Fixes│
104
+ └───────────┬─────────────┘
105
+
106
+
107
+ ┌─────────────────────────┐
108
+ │ Run Initialization │
109
+ └───────────┬─────────────┘
110
+
111
+
112
+ Error Detected?
113
+
114
+ ┌───────┴───────┐
115
+ │ │
116
+ Yes No
117
+ │ │
118
+ ▼ ▼
119
+ ┌─────────────┐ Success!
120
+ │ Is Npm Cache│
121
+ │ Error? │
122
+ └─────┬───────┘
123
+
124
+ Yes
125
+
126
+
127
+ ┌─────────────────────────┐
128
+ │ Clean npm/npx cache │
129
+ │ Fix permissions │
130
+ │ Apply WSL optimizations │
131
+ └───────────┬─────────────┘
132
+
133
+
134
+ ┌─────────────────────────┐
135
+ │ Retry with Backoff │
136
+ │ (Attempt N/5) │
137
+ └───────────┬─────────────┘
138
+
139
+
140
+ Max Retries?
141
+
142
+ ┌───────┴───────┐
143
+ │ │
144
+ Yes No
145
+ │ │
146
+ ▼ ▼
147
+ ┌─────────────┐ Try Again
148
+ │ Fallback to │
149
+ │ JSON Storage│
150
+ └─────────────┘
151
+ ```
152
+
153
+ ## WSL-Specific Recovery
154
+
155
+ ### Automatic WSL Detection
156
+
157
+ ```typescript
158
+ // Automatic WSL detection
159
+ if (process.platform === 'linux') {
160
+ const isWSL = fs.readFileSync('/proc/version', 'utf8')
161
+ .toLowerCase()
162
+ .includes('microsoft');
163
+
164
+ if (isWSL) {
165
+ applyWSLOptimizations();
166
+ }
167
+ }
168
+ ```
169
+
170
+ ### WSL Optimizations Applied
171
+
172
+ 1. **Cache cleanup** with force flags
173
+ 2. **Permission fixes** (`chmod -R 755 ~/.npm`)
174
+ 3. **Filesystem warnings** (running from `/mnt/c/`)
175
+ 4. **Build tools check** (gcc, python3)
176
+
177
+ ## Configuration
178
+
179
+ ### Retry Settings
180
+
181
+ ```typescript
182
+ // In your code or configuration
183
+ export interface RetryOptions {
184
+ maxRetries?: number; // Default: 3 (5 with --force)
185
+ delay?: number; // Default: 1000ms
186
+ exponentialBackoff?: boolean; // Default: true
187
+ cleanupFn?: () => Promise<void>; // Custom cleanup
188
+ }
189
+ ```
190
+
191
+ ### Error Recovery Settings
192
+
193
+ ```json
194
+ // .claude-flow/config.json
195
+ {
196
+ "errorRecovery": {
197
+ "enabled": true,
198
+ "maxRetries": 5,
199
+ "cleanCacheOnError": true,
200
+ "wslOptimizations": true,
201
+ "fallbackToJSON": true
202
+ }
203
+ }
204
+ ```
205
+
206
+ ## Logging and Debugging
207
+
208
+ ### Recovery Log Output
209
+
210
+ ```bash
211
+ npx claude-flow@alpha init --force
212
+
213
+ 🔍 WSL environment detected
214
+ ✅ WSL environment optimized
215
+
216
+ 📁 Phase 1: Creating directory structure...
217
+ ⚠️ Detected npm cache error (attempt 1/5)
218
+ 🧹 Cleaning npm cache...
219
+ ✅ npm cache cleaned
220
+ 🗑️ Removing npx cache: /home/user/.npm/_npx
221
+ ✅ npx cache removed
222
+ ✅ npm directory permissions fixed
223
+ ✅ Cache cleaned, retrying...
224
+
225
+ 🔄 Retry attempt 1 after error recovery...
226
+ ✅ Recovered from error, retrying initialization...
227
+
228
+ 📁 Phase 1: Creating directory structure...
229
+ ⚙️ Phase 2: Creating configuration...
230
+ 🎉 Project initialized successfully!
231
+ ```
232
+
233
+ ### Debug Mode
234
+
235
+ ```bash
236
+ # Enable verbose error recovery logging
237
+ DEBUG=claude-flow:error-recovery npx claude-flow@alpha init --force
238
+ ```
239
+
240
+ ## API Usage
241
+
242
+ ### Programmatic Error Recovery
243
+
244
+ ```typescript
245
+ import { errorRecovery } from 'claude-flow/utils/error-recovery';
246
+
247
+ // Check if error is recoverable
248
+ if (errorRecovery.isNpmCacheError(error)) {
249
+ // Clean cache
250
+ await errorRecovery.cleanNpmCache();
251
+
252
+ // Retry operation
253
+ await errorRecovery.retryWithRecovery(myOperation, {
254
+ maxRetries: 5,
255
+ delay: 1000
256
+ });
257
+ }
258
+ ```
259
+
260
+ ### Custom Recovery Functions
261
+
262
+ ```typescript
263
+ // Custom cleanup function
264
+ await errorRecovery.retryWithRecovery(
265
+ async () => {
266
+ return await myOperation();
267
+ },
268
+ {
269
+ maxRetries: 3,
270
+ cleanupFn: async () => {
271
+ // Custom cleanup logic
272
+ await fs.remove('./temp-files');
273
+ await clearCustomCache();
274
+ }
275
+ }
276
+ );
277
+ ```
278
+
279
+ ## Performance Impact
280
+
281
+ Error recovery adds minimal overhead:
282
+
283
+ - **No overhead** when no errors occur
284
+ - **~500ms** for cache cleanup (when needed)
285
+ - **1-2s total** for retry with backoff
286
+ - **Faster overall** than manual troubleshooting
287
+
288
+ ## Troubleshooting
289
+
290
+ ### Recovery Still Failing?
291
+
292
+ 1. **Check WSL version**: Use WSL2 (not WSL1)
293
+ ```bash
294
+ wsl --list --verbose
295
+ wsl --set-version Ubuntu 2
296
+ ```
297
+
298
+ 2. **Install build tools**:
299
+ ```bash
300
+ sudo apt-get update
301
+ sudo apt-get install -y build-essential python3
302
+ ```
303
+
304
+ 3. **Use WSL filesystem** (not `/mnt/c/`):
305
+ ```bash
306
+ cd ~/projects # Good
307
+ cd /mnt/c/Users/name/project # Bad
308
+ ```
309
+
310
+ 4. **Manual cache cleanup**:
311
+ ```bash
312
+ sudo npm cache clean --force
313
+ sudo rm -rf ~/.npm
314
+ ```
315
+
316
+ ## Related Documentation
317
+
318
+ - [WSL Troubleshooting Guide](../troubleshooting/wsl-better-sqlite3-error.md)
319
+ - [Installation Guide](../setup/installation.md)
320
+ - [Configuration Reference](../reference/configuration.md)
321
+
322
+ ## Changelog
323
+
324
+ ### v2.7.35
325
+ - ✅ Added automatic error recovery system
326
+ - ✅ WSL-specific error detection and fixes
327
+ - ✅ Intelligent retry with exponential backoff
328
+ - ✅ Automatic fallback to JSON storage
329
+ - ✅ npm/npx cache auto-cleanup
330
+
331
+ ---
332
+
333
+ **Need Help?** Report issues at https://github.com/ruvnet/claude-flow/issues
@@ -0,0 +1,88 @@
1
+ # GitHub Issue Templates
2
+
3
+ This directory contains ready-to-use GitHub issue templates for documenting fixes and features.
4
+
5
+ ## Available Templates
6
+
7
+ ### WSL ENOTEMPTY Automatic Recovery
8
+
9
+ **File**: `wsl-enotempty-automatic-recovery.md`
10
+
11
+ **Purpose**: Document the automatic error recovery implementation for WSL better-sqlite3 ENOTEMPTY errors
12
+
13
+ **Usage**:
14
+ ```bash
15
+ # Automated (requires gh CLI)
16
+ bash scripts/create-github-issue.sh
17
+
18
+ # Manual
19
+ 1. Go to https://github.com/ruvnet/claude-flow/issues/new
20
+ 2. Copy content from: docs/github-issues/wsl-enotempty-automatic-recovery.md
21
+ 3. Paste into issue body
22
+ 4. Add labels: enhancement, bug-fix, wsl, user-experience, v2.7.35
23
+ 5. Set milestone: v2.7.35
24
+ 6. Submit
25
+ ```
26
+
27
+ **Before Submitting**:
28
+ - [x] ✅ Confirm fix works in Docker (DONE - 100% pass rate)
29
+ - [x] ✅ Update test results section with actual data (DONE)
30
+ - [ ] Add screenshots if available
31
+ - [ ] Review and customize template as needed
32
+
33
+ ---
34
+
35
+ ## Test Results Summary
36
+
37
+ ### Docker Tests Completed ✅
38
+
39
+ | Test | Status | Date |
40
+ |------|--------|------|
41
+ | Ubuntu 22.04 Clean Install | ✅ PASS | 2025-11-13 |
42
+ | Debian 12 Cross-Distro | ✅ PASS | 2025-11-13 |
43
+ | Corrupted Cache Recovery | ✅ PASS | 2025-11-13 |
44
+ | Overall Success Rate | 100% | 2025-11-13 |
45
+
46
+ **Details**: See `docs/DOCKER_TEST_RESULTS_v2.7.35.md`
47
+
48
+ ---
49
+
50
+ ## Quick Reference
51
+
52
+ ### Issue Creation Checklist
53
+
54
+ - [ ] Tests passing (100%)
55
+ - [ ] Documentation updated
56
+ - [ ] Changelog entry prepared
57
+ - [ ] Screenshots captured (optional)
58
+ - [ ] Test results in template
59
+ - [ ] Labels assigned
60
+ - [ ] Milestone set
61
+ - [ ] Reviewers assigned
62
+
63
+ ### Recommended Labels
64
+
65
+ - `enhancement` - New feature or improvement
66
+ - `bug-fix` - Fixes an existing issue
67
+ - `wsl` - WSL-specific
68
+ - `user-experience` - Improves UX
69
+ - `v2.7.35` - Version tag
70
+
71
+ ### Recommended Milestone
72
+
73
+ - **v2.7.35** - Automatic Error Recovery Release
74
+
75
+ ---
76
+
77
+ ## Related Documentation
78
+
79
+ - [Implementation Summary](../AUTOMATIC_ERROR_RECOVERY_v2.7.35.md)
80
+ - [Docker Test Results](../DOCKER_TEST_RESULTS_v2.7.35.md)
81
+ - [Confirmation Document](../CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md)
82
+ - [Feature Documentation](../features/automatic-error-recovery.md)
83
+ - [Troubleshooting Guide](../troubleshooting/wsl-better-sqlite3-error.md)
84
+
85
+ ---
86
+
87
+ **Last Updated**: 2025-11-13
88
+ **Status**: Ready for GitHub issue creation ✅