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.
- package/.claude/settings.local.json +9 -2
- package/.claude/skills/agentic-jujutsu/SKILL.md +1 -1
- package/CHANGELOG.md +140 -0
- package/bin/claude-flow +1 -1
- package/dist/src/cli/commands/mcp.js +61 -7
- package/dist/src/cli/commands/mcp.js.map +1 -1
- package/dist/src/cli/init/index.js +55 -33
- package/dist/src/cli/init/index.js.map +1 -1
- package/dist/src/cli/simple-cli.js +182 -172
- package/dist/src/cli/simple-cli.js.map +1 -1
- package/dist/src/cli/simple-commands/init/agent-copier.js +9 -3
- package/dist/src/cli/simple-commands/init/agent-copier.js.map +1 -1
- package/dist/src/core/DatabaseManager.js +39 -9
- package/dist/src/core/DatabaseManager.js.map +1 -1
- package/dist/src/mcp/async/job-manager-mcp25.js +240 -0
- package/dist/src/mcp/async/job-manager-mcp25.js.map +1 -0
- package/dist/src/mcp/index.js +8 -0
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/protocol/version-negotiation.js +182 -0
- package/dist/src/mcp/protocol/version-negotiation.js.map +1 -0
- package/dist/src/mcp/registry/mcp-registry-client-2025.js +210 -0
- package/dist/src/mcp/registry/mcp-registry-client-2025.js.map +1 -0
- package/dist/src/mcp/server-factory.js +189 -0
- package/dist/src/mcp/server-factory.js.map +1 -0
- package/dist/src/mcp/server-mcp-2025.js +283 -0
- package/dist/src/mcp/server-mcp-2025.js.map +1 -0
- package/dist/src/mcp/tool-registry-progressive.js +319 -0
- package/dist/src/mcp/tool-registry-progressive.js.map +1 -0
- package/dist/src/mcp/tools/_template.js +62 -0
- package/dist/src/mcp/tools/_template.js.map +1 -0
- package/dist/src/mcp/tools/loader.js +228 -0
- package/dist/src/mcp/tools/loader.js.map +1 -0
- package/dist/src/mcp/tools/system/search.js +224 -0
- package/dist/src/mcp/tools/system/search.js.map +1 -0
- package/dist/src/mcp/tools/system/status.js +168 -0
- package/dist/src/mcp/tools/system/status.js.map +1 -0
- package/dist/src/mcp/validation/schema-validator-2025.js +198 -0
- package/dist/src/mcp/validation/schema-validator-2025.js.map +1 -0
- package/dist/src/utils/error-recovery.js +215 -0
- package/dist/src/utils/error-recovery.js.map +1 -0
- package/dist/src/utils/metrics-reader.js +10 -0
- package/dist/src/utils/metrics-reader.js.map +1 -1
- package/docs/.claude-flow/metrics/performance.json +3 -3
- package/docs/.claude-flow/metrics/task-metrics.json +3 -3
- package/docs/.github-release-issue-v2.7.33.md +488 -0
- package/docs/AGENTDB_BRANCH_MERGE_VERIFICATION.md +436 -0
- package/docs/AUTOMATIC_ERROR_RECOVERY_v2.7.35.md +321 -0
- package/docs/BRANCH_REVIEW_SUMMARY.md +439 -0
- package/docs/CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md +384 -0
- package/docs/DEEP_CODE_REVIEW_v2.7.33.md +1159 -0
- package/docs/DOCKER_TEST_RESULTS_v2.7.35.md +305 -0
- package/docs/MCP_2025_FEATURE_CONFIRMATION.md +698 -0
- package/docs/NPM_PUBLISH_GUIDE_v2.7.33.md +628 -0
- package/docs/REGRESSION_TEST_REPORT_v2.7.33.md +397 -0
- package/docs/RELEASE_NOTES_v2.7.33.md +618 -0
- package/docs/RELEASE_READINESS_SUMMARY.md +377 -0
- package/docs/RELEASE_SUMMARY_v2.7.33.md +456 -0
- package/docs/agentic-flow-agentdb-mcp-integration.md +1198 -0
- package/docs/features/automatic-error-recovery.md +333 -0
- package/docs/github-issues/README.md +88 -0
- package/docs/github-issues/wsl-enotempty-automatic-recovery.md +470 -0
- package/docs/mcp-2025-implementation-summary.md +459 -0
- package/docs/mcp-spec-2025-implementation-plan.md +1330 -0
- package/docs/phase-1-2-implementation-summary.md +676 -0
- package/docs/regression-analysis-phase-1-2.md +555 -0
- package/docs/troubleshooting/wsl-better-sqlite3-error.md +239 -0
- package/package.json +5 -2
- package/scripts/create-github-issue.sh +64 -0
- package/scripts/test-docker-wsl.sh +198 -0
- package/src/cli/commands/mcp.ts +86 -9
- package/src/cli/init/index.ts +72 -42
- package/src/cli/simple-commands/init/agent-copier.js +10 -5
- package/src/core/DatabaseManager.ts +55 -9
- package/src/mcp/async/job-manager-mcp25.ts +456 -0
- package/src/mcp/index.ts +60 -0
- package/src/mcp/protocol/version-negotiation.ts +329 -0
- package/src/mcp/registry/mcp-registry-client-2025.ts +334 -0
- package/src/mcp/server-factory.ts +426 -0
- package/src/mcp/server-mcp-2025.ts +507 -0
- package/src/mcp/tool-registry-progressive.ts +539 -0
- package/src/mcp/tools/_template.ts +174 -0
- package/src/mcp/tools/loader.ts +362 -0
- package/src/mcp/tools/system/search.ts +276 -0
- package/src/mcp/tools/system/status.ts +206 -0
- package/src/mcp/validation/schema-validator-2025.ts +294 -0
- package/src/utils/error-recovery.ts +325 -0
- package/docs/AGENTDB_V1.6.1_DEEP_REVIEW.md +0 -386
- package/docs/AGENT_FOLDER_STRUCTURE_FIX.md +0 -192
- package/docs/RECENT_RELEASES_SUMMARY.md +0 -375
- package/docs/V2.7.31_RELEASE_NOTES.md +0 -375
- /package/.claude/agents/analysis/{analyze-code-quality.md ā code-review/analyze-code-quality.md} +0 -0
- /package/.claude/agents/architecture/{arch-system-design.md ā system-design/arch-system-design.md} +0 -0
- /package/.claude/agents/data/{data-ml-model.md ā ml/data-ml-model.md} +0 -0
- /package/.claude/agents/development/{dev-backend-api.md ā backend/dev-backend-api.md} +0 -0
- /package/.claude/agents/devops/{ops-cicd-github.md ā ci-cd/ops-cicd-github.md} +0 -0
- /package/.claude/agents/documentation/{docs-api-openapi.md ā api-docs/docs-api-openapi.md} +0 -0
- /package/.claude/agents/specialized/{spec-mobile-react-native.md ā mobile/spec-mobile-react-native.md} +0 -0
- /package/.claude/agents/testing/{tdd-london-swarm.md ā unit/tdd-london-swarm.md} +0 -0
- /package/.claude/agents/testing/{production-validator.md ā validation/production-validator.md} +0 -0
package/src/cli/init/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { createSwarmCommands } from './swarm-commands.js';
|
|
|
5
5
|
import { createSparcEnvironment } from './sparc-environment.js';
|
|
6
6
|
import { createClaudeConfig } from './claude-config.js';
|
|
7
7
|
import { createBatchToolsGuide } from './batch-tools.js';
|
|
8
|
+
import { errorRecovery } from '../../utils/error-recovery.js';
|
|
8
9
|
|
|
9
10
|
export interface InitOptions {
|
|
10
11
|
sparc?: boolean;
|
|
@@ -12,56 +13,85 @@ export interface InitOptions {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export async function initCommand(options: InitOptions = {}) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// Wrap entire initialization in retry logic with automatic recovery
|
|
17
|
+
return errorRecovery.retryWithRecovery(
|
|
18
|
+
async () => {
|
|
19
|
+
try {
|
|
20
|
+
const fs = await import('fs/promises');
|
|
21
|
+
const path = await import('path');
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
printSuccess('Initializing Claude-Flow project...');
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
// Check WSL environment and apply fixes proactively
|
|
26
|
+
if (errorRecovery.isWSL()) {
|
|
27
|
+
console.log('š WSL environment detected');
|
|
28
|
+
const wslCheck = await errorRecovery.recoverWSLErrors();
|
|
29
|
+
if (wslCheck.recovered) {
|
|
30
|
+
console.log('ā
WSL environment optimized\n');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
// Phase 1: Create directory structure
|
|
35
|
+
console.log('\nš Phase 1: Creating directory structure...');
|
|
36
|
+
await createDirectoryStructure();
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
// Phase 2: Create base configuration
|
|
39
|
+
console.log('\nāļø Phase 2: Creating configuration...');
|
|
40
|
+
await createClaudeConfig(options);
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
// Phase 3: Create swarm commands and documentation
|
|
43
|
+
console.log('\nš¤ Phase 3: Creating swarm commands...');
|
|
44
|
+
await createSwarmCommands();
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
// Phase 4: Create batch tools guides
|
|
47
|
+
console.log('\nš§ Phase 4: Creating batch tools guides...');
|
|
48
|
+
await createBatchToolsGuide();
|
|
49
|
+
|
|
50
|
+
// Phase 5: SPARC environment (if requested)
|
|
51
|
+
if (options.sparc) {
|
|
52
|
+
console.log('\nš Phase 5: Creating SPARC environment...');
|
|
53
|
+
await createSparcEnvironment();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Success summary
|
|
57
|
+
console.log('\nš Project initialized successfully!');
|
|
58
|
+
console.log(' š Created .claude/ directory structure');
|
|
59
|
+
console.log(' š Created comprehensive swarm command documentation');
|
|
60
|
+
console.log(' š§ Created batch tools coordination guides');
|
|
61
|
+
console.log(' š Created detailed usage examples with orchestration');
|
|
42
62
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
console.log(' š Created detailed usage examples with orchestration');
|
|
63
|
+
console.log('\n Next steps:');
|
|
64
|
+
console.log(' 1. Run "claude-flow swarm --help" to see swarm options');
|
|
65
|
+
console.log(' 2. Check .claude/commands/swarm/ for detailed documentation');
|
|
66
|
+
console.log(' 3. Review batch tools guide for orchestration patterns');
|
|
67
|
+
console.log(' 4. Run "claude-flow help" for all available commands');
|
|
49
68
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
if (options.sparc) {
|
|
70
|
+
console.log(' 5. Run "claude-flow sparc modes" to see available SPARC modes');
|
|
71
|
+
console.log(' 6. Use TodoWrite/TodoRead for task coordination');
|
|
72
|
+
console.log(' 7. Use Task tool for parallel agent execution');
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
// Attempt automatic error recovery
|
|
76
|
+
const recovery = await errorRecovery.recoverInitErrors(error);
|
|
55
77
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
78
|
+
if (recovery.recovered) {
|
|
79
|
+
console.log('ā
Recovered from error, retrying initialization...\n');
|
|
80
|
+
throw error; // Trigger retry
|
|
81
|
+
} else {
|
|
82
|
+
printError(
|
|
83
|
+
`Failed to initialize project: ${error instanceof Error ? error.message : String(error)}`,
|
|
84
|
+
);
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
maxRetries: options.force ? 5 : 3,
|
|
91
|
+
delay: 1000,
|
|
92
|
+
onRetry: (attempt, error) => {
|
|
93
|
+
console.log(`\nš Retry attempt ${attempt} after error recovery...`);
|
|
94
|
+
}
|
|
60
95
|
}
|
|
61
|
-
|
|
62
|
-
printError(
|
|
63
|
-
`Failed to initialize project: ${error instanceof Error ? error.message : String(error)}`,
|
|
64
|
-
);
|
|
65
|
-
throw error;
|
|
66
|
-
}
|
|
96
|
+
);
|
|
67
97
|
}
|
|
@@ -135,30 +135,35 @@ export async function copyAgentFiles(targetDir, options = {}) {
|
|
|
135
135
|
* Create agent directories structure
|
|
136
136
|
*/
|
|
137
137
|
export async function createAgentDirectories(targetDir, dryRun = false) {
|
|
138
|
-
// Flat structure - all .md files directly in category folders
|
|
139
138
|
const agentDirs = [
|
|
140
139
|
'.claude',
|
|
141
140
|
'.claude/agents',
|
|
142
141
|
'.claude/agents/core',
|
|
143
|
-
'.claude/agents/swarm',
|
|
142
|
+
'.claude/agents/swarm',
|
|
144
143
|
'.claude/agents/hive-mind',
|
|
145
144
|
'.claude/agents/consensus',
|
|
146
145
|
'.claude/agents/optimization',
|
|
147
146
|
'.claude/agents/github',
|
|
148
147
|
'.claude/agents/sparc',
|
|
149
148
|
'.claude/agents/testing',
|
|
149
|
+
'.claude/agents/testing/unit',
|
|
150
|
+
'.claude/agents/testing/validation',
|
|
150
151
|
'.claude/agents/templates',
|
|
151
152
|
'.claude/agents/analysis',
|
|
153
|
+
'.claude/agents/analysis/code-review',
|
|
152
154
|
'.claude/agents/architecture',
|
|
155
|
+
'.claude/agents/architecture/system-design',
|
|
153
156
|
'.claude/agents/data',
|
|
157
|
+
'.claude/agents/data/ml',
|
|
154
158
|
'.claude/agents/development',
|
|
159
|
+
'.claude/agents/development/backend',
|
|
155
160
|
'.claude/agents/devops',
|
|
161
|
+
'.claude/agents/devops/ci-cd',
|
|
156
162
|
'.claude/agents/documentation',
|
|
163
|
+
'.claude/agents/documentation/api-docs',
|
|
157
164
|
'.claude/agents/specialized',
|
|
165
|
+
'.claude/agents/specialized/mobile',
|
|
158
166
|
'.claude/agents/flow-nexus',
|
|
159
|
-
'.claude/agents/goal',
|
|
160
|
-
'.claude/agents/neural',
|
|
161
|
-
'.claude/agents/reasoning',
|
|
162
167
|
'.claude/commands',
|
|
163
168
|
'.claude/commands/flow-nexus'
|
|
164
169
|
];
|
|
@@ -12,6 +12,8 @@ export class DatabaseManager implements IDatabaseProvider {
|
|
|
12
12
|
private dbType: 'sqlite' | 'json';
|
|
13
13
|
private dbPath: string;
|
|
14
14
|
private initialized: boolean = false;
|
|
15
|
+
private retryCount: number = 0;
|
|
16
|
+
private maxRetries: number = 3;
|
|
15
17
|
|
|
16
18
|
constructor(dbType: 'sqlite' | 'json' = 'sqlite', dbPath?: string) {
|
|
17
19
|
this.dbType = dbType;
|
|
@@ -19,18 +21,36 @@ export class DatabaseManager implements IDatabaseProvider {
|
|
|
19
21
|
|
|
20
22
|
// Try SQLite first, fallback to JSON if needed
|
|
21
23
|
if (this.dbType === 'sqlite') {
|
|
22
|
-
|
|
23
|
-
this.provider = new SQLiteProvider(this.dbPath);
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.warn('SQLite not available, falling back to JSON storage:', error);
|
|
26
|
-
this.provider = new JSONProvider(this.dbPath.replace('.sqlite', '.json'));
|
|
27
|
-
this.dbType = 'json';
|
|
28
|
-
}
|
|
24
|
+
this.provider = this.initializeSQLiteWithRecovery();
|
|
29
25
|
} else {
|
|
30
26
|
this.provider = new JSONProvider(this.dbPath);
|
|
31
27
|
}
|
|
32
28
|
}
|
|
33
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Initialize SQLite with automatic error recovery
|
|
32
|
+
*/
|
|
33
|
+
private initializeSQLiteWithRecovery(): IDatabaseProvider {
|
|
34
|
+
try {
|
|
35
|
+
return new SQLiteProvider(this.dbPath);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
38
|
+
|
|
39
|
+
// Check if it's an npm cache error
|
|
40
|
+
if (errorMsg.includes('ENOTEMPTY') || errorMsg.includes('better-sqlite3')) {
|
|
41
|
+
console.warn('ā ļø SQLite initialization failed due to npm cache error');
|
|
42
|
+
console.warn(' Will attempt automatic recovery during initialize()');
|
|
43
|
+
} else {
|
|
44
|
+
console.warn('SQLite not available, falling back to JSON storage:', error);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Fallback to JSON for now
|
|
48
|
+
this.provider = new JSONProvider(this.dbPath.replace('.sqlite', '.json'));
|
|
49
|
+
this.dbType = 'json';
|
|
50
|
+
return this.provider;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
private getDefaultPath(): string {
|
|
35
55
|
const baseDir = path.join(process.cwd(), '.claude-flow');
|
|
36
56
|
return this.dbType === 'sqlite'
|
|
@@ -40,8 +60,34 @@ export class DatabaseManager implements IDatabaseProvider {
|
|
|
40
60
|
|
|
41
61
|
async initialize(): Promise<void> {
|
|
42
62
|
await fs.ensureDir(path.dirname(this.dbPath));
|
|
43
|
-
|
|
44
|
-
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
await this.provider.initialize();
|
|
66
|
+
this.initialized = true;
|
|
67
|
+
} catch (error) {
|
|
68
|
+
// If JSON provider failed, just propagate the error
|
|
69
|
+
if (this.dbType === 'json') {
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// For SQLite errors, attempt recovery
|
|
74
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
75
|
+
if (this.retryCount < this.maxRetries) {
|
|
76
|
+
console.warn(`ā ļø Database initialization failed (attempt ${this.retryCount + 1}/${this.maxRetries})`);
|
|
77
|
+
console.warn(` Error: ${errorMsg}`);
|
|
78
|
+
|
|
79
|
+
// Attempt to recover by switching to JSON
|
|
80
|
+
console.log('š Switching to JSON storage as fallback...');
|
|
81
|
+
this.provider = new JSONProvider(this.dbPath.replace('.sqlite', '.json'));
|
|
82
|
+
this.dbType = 'json';
|
|
83
|
+
this.retryCount++;
|
|
84
|
+
|
|
85
|
+
// Retry initialization with JSON provider
|
|
86
|
+
await this.initialize();
|
|
87
|
+
} else {
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
45
91
|
}
|
|
46
92
|
|
|
47
93
|
async store(key: string, value: any, namespace: string = 'default'): Promise<void> {
|