claude-flow 2.0.0-alpha.98 ā 2.0.0
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/agents/MIGRATION_SUMMARY.md +7 -0
- package/.claude/agents/README.md +7 -0
- package/.claude/agents/consensus/README.md +7 -0
- package/.claude/agents/flow-nexus/app-store.md +88 -0
- package/.claude/agents/flow-nexus/authentication.md +69 -0
- package/.claude/agents/flow-nexus/challenges.md +81 -0
- package/.claude/agents/flow-nexus/neural-network.md +88 -0
- package/.claude/agents/flow-nexus/payments.md +83 -0
- package/.claude/agents/flow-nexus/sandbox.md +76 -0
- package/.claude/agents/flow-nexus/swarm.md +76 -0
- package/.claude/agents/flow-nexus/user-tools.md +96 -0
- package/.claude/agents/flow-nexus/workflow.md +84 -0
- package/.claude/agents/optimization/README.md +7 -0
- package/.claude/agents/optimization/benchmark-suite.md +7 -0
- package/.claude/agents/optimization/load-balancer.md +7 -0
- package/.claude/agents/optimization/performance-monitor.md +7 -0
- package/.claude/agents/optimization/resource-allocator.md +7 -0
- package/.claude/agents/optimization/topology-optimizer.md +7 -0
- package/.claude/agents/swarm/README.md +7 -0
- package/.claude/checkpoints/1756227204.json +1 -0
- package/.claude/checkpoints/1756227205.json +1 -0
- package/.claude/checkpoints/1756227276.json +1 -0
- package/.claude/checkpoints/1756227278.json +1 -0
- package/.claude/checkpoints/1756227280.json +1 -0
- package/.claude/checkpoints/1756227282.json +1 -0
- package/.claude/checkpoints/1756227652.json +1 -0
- package/.claude/checkpoints/1756227653.json +1 -0
- package/.claude/checkpoints/1756227666.json +1 -0
- package/.claude/checkpoints/1756227668.json +1 -0
- package/.claude/checkpoints/1756227723.json +1 -0
- package/.claude/checkpoints/1756227725.json +1 -0
- package/.claude/checkpoints/1756227731.json +1 -0
- package/.claude/checkpoints/1756227733.json +1 -0
- package/.claude/checkpoints/1756231330.json +1 -0
- package/.claude/checkpoints/1756231331.json +1 -0
- package/.claude/checkpoints/1756231342.json +1 -0
- package/.claude/checkpoints/1756231344.json +1 -0
- package/.claude/checkpoints/1756231355.json +1 -0
- package/.claude/checkpoints/1756231357.json +1 -0
- package/.claude/checkpoints/1756231367.json +1 -0
- package/.claude/checkpoints/1756231368.json +1 -0
- package/.claude/checkpoints/1756231458.json +1 -0
- package/.claude/checkpoints/1756231459.json +1 -0
- package/.claude/checkpoints/1756231477.json +1 -0
- package/.claude/checkpoints/1756231479.json +1 -0
- package/.claude/checkpoints/1756233026.json +1 -0
- package/.claude/checkpoints/1756233028.json +1 -0
- package/.claude/checkpoints/1756233040.json +1 -0
- package/.claude/checkpoints/1756233041.json +1 -0
- package/.claude/checkpoints/1756233057.json +1 -0
- package/.claude/checkpoints/1756233059.json +1 -0
- package/.claude/checkpoints/1756233090.json +1 -0
- package/.claude/checkpoints/1756233092.json +1 -0
- package/.claude/checkpoints/1756233141.json +1 -0
- package/.claude/checkpoints/1756233143.json +1 -0
- package/.claude/checkpoints/1756475935.json +1 -0
- package/.claude/checkpoints/1756475936.json +1 -0
- package/.claude/checkpoints/1756475996.json +1 -0
- package/.claude/checkpoints/1756475998.json +1 -0
- package/.claude/checkpoints/1756476093.json +1 -0
- package/.claude/checkpoints/1756476098.json +1 -0
- package/.claude/checkpoints/1756476100.json +1 -0
- package/.claude/checkpoints/1756476101.json +1 -0
- package/.claude/checkpoints/1756476161.json +1 -0
- package/.claude/checkpoints/1756476163.json +1 -0
- package/.claude/checkpoints/1756476183.json +1 -0
- package/.claude/checkpoints/1756476184.json +1 -0
- package/.claude/checkpoints/1756476193.json +1 -0
- package/.claude/checkpoints/1756476194.json +1 -0
- package/.claude/checkpoints/1756476202.json +1 -0
- package/.claude/checkpoints/1756476204.json +1 -0
- package/.claude/checkpoints/1756476268.json +1 -0
- package/.claude/checkpoints/1756476269.json +1 -0
- package/.claude/checkpoints/1756476287.json +1 -0
- package/.claude/checkpoints/1756476288.json +1 -0
- package/.claude/checkpoints/1756997935.json +1 -0
- package/.claude/checkpoints/1756997937.json +1 -0
- package/.claude/checkpoints/1756997938.json +1 -0
- package/.claude/checkpoints/1756997940.json +1 -0
- package/.claude/checkpoints/1756997942.json +1 -0
- package/.claude/checkpoints/1756997944.json +1 -0
- package/.claude/checkpoints/1756997945.json +1 -0
- package/.claude/checkpoints/1756997947.json +1 -0
- package/.claude/checkpoints/1756997949.json +1 -0
- package/.claude/checkpoints/1756997951.json +1 -0
- package/.claude/checkpoints/1756997953.json +1 -0
- package/.claude/checkpoints/1756997955.json +1 -0
- package/.claude/checkpoints/1756997956.json +1 -0
- package/.claude/checkpoints/1756997958.json +1 -0
- package/.claude/checkpoints/1756997960.json +1 -0
- package/.claude/checkpoints/1756997962.json +1 -0
- package/.claude/checkpoints/1756997964.json +1 -0
- package/.claude/checkpoints/1756997966.json +1 -0
- package/.claude/checkpoints/1756997968.json +1 -0
- package/.claude/checkpoints/1756997970.json +1 -0
- package/.claude/checkpoints/1757190213.json +1 -0
- package/.claude/checkpoints/1757190215.json +1 -0
- package/.claude/checkpoints/1757190217.json +1 -0
- package/.claude/checkpoints/1757190219.json +1 -0
- package/.claude/checkpoints/1757190220.json +1 -0
- package/.claude/checkpoints/1757190222.json +1 -0
- package/.claude/checkpoints/1757190224.json +1 -0
- package/.claude/checkpoints/1757190225.json +1 -0
- package/.claude/checkpoints/1757190227.json +1 -0
- package/.claude/checkpoints/1757190229.json +1 -0
- package/.claude/checkpoints/1757190231.json +1 -0
- package/.claude/checkpoints/1757190232.json +1 -0
- package/.claude/checkpoints/1757190234.json +1 -0
- package/.claude/checkpoints/1757190236.json +1 -0
- package/.claude/checkpoints/1757190238.json +1 -0
- package/.claude/checkpoints/1757190240.json +1 -0
- package/.claude/checkpoints/1757190241.json +1 -0
- package/.claude/checkpoints/1757190243.json +1 -0
- package/.claude/checkpoints/1757190245.json +1 -0
- package/.claude/checkpoints/1757190247.json +1 -0
- package/.claude/checkpoints/1757190608.json +1 -0
- package/.claude/checkpoints/1757190610.json +1 -0
- package/.claude/checkpoints/1757190626.json +1 -0
- package/.claude/checkpoints/1757190628.json +1 -0
- package/.claude/checkpoints/1757190993.json +1 -0
- package/.claude/checkpoints/1757190997.json +1 -0
- package/.claude/checkpoints/1757191001.json +1 -0
- package/.claude/checkpoints/1757191004.json +1 -0
- package/.claude/checkpoints/1757191007.json +1 -0
- package/.claude/checkpoints/1757191009.json +1 -0
- package/.claude/checkpoints/1757191012.json +1 -0
- package/.claude/checkpoints/1757191014.json +1 -0
- package/.claude/checkpoints/1757191016.json +1 -0
- package/.claude/checkpoints/1757191019.json +1 -0
- package/.claude/checkpoints/1757191022.json +1 -0
- package/.claude/checkpoints/1757191024.json +1 -0
- package/.claude/checkpoints/1757191027.json +1 -0
- package/.claude/checkpoints/1757191029.json +1 -0
- package/.claude/checkpoints/1757191032.json +1 -0
- package/.claude/checkpoints/1757191034.json +1 -0
- package/.claude/checkpoints/1757191037.json +1 -0
- package/.claude/checkpoints/1757191040.json +1 -0
- package/.claude/checkpoints/1757191061.json +1 -0
- package/.claude/checkpoints/1757191063.json +1 -0
- package/.claude/checkpoints/1757191084.json +1 -0
- package/.claude/checkpoints/1757191086.json +1 -0
- package/.claude/checkpoints/1757192316.json +1 -0
- package/.claude/checkpoints/1757192318.json +1 -0
- package/.claude/checkpoints/1757192389.json +1 -0
- package/.claude/checkpoints/1757192391.json +1 -0
- package/.claude/checkpoints/1757192489.json +1 -0
- package/.claude/checkpoints/1757192491.json +1 -0
- package/.claude/checkpoints/1757192521.json +1 -0
- package/.claude/checkpoints/1757192523.json +1 -0
- package/.claude/checkpoints/1757192541.json +1 -0
- package/.claude/checkpoints/1757192543.json +1 -0
- package/.claude/checkpoints/1757193796.json +1 -0
- package/.claude/checkpoints/summary-session-20250826-164827.md +1342 -0
- package/.claude/checkpoints/summary-session-20250826-165852.md +1351 -0
- package/.claude/checkpoints/summary-session-20250826-170402.md +1367 -0
- package/.claude/checkpoints/summary-session-20250826-175112.md +1327 -0
- package/.claude/checkpoints/summary-session-20250826-175609.md +1324 -0
- package/.claude/checkpoints/summary-session-20250826-175743.md +1327 -0
- package/.claude/checkpoints/summary-session-20250826-180554.md +1340 -0
- package/.claude/checkpoints/summary-session-20250826-181530.md +1344 -0
- package/.claude/checkpoints/summary-session-20250826-181633.md +1347 -0
- package/.claude/checkpoints/summary-session-20250826-182235.md +1350 -0
- package/.claude/checkpoints/summary-session-20250826-182618.md +1353 -0
- package/.claude/checkpoints/summary-session-20250826-183200.md +1372 -0
- package/.claude/checkpoints/summary-session-20250826-183232.md +1379 -0
- package/.claude/checkpoints/summary-session-20250829-133605.md +38 -0
- package/.claude/checkpoints/summary-session-20250829-134121.md +41 -0
- package/.claude/checkpoints/summary-session-20250829-134400.md +46 -0
- package/.claude/checkpoints/summary-session-20250829-134858.md +49 -0
- package/.claude/checkpoints/summary-session-20250829-135402.md +52 -0
- package/.claude/checkpoints/summary-session-20250829-135640.md +58 -0
- package/.claude/checkpoints/summary-session-20250829-135754.md +65 -0
- package/.claude/checkpoints/summary-session-20250829-135902.md +71 -0
- package/.claude/checkpoints/summary-session-20250829-140629.md +119 -0
- package/.claude/checkpoints/summary-session-20250829-140733.md +121 -0
- package/.claude/checkpoints/summary-session-20250902-190126.md +38 -0
- package/.claude/checkpoints/summary-session-20250904-150003.md +87 -0
- package/.claude/checkpoints/summary-session-20250906-202218.md +2757 -0
- package/.claude/checkpoints/summary-session-20250906-202622.md +2814 -0
- package/.claude/checkpoints/summary-session-20250906-203037.md +2826 -0
- package/.claude/checkpoints/task-1756227096.json +1 -0
- package/.claude/checkpoints/task-1756227619.json +1 -0
- package/.claude/checkpoints/task-1756230633.json +1 -0
- package/.claude/checkpoints/task-1756230902.json +1 -0
- package/.claude/checkpoints/task-1756230993.json +1 -0
- package/.claude/checkpoints/task-1756231253.json +1 -0
- package/.claude/checkpoints/task-1756232070.json +1 -0
- package/.claude/checkpoints/task-1756232144.json +1 -0
- package/.claude/checkpoints/task-1756232251.json +1 -0
- package/.claude/checkpoints/task-1756232564.json +1 -0
- package/.claude/checkpoints/task-1756232982.json +1 -0
- package/.claude/checkpoints/task-1756233131.json +1 -0
- package/.claude/checkpoints/task-1756474562.json +1 -0
- package/.claude/checkpoints/task-1756474754.json +1 -0
- package/.claude/checkpoints/task-1756474922.json +1 -0
- package/.claude/checkpoints/task-1756475028.json +1 -0
- package/.claude/checkpoints/task-1756475307.json +1 -0
- package/.claude/checkpoints/task-1756475349.json +1 -0
- package/.claude/checkpoints/task-1756475699.json +1 -0
- package/.claude/checkpoints/task-1756475719.json +1 -0
- package/.claude/checkpoints/task-1756475828.json +1 -0
- package/.claude/checkpoints/task-1756475858.json +1 -0
- package/.claude/checkpoints/task-1756475868.json +1 -0
- package/.claude/checkpoints/task-1756476373.json +1 -0
- package/.claude/checkpoints/task-1756839595.json +1 -0
- package/.claude/checkpoints/task-1756997821.json +1 -0
- package/.claude/checkpoints/task-1757189936.json +1 -0
- package/.claude/checkpoints/task-1757190154.json +1 -0
- package/.claude/checkpoints/task-1757190301.json +1 -0
- package/.claude/checkpoints/task-1757190369.json +1 -0
- package/.claude/checkpoints/task-1757190483.json +1 -0
- package/.claude/checkpoints/task-1757190841.json +1 -0
- package/.claude/checkpoints/task-1757191219.json +1 -0
- package/.claude/checkpoints/task-1757192639.json +1 -0
- package/.claude/checkpoints/task-1757194091.json +1 -0
- package/.claude/commands/flow-nexus/app-store.md +124 -0
- package/.claude/commands/flow-nexus/challenges.md +120 -0
- package/.claude/commands/flow-nexus/login-registration.md +65 -0
- package/.claude/commands/flow-nexus/neural-network.md +134 -0
- package/.claude/commands/flow-nexus/payments.md +116 -0
- package/.claude/commands/flow-nexus/sandbox.md +83 -0
- package/.claude/commands/flow-nexus/swarm.md +87 -0
- package/.claude/commands/flow-nexus/user-tools.md +152 -0
- package/.claude/commands/flow-nexus/workflow.md +115 -0
- package/bin/claude-flow +1 -1
- package/package.json +1 -1
- package/src/api/auth-service.ts +644 -0
- package/src/api/database-schema.sql +366 -0
- package/src/api/database-service.ts +788 -0
- package/src/api/swarm-api.ts +741 -0
- package/src/cli/commands/index.ts +711 -1
- package/src/cli/simple-commands/hive-mind/session-manager.js +12 -0
- package/src/cli/simple-commands/init/agent-copier.js +129 -1
- package/src/cli/simple-commands/init/hive-mind-init.js +12 -7
- package/src/cli/simple-commands/init/index.js +116 -1
- package/src/cli/simple-commands/init/templates/claude-md.js +295 -1
- package/src/core/version.js +1 -1
- package/src/ui/console/index.html +4 -0
- package/src/ui/console/js/real-time-dashboard.js +715 -0
- package/src/ui/console/js/swarm-integration.js +485 -0
- package/src/ui/console/js/swarm-visualizer.js +879 -0
- package/src/ui/console/styles/swarm-visualizer.css +487 -0
- package/src/cli/simple-commands/init/.claude-flow/metrics/agent-metrics.json +0 -1
- package/src/cli/simple-commands/init/.claude-flow/metrics/performance.json +0 -9
- package/src/cli/simple-commands/init/.claude-flow/metrics/task-metrics.json +0 -10
- package/src/cli/simple-commands/init/.swarm/memory.db +0 -0
|
@@ -983,6 +983,12 @@ To enable persistence, see: https://github.com/ruvnet/claude-code-flow/docs/wind
|
|
|
983
983
|
return true;
|
|
984
984
|
}
|
|
985
985
|
|
|
986
|
+
// Check if database connection is still open before operations
|
|
987
|
+
if (!this.db || !this.db.open) {
|
|
988
|
+
console.warn('Database connection closed, cannot remove child PID during cleanup');
|
|
989
|
+
return false;
|
|
990
|
+
}
|
|
991
|
+
|
|
986
992
|
const session = this.db.prepare('SELECT child_pids FROM sessions WHERE id = ?').get(sessionId);
|
|
987
993
|
if (!session) return false;
|
|
988
994
|
|
|
@@ -1016,6 +1022,12 @@ To enable persistence, see: https://github.com/ruvnet/claude-code-flow/docs/wind
|
|
|
1016
1022
|
if (!session || !session.child_pids) return [];
|
|
1017
1023
|
return sessionSerializer.deserializeLogData(session.child_pids);
|
|
1018
1024
|
} else {
|
|
1025
|
+
// Check if database connection is still open
|
|
1026
|
+
if (!this.db || !this.db.open) {
|
|
1027
|
+
console.warn('Database connection closed, cannot get child PIDs during cleanup');
|
|
1028
|
+
return [];
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1019
1031
|
// Use SQLite
|
|
1020
1032
|
const session = this.db.prepare('SELECT child_pids FROM sessions WHERE id = ?').get(sessionId);
|
|
1021
1033
|
if (!session || !session.child_pids) return [];
|
|
@@ -162,7 +162,10 @@ export async function createAgentDirectories(targetDir, dryRun = false) {
|
|
|
162
162
|
'.claude/agents/documentation',
|
|
163
163
|
'.claude/agents/documentation/api-docs',
|
|
164
164
|
'.claude/agents/specialized',
|
|
165
|
-
'.claude/agents/specialized/mobile'
|
|
165
|
+
'.claude/agents/specialized/mobile',
|
|
166
|
+
'.claude/agents/flow-nexus',
|
|
167
|
+
'.claude/commands',
|
|
168
|
+
'.claude/commands/flow-nexus'
|
|
166
169
|
];
|
|
167
170
|
|
|
168
171
|
if (dryRun) {
|
|
@@ -180,6 +183,131 @@ export async function createAgentDirectories(targetDir, dryRun = false) {
|
|
|
180
183
|
/**
|
|
181
184
|
* Validate agent system after copying
|
|
182
185
|
*/
|
|
186
|
+
/**
|
|
187
|
+
* Copy all command files from the installed package to project directory
|
|
188
|
+
*/
|
|
189
|
+
export async function copyCommandFiles(targetDir, options = {}) {
|
|
190
|
+
const { force = false, dryRun = false } = options;
|
|
191
|
+
|
|
192
|
+
// Path to command files - try multiple locations
|
|
193
|
+
const packageCommandsDir = join(__dirname, '../../../../.claude/commands'); // From npm package
|
|
194
|
+
const localCommandsDir = '/workspaces/claude-code-flow/.claude/commands'; // Local development
|
|
195
|
+
const cwdCommandsDir = join(process.cwd(), '.claude/commands'); // Current working directory
|
|
196
|
+
|
|
197
|
+
let sourceCommandsDir;
|
|
198
|
+
|
|
199
|
+
// Try local development first, then package, then cwd
|
|
200
|
+
try {
|
|
201
|
+
await fs.access(localCommandsDir);
|
|
202
|
+
sourceCommandsDir = localCommandsDir;
|
|
203
|
+
console.log(' š Using local development command files');
|
|
204
|
+
} catch {
|
|
205
|
+
try {
|
|
206
|
+
await fs.access(packageCommandsDir);
|
|
207
|
+
sourceCommandsDir = packageCommandsDir;
|
|
208
|
+
console.log(' š Using packaged command files');
|
|
209
|
+
} catch {
|
|
210
|
+
try {
|
|
211
|
+
await fs.access(cwdCommandsDir);
|
|
212
|
+
sourceCommandsDir = cwdCommandsDir;
|
|
213
|
+
console.log(' š Using current directory command files');
|
|
214
|
+
} catch {
|
|
215
|
+
console.log(' ā ļø No command files found in any location');
|
|
216
|
+
return { success: false, error: 'Command files not found' };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const targetCommandsDir = join(targetDir, '.claude/commands');
|
|
222
|
+
|
|
223
|
+
console.log('š Copying command system files...');
|
|
224
|
+
console.log(` š Source: ${sourceCommandsDir}`);
|
|
225
|
+
console.log(` š Target: ${targetCommandsDir}`);
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
// Create target directory
|
|
229
|
+
if (!dryRun) {
|
|
230
|
+
await fs.mkdir(targetCommandsDir, { recursive: true });
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const copiedFiles = [];
|
|
234
|
+
const errors = [];
|
|
235
|
+
|
|
236
|
+
// Recursively copy all command files
|
|
237
|
+
async function copyRecursive(srcDir, destDir) {
|
|
238
|
+
const items = await fs.readdir(srcDir, { withFileTypes: true });
|
|
239
|
+
|
|
240
|
+
for (const item of items) {
|
|
241
|
+
const srcPath = join(srcDir, item.name);
|
|
242
|
+
const destPath = join(destDir, item.name);
|
|
243
|
+
|
|
244
|
+
if (item.isDirectory()) {
|
|
245
|
+
if (!dryRun) {
|
|
246
|
+
await fs.mkdir(destPath, { recursive: true });
|
|
247
|
+
}
|
|
248
|
+
await copyRecursive(srcPath, destPath);
|
|
249
|
+
} else if (item.isFile() && item.name.endsWith('.md')) {
|
|
250
|
+
try {
|
|
251
|
+
// Check if file already exists
|
|
252
|
+
let shouldCopy = force;
|
|
253
|
+
if (!force) {
|
|
254
|
+
try {
|
|
255
|
+
await fs.access(destPath);
|
|
256
|
+
// File exists, skip unless force is true
|
|
257
|
+
continue;
|
|
258
|
+
} catch {
|
|
259
|
+
// File doesn't exist, safe to copy
|
|
260
|
+
shouldCopy = true;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (shouldCopy && !dryRun) {
|
|
265
|
+
const content = await fs.readFile(srcPath, 'utf8');
|
|
266
|
+
await fs.writeFile(destPath, content, 'utf8');
|
|
267
|
+
copiedFiles.push(destPath.replace(targetDir + '/', ''));
|
|
268
|
+
} else if (dryRun) {
|
|
269
|
+
copiedFiles.push(destPath.replace(targetDir + '/', ''));
|
|
270
|
+
}
|
|
271
|
+
} catch (err) {
|
|
272
|
+
errors.push(`Failed to copy ${item.name}: ${err.message}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
await copyRecursive(sourceCommandsDir, targetCommandsDir);
|
|
279
|
+
|
|
280
|
+
if (!dryRun && copiedFiles.length > 0) {
|
|
281
|
+
console.log(` ā
Copied ${copiedFiles.length} command files`);
|
|
282
|
+
console.log(' š Command system initialized with comprehensive documentation');
|
|
283
|
+
console.log(' šÆ Available categories: Analysis, Automation, GitHub, Hooks, Memory, Flow Nexus');
|
|
284
|
+
} else if (dryRun) {
|
|
285
|
+
console.log(` [DRY RUN] Would copy ${copiedFiles.length} command files`);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (errors.length > 0) {
|
|
289
|
+
console.log(' ā ļø Some command files could not be copied:');
|
|
290
|
+
errors.forEach(error => console.log(` - ${error}`));
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return {
|
|
294
|
+
success: true,
|
|
295
|
+
copiedFiles,
|
|
296
|
+
errors,
|
|
297
|
+
totalCommands: copiedFiles.length
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
} catch (err) {
|
|
301
|
+
console.log(` ā Failed to copy command files: ${err.message}`);
|
|
302
|
+
return {
|
|
303
|
+
success: false,
|
|
304
|
+
error: err.message,
|
|
305
|
+
copiedFiles: [],
|
|
306
|
+
errors: [err.message]
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
183
311
|
export async function validateAgentSystem(targetDir) {
|
|
184
312
|
const agentsDir = join(targetDir, '.claude/agents');
|
|
185
313
|
|
|
@@ -238,14 +238,19 @@ export const HIVE_DB_SCHEMA = {
|
|
|
238
238
|
sessions: `
|
|
239
239
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
240
240
|
id TEXT PRIMARY KEY,
|
|
241
|
-
swarm_id TEXT,
|
|
241
|
+
swarm_id TEXT NOT NULL,
|
|
242
|
+
swarm_name TEXT NOT NULL,
|
|
243
|
+
objective TEXT,
|
|
242
244
|
status TEXT DEFAULT 'active',
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
246
|
+
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
247
|
+
paused_at DATETIME,
|
|
248
|
+
resumed_at DATETIME,
|
|
249
|
+
completion_percentage REAL DEFAULT 0,
|
|
250
|
+
checkpoint_data TEXT,
|
|
251
|
+
metadata TEXT,
|
|
252
|
+
parent_pid INTEGER,
|
|
253
|
+
child_pids TEXT,
|
|
249
254
|
FOREIGN KEY (swarm_id) REFERENCES swarms (id)
|
|
250
255
|
);
|
|
251
256
|
`,
|
|
@@ -41,7 +41,7 @@ import { createOptimizedClaudeSlashCommands } from './claude-commands/optimized-
|
|
|
41
41
|
import { promises as fs } from 'fs';
|
|
42
42
|
import { copyTemplates } from './template-copier.js';
|
|
43
43
|
import { copyRevisedTemplates, validateTemplatesExist } from './copy-revised-templates.js';
|
|
44
|
-
import { copyAgentFiles, createAgentDirectories, validateAgentSystem } from './agent-copier.js';
|
|
44
|
+
import { copyAgentFiles, createAgentDirectories, validateAgentSystem, copyCommandFiles } from './agent-copier.js';
|
|
45
45
|
import { showInitHelp } from './help.js';
|
|
46
46
|
import { batchInitCommand, batchInitFromConfig, validateBatchOptions } from './batch-init.js';
|
|
47
47
|
import { ValidationSystem, runFullValidation } from './validation/index.js';
|
|
@@ -110,6 +110,11 @@ async function setupMcpServers(dryRun = false) {
|
|
|
110
110
|
command: 'npx ruv-swarm mcp start',
|
|
111
111
|
description: 'ruv-swarm MCP server for enhanced coordination',
|
|
112
112
|
},
|
|
113
|
+
{
|
|
114
|
+
name: 'flow-nexus',
|
|
115
|
+
command: 'npx flow-nexus@latest mcp start',
|
|
116
|
+
description: 'Flow Nexus Complete MCP server for advanced AI orchestration',
|
|
117
|
+
},
|
|
113
118
|
];
|
|
114
119
|
|
|
115
120
|
for (const server of servers) {
|
|
@@ -150,6 +155,11 @@ export async function initCommand(subArgs, flags) {
|
|
|
150
155
|
const hasVerificationFlags = subArgs.includes('--verify') || subArgs.includes('--pair') ||
|
|
151
156
|
flags.verify || flags.pair;
|
|
152
157
|
|
|
158
|
+
// Handle Flow Nexus minimal init
|
|
159
|
+
if (flags['flow-nexus']) {
|
|
160
|
+
return await flowNexusMinimalInit(flags, subArgs);
|
|
161
|
+
}
|
|
162
|
+
|
|
153
163
|
// Default to enhanced Claude Flow v2 init unless other modes are specified
|
|
154
164
|
// Use --basic flag for old behavior, or verification flags for verification mode
|
|
155
165
|
if (!flags.basic && !flags.minimal && !flags.sparc && !hasVerificationFlags) {
|
|
@@ -529,6 +539,7 @@ export async function initCommand(subArgs, flags) {
|
|
|
529
539
|
console.log(' š Then add MCP servers manually with:');
|
|
530
540
|
console.log(' claude mcp add claude-flow claude-flow mcp start');
|
|
531
541
|
console.log(' claude mcp add ruv-swarm npx ruv-swarm mcp start');
|
|
542
|
+
console.log(' claude mcp add flow-nexus npx flow-nexus@latest mcp start');
|
|
532
543
|
}
|
|
533
544
|
}
|
|
534
545
|
} catch (err) {
|
|
@@ -1437,6 +1448,7 @@ ${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')}
|
|
|
1437
1448
|
console.log('\n š To add MCP servers manually:');
|
|
1438
1449
|
console.log(' claude mcp add claude-flow npx claude-flow@alpha mcp start');
|
|
1439
1450
|
console.log(' claude mcp add ruv-swarm npx ruv-swarm@latest mcp start');
|
|
1451
|
+
console.log(' claude mcp add flow-nexus npx flow-nexus@latest mcp start');
|
|
1440
1452
|
console.log('\n š” MCP servers are defined in .mcp.json (project scope)');
|
|
1441
1453
|
}
|
|
1442
1454
|
} else if (!dryRun && !isClaudeCodeInstalled()) {
|
|
@@ -1446,6 +1458,7 @@ ${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')}
|
|
|
1446
1458
|
console.log('\n š After installing, add MCP servers:');
|
|
1447
1459
|
console.log(' claude mcp add claude-flow npx claude-flow@alpha mcp start');
|
|
1448
1460
|
console.log(' claude mcp add ruv-swarm npx ruv-swarm@latest mcp start');
|
|
1461
|
+
console.log(' claude mcp add flow-nexus npx flow-nexus@latest mcp start');
|
|
1449
1462
|
console.log('\n š” MCP servers are defined in .mcp.json (project scope)');
|
|
1450
1463
|
}
|
|
1451
1464
|
|
|
@@ -1460,6 +1473,20 @@ ${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')}
|
|
|
1460
1473
|
|
|
1461
1474
|
if (agentResult.success) {
|
|
1462
1475
|
await validateAgentSystem(workingDir);
|
|
1476
|
+
|
|
1477
|
+
// Copy command files including Flow Nexus commands
|
|
1478
|
+
console.log('\nš Setting up command system...');
|
|
1479
|
+
const commandResult = await copyCommandFiles(workingDir, {
|
|
1480
|
+
force: force,
|
|
1481
|
+
dryRun: dryRun
|
|
1482
|
+
});
|
|
1483
|
+
|
|
1484
|
+
if (commandResult.success) {
|
|
1485
|
+
console.log('ā
ā Command system setup complete with Flow Nexus integration');
|
|
1486
|
+
} else {
|
|
1487
|
+
console.log('ā ļø Command system setup failed:', commandResult.error);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1463
1490
|
console.log('ā
ā Agent system setup complete with 64 specialized agents');
|
|
1464
1491
|
} else {
|
|
1465
1492
|
console.log('ā ļø Agent system setup failed:', agentResult.error);
|
|
@@ -1531,3 +1558,91 @@ ${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')}
|
|
|
1531
1558
|
}
|
|
1532
1559
|
}
|
|
1533
1560
|
}
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Flow Nexus minimal initialization - only creates Flow Nexus CLAUDE.md, commands, and agents
|
|
1564
|
+
*/
|
|
1565
|
+
async function flowNexusMinimalInit(flags, subArgs) {
|
|
1566
|
+
console.log('š Flow Nexus: Initializing minimal setup...');
|
|
1567
|
+
|
|
1568
|
+
try {
|
|
1569
|
+
const force = flags.force || flags.f;
|
|
1570
|
+
|
|
1571
|
+
// Import functions we need
|
|
1572
|
+
const { createFlowNexusClaudeMd } = await import('./templates/claude-md.js');
|
|
1573
|
+
const { promises: fs } = await import('fs');
|
|
1574
|
+
|
|
1575
|
+
// Create Flow Nexus CLAUDE.md
|
|
1576
|
+
console.log('š Creating Flow Nexus CLAUDE.md...');
|
|
1577
|
+
const flowNexusClaudeMd = createFlowNexusClaudeMd();
|
|
1578
|
+
await fs.writeFile('CLAUDE.md', flowNexusClaudeMd);
|
|
1579
|
+
console.log(' ā
Created CLAUDE.md with Flow Nexus integration');
|
|
1580
|
+
|
|
1581
|
+
// Create .claude/commands/flow-nexus directory and copy commands
|
|
1582
|
+
console.log('š Setting up Flow Nexus commands...');
|
|
1583
|
+
await fs.mkdir('.claude/commands/flow-nexus', { recursive: true });
|
|
1584
|
+
|
|
1585
|
+
// Copy Flow Nexus command files
|
|
1586
|
+
const sourceCommandsDir = '/workspaces/claude-code-flow/.claude/commands/flow-nexus';
|
|
1587
|
+
try {
|
|
1588
|
+
const commandFiles = await fs.readdir(sourceCommandsDir);
|
|
1589
|
+
let copiedCommands = 0;
|
|
1590
|
+
|
|
1591
|
+
for (const file of commandFiles) {
|
|
1592
|
+
if (file.endsWith('.md')) {
|
|
1593
|
+
const sourcePath = `${sourceCommandsDir}/${file}`;
|
|
1594
|
+
const destPath = `.claude/commands/flow-nexus/${file}`;
|
|
1595
|
+
const content = await fs.readFile(sourcePath, 'utf8');
|
|
1596
|
+
await fs.writeFile(destPath, content);
|
|
1597
|
+
copiedCommands++;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
console.log(` ā
Copied ${copiedCommands} Flow Nexus command files`);
|
|
1602
|
+
} catch (err) {
|
|
1603
|
+
console.log(' ā ļø Could not copy Flow Nexus commands:', err.message);
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
// Create .claude/agents/flow-nexus directory and copy agents
|
|
1607
|
+
console.log('š¤ Setting up Flow Nexus agents...');
|
|
1608
|
+
await fs.mkdir('.claude/agents/flow-nexus', { recursive: true });
|
|
1609
|
+
|
|
1610
|
+
// Copy Flow Nexus agent files
|
|
1611
|
+
const sourceAgentsDir = '/workspaces/claude-code-flow/.claude/agents/flow-nexus';
|
|
1612
|
+
try {
|
|
1613
|
+
const agentFiles = await fs.readdir(sourceAgentsDir);
|
|
1614
|
+
let copiedAgents = 0;
|
|
1615
|
+
|
|
1616
|
+
for (const file of agentFiles) {
|
|
1617
|
+
if (file.endsWith('.md')) {
|
|
1618
|
+
const sourcePath = `${sourceAgentsDir}/${file}`;
|
|
1619
|
+
const destPath = `.claude/agents/flow-nexus/${file}`;
|
|
1620
|
+
const content = await fs.readFile(sourcePath, 'utf8');
|
|
1621
|
+
await fs.writeFile(destPath, content);
|
|
1622
|
+
copiedAgents++;
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
console.log(` ā
Copied ${copiedAgents} Flow Nexus agent files`);
|
|
1627
|
+
} catch (err) {
|
|
1628
|
+
console.log(' ā ļø Could not copy Flow Nexus agents:', err.message);
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
console.log('\nš Flow Nexus minimal initialization complete!');
|
|
1632
|
+
console.log('š Created: CLAUDE.md with Flow Nexus documentation');
|
|
1633
|
+
console.log('š Created: .claude/commands/flow-nexus/ directory with command documentation');
|
|
1634
|
+
console.log('š¤ Created: .claude/agents/flow-nexus/ directory with specialized agents');
|
|
1635
|
+
console.log('');
|
|
1636
|
+
console.log('š” Quick Start:');
|
|
1637
|
+
console.log(' 1. Register: mcp__flow-nexus__user_register({ email, password })');
|
|
1638
|
+
console.log(' 2. Login: mcp__flow-nexus__user_login({ email, password })');
|
|
1639
|
+
console.log(' 3. Deploy: mcp__flow-nexus__swarm_init({ topology: "mesh", maxAgents: 5 })');
|
|
1640
|
+
console.log('');
|
|
1641
|
+
console.log('š Use Flow Nexus MCP tools in Claude Code for full functionality');
|
|
1642
|
+
|
|
1643
|
+
} catch (err) {
|
|
1644
|
+
console.log(`ā Flow Nexus initialization failed: ${err.message}`);
|
|
1645
|
+
console.log('Stack trace:', err.stack);
|
|
1646
|
+
process.exit(1);
|
|
1647
|
+
}
|
|
1648
|
+
}
|