claude-flow 2.0.0-alpha.79 → 2.0.0-alpha.80
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/checkpoints/1753906298.json +12 -0
- package/.claude/checkpoints/1753906353.json +8 -0
- package/.claude/checkpoints/1753906370.json +8 -0
- package/.claude/checkpoints/summary-session-20250730-220658.md +182 -0
- package/.claude/checkpoints/summary-session-20250730-220954.md +187 -0
- package/.claude/checkpoints/summary-session-20250730-222733.md +199 -0
- package/.claude/checkpoints/task-1753913133.json +7 -0
- package/.claude/checkpoints/task-1753913281.json +7 -0
- package/.claude/checkpoints/task-1753913468.json +7 -0
- package/.claude/commands/analysis/README.md +9 -0
- package/.claude/commands/analysis/bottleneck-detect.md +162 -0
- package/.claude/commands/analysis/performance-report.md +25 -0
- package/.claude/commands/analysis/token-usage.md +25 -0
- package/.claude/commands/automation/README.md +9 -0
- package/.claude/commands/automation/auto-agent.md +122 -0
- package/.claude/commands/automation/smart-spawn.md +25 -0
- package/.claude/commands/automation/workflow-select.md +25 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/github/README.md +11 -0
- package/.claude/commands/github/code-review.md +25 -0
- package/.claude/commands/github/github-swarm.md +121 -0
- package/.claude/commands/github/issue-triage.md +25 -0
- package/.claude/commands/github/pr-enhance.md +26 -0
- package/.claude/commands/github/repo-analyze.md +25 -0
- package/.claude/commands/hooks/README.md +11 -0
- package/.claude/commands/hooks/post-edit.md +117 -0
- package/.claude/commands/hooks/post-task.md +112 -0
- package/.claude/commands/hooks/pre-edit.md +113 -0
- package/.claude/commands/hooks/pre-task.md +111 -0
- package/.claude/commands/hooks/session-end.md +118 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/monitoring/README.md +9 -0
- package/.claude/commands/monitoring/agent-metrics.md +25 -0
- package/.claude/commands/monitoring/real-time-view.md +25 -0
- package/.claude/commands/monitoring/swarm-monitor.md +25 -0
- package/.claude/commands/optimization/README.md +9 -0
- package/.claude/commands/optimization/cache-manage.md +25 -0
- package/.claude/commands/optimization/parallel-execute.md +25 -0
- package/.claude/commands/optimization/topology-optimize.md +25 -0
- package/.claude/commands/training/README.md +9 -0
- package/.claude/commands/training/model-update.md +25 -0
- package/.claude/commands/training/neural-train.md +25 -0
- package/.claude/commands/training/pattern-learn.md +25 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/checkpoint-hooks.sh +187 -0
- package/.claude/helpers/checkpoint-manager.sh +251 -0
- package/.claude/helpers/github-checkpoint-hooks.sh +218 -0
- package/.claude/helpers/github-safe.js +106 -0
- package/.claude/helpers/github-setup.sh +28 -0
- package/.claude/helpers/quick-start.sh +19 -0
- package/.claude/helpers/setup-checkpoints.sh +75 -0
- package/.claude/helpers/setup-mcp.sh +18 -0
- package/.claude/helpers/standard-checkpoint-hooks.sh +179 -0
- package/.claude/settings-checkpoint-example.json +29 -0
- package/.claude/settings-checkpoint-simple.json +24 -0
- package/.claude/settings-complete.json +138 -0
- package/.claude/settings.json +10 -10
- package/.claude/settings.local.json +1 -10
- package/CHANGELOG.md +54 -0
- package/README.md +20 -0
- package/bin/claude-flow +1 -1
- package/package.json +1 -1
- package/src/cli/command-registry.js +12 -1
- package/src/cli/commands/status.ts +1 -1
- package/src/cli/help-text.js +15 -6
- package/src/cli/index-remote.ts +1 -1
- package/src/cli/index.ts +1 -1
- package/src/cli/simple-cli.js +1 -1
- package/src/cli/simple-cli.ts +1 -1
- package/src/cli/simple-commands/agent.js +5 -0
- package/src/cli/simple-commands/analysis.js +370 -108
- package/src/cli/simple-commands/github/init.js +529 -0
- package/src/cli/simple-commands/github.js +15 -0
- package/src/cli/simple-commands/init/help.js +2 -0
- package/src/cli/simple-commands/init/index.js +112 -1
- package/src/cli/simple-commands/init/template-copier.js +1 -1
- package/src/cli/simple-commands/init/templates/commands/helpers/standard-checkpoint-hooks.sh +179 -0
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +642 -2
- package/src/cli/simple-commands/init/templates/settings.json +6 -2
- package/src/cli/simple-commands/performance-hooks.js +173 -0
- package/src/cli/simple-commands/performance-metrics.js +592 -0
- package/src/cli/simple-commands/process-ui-enhanced.js +2 -2
- package/src/cli/simple-commands/status.js +1 -1
- package/dist/agents/agent-loader.d.ts +0 -90
- package/dist/agents/agent-loader.d.ts.map +0 -1
- package/dist/agents/agent-loader.js +0 -195
- package/dist/agents/agent-loader.js.map +0 -1
- package/dist/agents/agent-manager.d.ts +0 -191
- package/dist/agents/agent-manager.d.ts.map +0 -1
- package/dist/agents/agent-manager.js +0 -1405
- package/dist/agents/agent-manager.js.map +0 -1
- package/dist/api/claude-api-errors.d.ts +0 -115
- package/dist/api/claude-api-errors.d.ts.map +0 -1
- package/dist/api/claude-api-errors.js +0 -198
- package/dist/api/claude-api-errors.js.map +0 -1
- package/dist/api/claude-client.d.ts +0 -197
- package/dist/api/claude-client.d.ts.map +0 -1
- package/dist/api/claude-client.js +0 -525
- package/dist/api/claude-client.js.map +0 -1
- package/dist/cli/cli-core.d.ts +0 -52
- package/dist/cli/cli-core.d.ts.map +0 -1
- package/dist/cli/cli-core.js +0 -264
- package/dist/cli/cli-core.js.map +0 -1
- package/dist/cli/command-registry.d.ts +0 -10
- package/dist/cli/command-registry.d.ts.map +0 -1
- package/dist/cli/command-registry.js +0 -758
- package/dist/cli/command-registry.js.map +0 -1
- package/dist/cli/commands/agent.d.ts +0 -7
- package/dist/cli/commands/agent.d.ts.map +0 -1
- package/dist/cli/commands/agent.js +0 -382
- package/dist/cli/commands/agent.js.map +0 -1
- package/dist/cli/commands/config.d.ts +0 -5
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js +0 -88
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/enterprise.d.ts +0 -3
- package/dist/cli/commands/enterprise.d.ts.map +0 -1
- package/dist/cli/commands/enterprise.js +0 -1506
- package/dist/cli/commands/enterprise.js.map +0 -1
- package/dist/cli/commands/help.d.ts +0 -7
- package/dist/cli/commands/help.d.ts.map +0 -1
- package/dist/cli/commands/help.js +0 -936
- package/dist/cli/commands/help.js.map +0 -1
- package/dist/cli/commands/hive-mind/index.d.ts +0 -19
- package/dist/cli/commands/hive-mind/index.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/index.js +0 -30
- package/dist/cli/commands/hive-mind/index.js.map +0 -1
- package/dist/cli/commands/hive-mind/init.d.ts +0 -10
- package/dist/cli/commands/hive-mind/init.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/init.js +0 -68
- package/dist/cli/commands/hive-mind/init.js.map +0 -1
- package/dist/cli/commands/hive-mind/pause.d.ts +0 -9
- package/dist/cli/commands/hive-mind/pause.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/pause.js +0 -81
- package/dist/cli/commands/hive-mind/pause.js.map +0 -1
- package/dist/cli/commands/hive-mind/ps.d.ts +0 -9
- package/dist/cli/commands/hive-mind/ps.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/ps.js +0 -120
- package/dist/cli/commands/hive-mind/ps.js.map +0 -1
- package/dist/cli/commands/hive-mind/resume.d.ts +0 -9
- package/dist/cli/commands/hive-mind/resume.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/resume.js +0 -62
- package/dist/cli/commands/hive-mind/resume.js.map +0 -1
- package/dist/cli/commands/hive-mind/spawn.d.ts +0 -10
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/spawn.js +0 -174
- package/dist/cli/commands/hive-mind/spawn.js.map +0 -1
- package/dist/cli/commands/hive-mind/status.d.ts +0 -10
- package/dist/cli/commands/hive-mind/status.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/status.js +0 -204
- package/dist/cli/commands/hive-mind/status.js.map +0 -1
- package/dist/cli/commands/hive-mind/stop.d.ts +0 -9
- package/dist/cli/commands/hive-mind/stop.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/stop.js +0 -125
- package/dist/cli/commands/hive-mind/stop.js.map +0 -1
- package/dist/cli/commands/hive-mind/task.d.ts +0 -10
- package/dist/cli/commands/hive-mind/task.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/task.js +0 -294
- package/dist/cli/commands/hive-mind/task.js.map +0 -1
- package/dist/cli/commands/hive-mind/wizard.d.ts +0 -10
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +0 -1
- package/dist/cli/commands/hive-mind/wizard.js +0 -531
- package/dist/cli/commands/hive-mind/wizard.js.map +0 -1
- package/dist/cli/commands/hive.d.ts +0 -6
- package/dist/cli/commands/hive.d.ts.map +0 -1
- package/dist/cli/commands/hive.js +0 -409
- package/dist/cli/commands/hive.js.map +0 -1
- package/dist/cli/commands/index.d.ts +0 -3
- package/dist/cli/commands/index.d.ts.map +0 -1
- package/dist/cli/commands/index.js +0 -2532
- package/dist/cli/commands/index.js.map +0 -1
- package/dist/cli/commands/mcp.d.ts +0 -5
- package/dist/cli/commands/mcp.d.ts.map +0 -1
- package/dist/cli/commands/mcp.js +0 -169
- package/dist/cli/commands/mcp.js.map +0 -1
- package/dist/cli/commands/memory.d.ts +0 -30
- package/dist/cli/commands/memory.d.ts.map +0 -1
- package/dist/cli/commands/memory.js +0 -225
- package/dist/cli/commands/memory.js.map +0 -1
- package/dist/cli/commands/migrate.d.ts +0 -6
- package/dist/cli/commands/migrate.d.ts.map +0 -1
- package/dist/cli/commands/migrate.js +0 -139
- package/dist/cli/commands/migrate.js.map +0 -1
- package/dist/cli/commands/monitor.d.ts +0 -6
- package/dist/cli/commands/monitor.d.ts.map +0 -1
- package/dist/cli/commands/monitor.js +0 -493
- package/dist/cli/commands/monitor.js.map +0 -1
- package/dist/cli/commands/session.d.ts +0 -6
- package/dist/cli/commands/session.d.ts.map +0 -1
- package/dist/cli/commands/session.js +0 -548
- package/dist/cli/commands/session.js.map +0 -1
- package/dist/cli/commands/sparc.d.ts +0 -3
- package/dist/cli/commands/sparc.d.ts.map +0 -1
- package/dist/cli/commands/sparc.js +0 -472
- package/dist/cli/commands/sparc.js.map +0 -1
- package/dist/cli/commands/start/event-emitter.d.ts +0 -13
- package/dist/cli/commands/start/event-emitter.d.ts.map +0 -1
- package/dist/cli/commands/start/event-emitter.js +0 -35
- package/dist/cli/commands/start/event-emitter.js.map +0 -1
- package/dist/cli/commands/start/index.d.ts +0 -10
- package/dist/cli/commands/start/index.d.ts.map +0 -1
- package/dist/cli/commands/start/index.js +0 -9
- package/dist/cli/commands/start/index.js.map +0 -1
- package/dist/cli/commands/start/process-manager.d.ts +0 -31
- package/dist/cli/commands/start/process-manager.d.ts.map +0 -1
- package/dist/cli/commands/start/process-manager.js +0 -283
- package/dist/cli/commands/start/process-manager.js.map +0 -1
- package/dist/cli/commands/start/process-ui-simple.d.ts +0 -29
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +0 -1
- package/dist/cli/commands/start/process-ui-simple.js +0 -334
- package/dist/cli/commands/start/process-ui-simple.js.map +0 -1
- package/dist/cli/commands/start/process-ui.d.ts +0 -5
- package/dist/cli/commands/start/process-ui.d.ts.map +0 -1
- package/dist/cli/commands/start/process-ui.js +0 -5
- package/dist/cli/commands/start/process-ui.js.map +0 -1
- package/dist/cli/commands/start/start-command.d.ts +0 -2
- package/dist/cli/commands/start/start-command.d.ts.map +0 -1
- package/dist/cli/commands/start/start-command.js +0 -462
- package/dist/cli/commands/start/start-command.js.map +0 -1
- package/dist/cli/commands/start/system-monitor.d.ts +0 -25
- package/dist/cli/commands/start/system-monitor.d.ts.map +0 -1
- package/dist/cli/commands/start/system-monitor.js +0 -265
- package/dist/cli/commands/start/system-monitor.js.map +0 -1
- package/dist/cli/commands/start/types.d.ts +0 -64
- package/dist/cli/commands/start/types.d.ts.map +0 -1
- package/dist/cli/commands/start/types.js +0 -22
- package/dist/cli/commands/start/types.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -6
- package/dist/cli/commands/start.d.ts.map +0 -1
- package/dist/cli/commands/start.js +0 -6
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -6
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -307
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/swarm.d.ts +0 -6
- package/dist/cli/commands/swarm.d.ts.map +0 -1
- package/dist/cli/commands/swarm.js +0 -465
- package/dist/cli/commands/swarm.js.map +0 -1
- package/dist/cli/commands/task.d.ts +0 -6
- package/dist/cli/commands/task.d.ts.map +0 -1
- package/dist/cli/commands/task.js +0 -75
- package/dist/cli/commands/task.js.map +0 -1
- package/dist/cli/commands/workflow.d.ts +0 -6
- package/dist/cli/commands/workflow.d.ts.map +0 -1
- package/dist/cli/commands/workflow.js +0 -624
- package/dist/cli/commands/workflow.js.map +0 -1
- package/dist/cli/completion.d.ts +0 -19
- package/dist/cli/completion.d.ts.map +0 -1
- package/dist/cli/completion.js +0 -545
- package/dist/cli/completion.js.map +0 -1
- package/dist/cli/formatter.d.ts +0 -69
- package/dist/cli/formatter.d.ts.map +0 -1
- package/dist/cli/formatter.js +0 -277
- package/dist/cli/formatter.js.map +0 -1
- package/dist/cli/help-formatter.d.ts +0 -49
- package/dist/cli/help-formatter.d.ts.map +0 -1
- package/dist/cli/help-formatter.js +0 -108
- package/dist/cli/help-formatter.js.map +0 -1
- package/dist/cli/index-remote.d.ts +0 -7
- package/dist/cli/index-remote.d.ts.map +0 -1
- package/dist/cli/index-remote.js +0 -126
- package/dist/cli/index-remote.js.map +0 -1
- package/dist/cli/index.d.ts +0 -7
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -191
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/node-compat.d.ts +0 -81
- package/dist/cli/node-compat.d.ts.map +0 -1
- package/dist/cli/node-compat.js +0 -229
- package/dist/cli/node-compat.js.map +0 -1
- package/dist/cli/repl.d.ts +0 -5
- package/dist/cli/repl.d.ts.map +0 -1
- package/dist/cli/repl.js +0 -949
- package/dist/cli/repl.js.map +0 -1
- package/dist/cli/runtime-detector.d.ts +0 -128
- package/dist/cli/runtime-detector.d.ts.map +0 -1
- package/dist/cli/runtime-detector.js +0 -267
- package/dist/cli/runtime-detector.js.map +0 -1
- package/dist/cli/simple-cli.d.ts +0 -7
- package/dist/cli/simple-cli.d.ts.map +0 -1
- package/dist/cli/simple-cli.js +0 -3074
- package/dist/cli/simple-cli.js.map +0 -1
- package/dist/cli/simple-commands/agent.d.ts +0 -2
- package/dist/cli/simple-commands/agent.d.ts.map +0 -1
- package/dist/cli/simple-commands/agent.js +0 -175
- package/dist/cli/simple-commands/agent.js.map +0 -1
- package/dist/cli/simple-commands/analysis.d.ts +0 -2
- package/dist/cli/simple-commands/analysis.d.ts.map +0 -1
- package/dist/cli/simple-commands/analysis.js +0 -207
- package/dist/cli/simple-commands/analysis.js.map +0 -1
- package/dist/cli/simple-commands/automation.d.ts +0 -2
- package/dist/cli/simple-commands/automation.d.ts.map +0 -1
- package/dist/cli/simple-commands/automation.js +0 -246
- package/dist/cli/simple-commands/automation.js.map +0 -1
- package/dist/cli/simple-commands/batch-manager.d.ts +0 -2
- package/dist/cli/simple-commands/batch-manager.d.ts.map +0 -1
- package/dist/cli/simple-commands/batch-manager.js +0 -290
- package/dist/cli/simple-commands/batch-manager.js.map +0 -1
- package/dist/cli/simple-commands/config.d.ts +0 -2
- package/dist/cli/simple-commands/config.d.ts.map +0 -1
- package/dist/cli/simple-commands/config.js +0 -278
- package/dist/cli/simple-commands/config.js.map +0 -1
- package/dist/cli/simple-commands/coordination.d.ts +0 -2
- package/dist/cli/simple-commands/coordination.d.ts.map +0 -1
- package/dist/cli/simple-commands/coordination.js +0 -249
- package/dist/cli/simple-commands/coordination.js.map +0 -1
- package/dist/cli/simple-commands/fix-hook-variables.d.ts +0 -16
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +0 -1
- package/dist/cli/simple-commands/fix-hook-variables.js +0 -320
- package/dist/cli/simple-commands/fix-hook-variables.js.map +0 -1
- package/dist/cli/simple-commands/github.d.ts +0 -3
- package/dist/cli/simple-commands/github.d.ts.map +0 -1
- package/dist/cli/simple-commands/github.js +0 -343
- package/dist/cli/simple-commands/github.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts +0 -68
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +0 -264
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/communication.d.ts +0 -176
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/communication.js +0 -611
- package/dist/cli/simple-commands/hive-mind/communication.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/core.d.ts +0 -306
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/core.js +0 -840
- package/dist/cli/simple-commands/hive-mind/core.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts +0 -32
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +0 -702
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts +0 -270
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +0 -1211
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/memory.d.ts +0 -334
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/memory.js +0 -1068
- package/dist/cli/simple-commands/hive-mind/memory.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts +0 -256
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +0 -520
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/queen.d.ts +0 -235
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/queen.js +0 -697
- package/dist/cli/simple-commands/hive-mind/queen.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind/session-manager.d.ts +0 -139
- package/dist/cli/simple-commands/hive-mind/session-manager.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind/session-manager.js +0 -835
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind-optimize.d.ts +0 -6
- package/dist/cli/simple-commands/hive-mind-optimize.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind-optimize.js +0 -317
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +0 -1
- package/dist/cli/simple-commands/hive-mind.d.ts +0 -18
- package/dist/cli/simple-commands/hive-mind.d.ts.map +0 -1
- package/dist/cli/simple-commands/hive-mind.js +0 -2430
- package/dist/cli/simple-commands/hive-mind.js.map +0 -1
- package/dist/cli/simple-commands/hook-safety.d.ts +0 -177
- package/dist/cli/simple-commands/hook-safety.d.ts.map +0 -1
- package/dist/cli/simple-commands/hook-safety.js +0 -590
- package/dist/cli/simple-commands/hook-safety.js.map +0 -1
- package/dist/cli/simple-commands/hooks.d.ts +0 -3
- package/dist/cli/simple-commands/hooks.d.ts.map +0 -1
- package/dist/cli/simple-commands/hooks.js +0 -1026
- package/dist/cli/simple-commands/hooks.js.map +0 -1
- package/dist/cli/simple-commands/init/agent-copier.d.ts +0 -43
- package/dist/cli/simple-commands/init/agent-copier.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/agent-copier.js +0 -200
- package/dist/cli/simple-commands/init/agent-copier.js.map +0 -1
- package/dist/cli/simple-commands/init/batch-init.d.ts +0 -137
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/batch-init.js +0 -558
- package/dist/cli/simple-commands/init/batch-init.js.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts +0 -2
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js +0 -433
- package/dist/cli/simple-commands/init/claude-commands/claude-flow-commands.js.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts +0 -2
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +0 -871
- package/dist/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts +0 -2
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +0 -332
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts +0 -3
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +0 -488
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts +0 -2
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js +0 -51
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts +0 -3
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +0 -288
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +0 -1
- package/dist/cli/simple-commands/init/copy-revised-templates.d.ts +0 -29
- package/dist/cli/simple-commands/init/copy-revised-templates.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/copy-revised-templates.js +0 -159
- package/dist/cli/simple-commands/init/copy-revised-templates.js.map +0 -1
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts +0 -2
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/executable-wrapper.js +0 -116
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +0 -1
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts +0 -23
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/gitignore-updater.js +0 -126
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +0 -1
- package/dist/cli/simple-commands/init/help.d.ts +0 -2
- package/dist/cli/simple-commands/init/help.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/help.js +0 -95
- package/dist/cli/simple-commands/init/help.js.map +0 -1
- package/dist/cli/simple-commands/init/index.d.ts +0 -2
- package/dist/cli/simple-commands/init/index.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/index.js +0 -1178
- package/dist/cli/simple-commands/init/index.js.map +0 -1
- package/dist/cli/simple-commands/init/performance-monitor.d.ts +0 -73
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/performance-monitor.js +0 -277
- package/dist/cli/simple-commands/init/performance-monitor.js.map +0 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts +0 -95
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +0 -486
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +0 -1
- package/dist/cli/simple-commands/init/rollback/index.d.ts +0 -114
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/rollback/index.js +0 -353
- package/dist/cli/simple-commands/init/rollback/index.js.map +0 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts +0 -161
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +0 -686
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +0 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts +0 -112
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +0 -480
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +0 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts +0 -121
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +0 -432
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +0 -1
- package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts +0 -2
- package/dist/cli/simple-commands/init/sparc/roo-readme.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/sparc/roo-readme.js +0 -61
- package/dist/cli/simple-commands/init/sparc/roo-readme.js.map +0 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts +0 -2
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +0 -80
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +0 -1
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts +0 -2
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/sparc/workflows.js +0 -36
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +0 -1
- package/dist/cli/simple-commands/init/sparc-structure.d.ts +0 -2
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/sparc-structure.js +0 -63
- package/dist/cli/simple-commands/init/sparc-structure.js.map +0 -1
- package/dist/cli/simple-commands/init/template-copier.d.ts +0 -27
- package/dist/cli/simple-commands/init/template-copier.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/template-copier.js +0 -510
- package/dist/cli/simple-commands/init/template-copier.js.map +0 -1
- package/dist/cli/simple-commands/init/templates/claude-md.d.ts +0 -5
- package/dist/cli/simple-commands/init/templates/claude-md.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/templates/claude-md.js +0 -646
- package/dist/cli/simple-commands/init/templates/claude-md.js.map +0 -1
- package/dist/cli/simple-commands/init/templates/coordination-md.d.ts +0 -4
- package/dist/cli/simple-commands/init/templates/coordination-md.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/templates/coordination-md.js +0 -338
- package/dist/cli/simple-commands/init/templates/coordination-md.js.map +0 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts +0 -18
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +0 -1407
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +0 -1
- package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts +0 -4
- package/dist/cli/simple-commands/init/templates/memory-bank-md.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/templates/memory-bank-md.js +0 -257
- package/dist/cli/simple-commands/init/templates/memory-bank-md.js.map +0 -1
- package/dist/cli/simple-commands/init/templates/readme-files.d.ts +0 -3
- package/dist/cli/simple-commands/init/templates/readme-files.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/templates/readme-files.js +0 -71
- package/dist/cli/simple-commands/init/templates/readme-files.js.map +0 -1
- package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts +0 -30
- package/dist/cli/simple-commands/init/templates/sparc-modes.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +0 -1375
- package/dist/cli/simple-commands/init/templates/sparc-modes.js.map +0 -1
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts +0 -63
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/validation/config-validator.js +0 -308
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +0 -1
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts +0 -117
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/validation/health-checker.js +0 -539
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +0 -1
- package/dist/cli/simple-commands/init/validation/index.d.ts +0 -55
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/validation/index.js +0 -347
- package/dist/cli/simple-commands/init/validation/index.js.map +0 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts +0 -76
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.js +0 -343
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +0 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts +0 -62
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +0 -349
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +0 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts +0 -86
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +0 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +0 -260
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +0 -1
- package/dist/cli/simple-commands/mcp.d.ts +0 -2
- package/dist/cli/simple-commands/mcp.d.ts.map +0 -1
- package/dist/cli/simple-commands/mcp.js +0 -366
- package/dist/cli/simple-commands/mcp.js.map +0 -1
- package/dist/cli/simple-commands/memory.d.ts +0 -2
- package/dist/cli/simple-commands/memory.d.ts.map +0 -1
- package/dist/cli/simple-commands/memory.js +0 -278
- package/dist/cli/simple-commands/memory.js.map +0 -1
- package/dist/cli/simple-commands/migrate-hooks.d.ts +0 -10
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +0 -1
- package/dist/cli/simple-commands/migrate-hooks.js +0 -57
- package/dist/cli/simple-commands/migrate-hooks.js.map +0 -1
- package/dist/cli/simple-commands/monitor.d.ts +0 -3
- package/dist/cli/simple-commands/monitor.d.ts.map +0 -1
- package/dist/cli/simple-commands/monitor.js +0 -366
- package/dist/cli/simple-commands/monitor.js.map +0 -1
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts +0 -55
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +0 -1
- package/dist/cli/simple-commands/process-ui-enhanced.js +0 -680
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/architect.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/architect.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/architect.js +0 -126
- package/dist/cli/simple-commands/sparc-modes/architect.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/ask.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/ask.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/ask.js +0 -127
- package/dist/cli/simple-commands/sparc-modes/ask.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/code.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/code.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/code.js +0 -149
- package/dist/cli/simple-commands/sparc-modes/code.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/debug.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/debug.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/debug.js +0 -113
- package/dist/cli/simple-commands/sparc-modes/debug.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/devops.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/devops.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/devops.js +0 -138
- package/dist/cli/simple-commands/sparc-modes/devops.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/docs-writer.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/docs-writer.js +0 -39
- package/dist/cli/simple-commands/sparc-modes/docs-writer.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/generic.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/generic.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/generic.js +0 -35
- package/dist/cli/simple-commands/sparc-modes/generic.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/index.d.ts +0 -17
- package/dist/cli/simple-commands/sparc-modes/index.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/index.js +0 -196
- package/dist/cli/simple-commands/sparc-modes/index.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/integration.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/integration.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/integration.js +0 -56
- package/dist/cli/simple-commands/sparc-modes/integration.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/mcp.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/mcp.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/mcp.js +0 -39
- package/dist/cli/simple-commands/sparc-modes/mcp.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/monitoring.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/monitoring.js +0 -39
- package/dist/cli/simple-commands/sparc-modes/monitoring.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/optimization.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/optimization.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/optimization.js +0 -39
- package/dist/cli/simple-commands/sparc-modes/optimization.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/security-review.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/security-review.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/security-review.js +0 -131
- package/dist/cli/simple-commands/sparc-modes/security-review.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js +0 -168
- package/dist/cli/simple-commands/sparc-modes/sparc-orchestrator.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js +0 -39
- package/dist/cli/simple-commands/sparc-modes/spec-pseudocode.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.js +0 -150
- package/dist/cli/simple-commands/sparc-modes/supabase-admin.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/swarm.d.ts +0 -81
- package/dist/cli/simple-commands/sparc-modes/swarm.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/swarm.js +0 -428
- package/dist/cli/simple-commands/sparc-modes/swarm.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/tdd.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/tdd.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/tdd.js +0 -113
- package/dist/cli/simple-commands/sparc-modes/tdd.js.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts +0 -2
- package/dist/cli/simple-commands/sparc-modes/tutorial.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc-modes/tutorial.js +0 -278
- package/dist/cli/simple-commands/sparc-modes/tutorial.js.map +0 -1
- package/dist/cli/simple-commands/sparc.d.ts +0 -2
- package/dist/cli/simple-commands/sparc.d.ts.map +0 -1
- package/dist/cli/simple-commands/sparc.js +0 -480
- package/dist/cli/simple-commands/sparc.js.map +0 -1
- package/dist/cli/simple-commands/start-ui.d.ts +0 -2
- package/dist/cli/simple-commands/start-ui.d.ts.map +0 -1
- package/dist/cli/simple-commands/start-ui.js +0 -135
- package/dist/cli/simple-commands/start-ui.js.map +0 -1
- package/dist/cli/simple-commands/start-wrapper.d.ts +0 -2
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +0 -1
- package/dist/cli/simple-commands/start-wrapper.js +0 -264
- package/dist/cli/simple-commands/start-wrapper.js.map +0 -1
- package/dist/cli/simple-commands/start.d.ts +0 -2
- package/dist/cli/simple-commands/start.d.ts.map +0 -1
- package/dist/cli/simple-commands/start.js +0 -3
- package/dist/cli/simple-commands/start.js.map +0 -1
- package/dist/cli/simple-commands/status.d.ts +0 -2
- package/dist/cli/simple-commands/status.d.ts.map +0 -1
- package/dist/cli/simple-commands/status.js +0 -274
- package/dist/cli/simple-commands/status.js.map +0 -1
- package/dist/cli/simple-commands/swarm-executor.d.ts +0 -68
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +0 -1
- package/dist/cli/simple-commands/swarm-executor.js +0 -218
- package/dist/cli/simple-commands/swarm-executor.js.map +0 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts +0 -69
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +0 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.js +0 -294
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +0 -1
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts +0 -68
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +0 -1
- package/dist/cli/simple-commands/swarm-webui-integration.js +0 -265
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +0 -1
- package/dist/cli/simple-commands/swarm.d.ts +0 -2
- package/dist/cli/simple-commands/swarm.d.ts.map +0 -1
- package/dist/cli/simple-commands/swarm.js +0 -1964
- package/dist/cli/simple-commands/swarm.js.map +0 -1
- package/dist/cli/simple-commands/task.d.ts +0 -2
- package/dist/cli/simple-commands/task.d.ts.map +0 -1
- package/dist/cli/simple-commands/task.js +0 -190
- package/dist/cli/simple-commands/task.js.map +0 -1
- package/dist/cli/simple-commands/training.d.ts +0 -2
- package/dist/cli/simple-commands/training.d.ts.map +0 -1
- package/dist/cli/simple-commands/training.js +0 -240
- package/dist/cli/simple-commands/training.js.map +0 -1
- package/dist/cli/simple-commands/web-server.d.ts +0 -152
- package/dist/cli/simple-commands/web-server.d.ts.map +0 -1
- package/dist/cli/simple-commands/web-server.js +0 -816
- package/dist/cli/simple-commands/web-server.js.map +0 -1
- package/dist/cli/utils/interactive-detector.d.ts +0 -25
- package/dist/cli/utils/interactive-detector.d.ts.map +0 -1
- package/dist/cli/utils/interactive-detector.js +0 -129
- package/dist/cli/utils/interactive-detector.js.map +0 -1
- package/dist/cli/utils/safe-interactive.d.ts +0 -30
- package/dist/cli/utils/safe-interactive.d.ts.map +0 -1
- package/dist/cli/utils/safe-interactive.js +0 -134
- package/dist/cli/utils/safe-interactive.js.map +0 -1
- package/dist/cli/utils.d.ts +0 -75
- package/dist/cli/utils.d.ts.map +0 -1
- package/dist/cli/utils.js +0 -567
- package/dist/cli/utils.js.map +0 -1
- package/dist/config/config-manager.d.ts +0 -212
- package/dist/config/config-manager.d.ts.map +0 -1
- package/dist/config/config-manager.js +0 -550
- package/dist/config/config-manager.js.map +0 -1
- package/dist/constants/agent-types.d.ts +0 -55
- package/dist/constants/agent-types.d.ts.map +0 -1
- package/dist/constants/agent-types.js +0 -66
- package/dist/constants/agent-types.js.map +0 -1
- package/dist/coordination/advanced-scheduler.d.ts +0 -121
- package/dist/coordination/advanced-scheduler.d.ts.map +0 -1
- package/dist/coordination/advanced-scheduler.js +0 -382
- package/dist/coordination/advanced-scheduler.js.map +0 -1
- package/dist/coordination/background-executor.d.ts +0 -69
- package/dist/coordination/background-executor.d.ts.map +0 -1
- package/dist/coordination/background-executor.js +0 -363
- package/dist/coordination/background-executor.js.map +0 -1
- package/dist/coordination/circuit-breaker.d.ts +0 -124
- package/dist/coordination/circuit-breaker.d.ts.map +0 -1
- package/dist/coordination/circuit-breaker.js +0 -301
- package/dist/coordination/circuit-breaker.js.map +0 -1
- package/dist/coordination/conflict-resolution.d.ts +0 -133
- package/dist/coordination/conflict-resolution.d.ts.map +0 -1
- package/dist/coordination/conflict-resolution.js +0 -360
- package/dist/coordination/conflict-resolution.js.map +0 -1
- package/dist/coordination/dependency-graph.d.ts +0 -78
- package/dist/coordination/dependency-graph.d.ts.map +0 -1
- package/dist/coordination/dependency-graph.js +0 -387
- package/dist/coordination/dependency-graph.js.map +0 -1
- package/dist/coordination/manager.d.ts +0 -66
- package/dist/coordination/manager.d.ts.map +0 -1
- package/dist/coordination/manager.js +0 -354
- package/dist/coordination/manager.js.map +0 -1
- package/dist/coordination/messaging.d.ts +0 -37
- package/dist/coordination/messaging.d.ts.map +0 -1
- package/dist/coordination/messaging.js +0 -219
- package/dist/coordination/messaging.js.map +0 -1
- package/dist/coordination/metrics.d.ts +0 -153
- package/dist/coordination/metrics.d.ts.map +0 -1
- package/dist/coordination/metrics.js +0 -436
- package/dist/coordination/metrics.js.map +0 -1
- package/dist/coordination/resources.d.ts +0 -36
- package/dist/coordination/resources.d.ts.map +0 -1
- package/dist/coordination/resources.js +0 -254
- package/dist/coordination/resources.js.map +0 -1
- package/dist/coordination/scheduler.d.ts +0 -48
- package/dist/coordination/scheduler.d.ts.map +0 -1
- package/dist/coordination/scheduler.js +0 -308
- package/dist/coordination/scheduler.js.map +0 -1
- package/dist/coordination/swarm-coordinator.d.ts +0 -116
- package/dist/coordination/swarm-coordinator.d.ts.map +0 -1
- package/dist/coordination/swarm-coordinator.js +0 -563
- package/dist/coordination/swarm-coordinator.js.map +0 -1
- package/dist/coordination/swarm-monitor.d.ts +0 -101
- package/dist/coordination/swarm-monitor.d.ts.map +0 -1
- package/dist/coordination/swarm-monitor.js +0 -340
- package/dist/coordination/swarm-monitor.js.map +0 -1
- package/dist/coordination/work-stealing.d.ts +0 -44
- package/dist/coordination/work-stealing.d.ts.map +0 -1
- package/dist/coordination/work-stealing.js +0 -158
- package/dist/coordination/work-stealing.js.map +0 -1
- package/dist/core/config.d.ts +0 -243
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js +0 -1125
- package/dist/core/config.js.map +0 -1
- package/dist/core/event-bus.d.ts +0 -63
- package/dist/core/event-bus.d.ts.map +0 -1
- package/dist/core/event-bus.js +0 -153
- package/dist/core/event-bus.js.map +0 -1
- package/dist/core/json-persistence.d.ts +0 -55
- package/dist/core/json-persistence.d.ts.map +0 -1
- package/dist/core/json-persistence.js +0 -111
- package/dist/core/json-persistence.js.map +0 -1
- package/dist/core/logger.d.ts +0 -62
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js +0 -252
- package/dist/core/logger.js.map +0 -1
- package/dist/core/orchestrator-fixed.d.ts +0 -81
- package/dist/core/orchestrator-fixed.d.ts.map +0 -1
- package/dist/core/orchestrator-fixed.js +0 -213
- package/dist/core/orchestrator-fixed.js.map +0 -1
- package/dist/core/orchestrator.d.ts +0 -123
- package/dist/core/orchestrator.d.ts.map +0 -1
- package/dist/core/orchestrator.js +0 -1058
- package/dist/core/orchestrator.js.map +0 -1
- package/dist/enterprise/analytics-manager.d.ts +0 -489
- package/dist/enterprise/analytics-manager.d.ts.map +0 -1
- package/dist/enterprise/analytics-manager.js +0 -956
- package/dist/enterprise/analytics-manager.js.map +0 -1
- package/dist/enterprise/audit-manager.d.ts +0 -459
- package/dist/enterprise/audit-manager.d.ts.map +0 -1
- package/dist/enterprise/audit-manager.js +0 -1014
- package/dist/enterprise/audit-manager.js.map +0 -1
- package/dist/enterprise/cloud-manager.d.ts +0 -435
- package/dist/enterprise/cloud-manager.d.ts.map +0 -1
- package/dist/enterprise/cloud-manager.js +0 -789
- package/dist/enterprise/cloud-manager.js.map +0 -1
- package/dist/enterprise/deployment-manager.d.ts +0 -328
- package/dist/enterprise/deployment-manager.d.ts.map +0 -1
- package/dist/enterprise/deployment-manager.js +0 -830
- package/dist/enterprise/deployment-manager.js.map +0 -1
- package/dist/enterprise/project-manager.d.ts +0 -228
- package/dist/enterprise/project-manager.d.ts.map +0 -1
- package/dist/enterprise/project-manager.js +0 -537
- package/dist/enterprise/project-manager.js.map +0 -1
- package/dist/enterprise/security-manager.d.ts +0 -422
- package/dist/enterprise/security-manager.d.ts.map +0 -1
- package/dist/enterprise/security-manager.js +0 -910
- package/dist/enterprise/security-manager.js.map +0 -1
- package/dist/hive-mind/core/Agent.d.ts +0 -137
- package/dist/hive-mind/core/Agent.d.ts.map +0 -1
- package/dist/hive-mind/core/Agent.js +0 -567
- package/dist/hive-mind/core/Agent.js.map +0 -1
- package/dist/hive-mind/core/Communication.d.ts +0 -116
- package/dist/hive-mind/core/Communication.d.ts.map +0 -1
- package/dist/hive-mind/core/Communication.js +0 -407
- package/dist/hive-mind/core/Communication.js.map +0 -1
- package/dist/hive-mind/core/DatabaseManager.d.ts +0 -99
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +0 -1
- package/dist/hive-mind/core/DatabaseManager.js +0 -648
- package/dist/hive-mind/core/DatabaseManager.js.map +0 -1
- package/dist/hive-mind/core/HiveMind.d.ts +0 -90
- package/dist/hive-mind/core/HiveMind.d.ts.map +0 -1
- package/dist/hive-mind/core/HiveMind.js +0 -455
- package/dist/hive-mind/core/HiveMind.js.map +0 -1
- package/dist/hive-mind/core/Memory.d.ts +0 -235
- package/dist/hive-mind/core/Memory.d.ts.map +0 -1
- package/dist/hive-mind/core/Memory.js +0 -1192
- package/dist/hive-mind/core/Memory.js.map +0 -1
- package/dist/hive-mind/core/Queen.d.ts +0 -115
- package/dist/hive-mind/core/Queen.d.ts.map +0 -1
- package/dist/hive-mind/core/Queen.js +0 -649
- package/dist/hive-mind/core/Queen.js.map +0 -1
- package/dist/hive-mind/integration/ConsensusEngine.d.ts +0 -117
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +0 -1
- package/dist/hive-mind/integration/ConsensusEngine.js +0 -478
- package/dist/hive-mind/integration/ConsensusEngine.js.map +0 -1
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts +0 -172
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +0 -1
- package/dist/hive-mind/integration/MCPToolWrapper.js +0 -217
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +0 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts +0 -172
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +0 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.js +0 -748
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +0 -1
- package/dist/hive-mind/types.d.ts +0 -314
- package/dist/hive-mind/types.d.ts.map +0 -1
- package/dist/hive-mind/types.js +0 -7
- package/dist/hive-mind/types.js.map +0 -1
- package/dist/mcp/auth.d.ts +0 -80
- package/dist/mcp/auth.d.ts.map +0 -1
- package/dist/mcp/auth.js +0 -350
- package/dist/mcp/auth.js.map +0 -1
- package/dist/mcp/claude-flow-tools.d.ts +0 -13
- package/dist/mcp/claude-flow-tools.d.ts.map +0 -1
- package/dist/mcp/claude-flow-tools.js +0 -1176
- package/dist/mcp/claude-flow-tools.js.map +0 -1
- package/dist/mcp/load-balancer.d.ts +0 -88
- package/dist/mcp/load-balancer.d.ts.map +0 -1
- package/dist/mcp/load-balancer.js +0 -393
- package/dist/mcp/load-balancer.js.map +0 -1
- package/dist/mcp/router.d.ts +0 -54
- package/dist/mcp/router.d.ts.map +0 -1
- package/dist/mcp/router.js +0 -204
- package/dist/mcp/router.js.map +0 -1
- package/dist/mcp/ruv-swarm-tools.d.ts +0 -58
- package/dist/mcp/ruv-swarm-tools.d.ts.map +0 -1
- package/dist/mcp/ruv-swarm-tools.js +0 -548
- package/dist/mcp/ruv-swarm-tools.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -75
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -538
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/session-manager.d.ts +0 -60
- package/dist/mcp/session-manager.d.ts.map +0 -1
- package/dist/mcp/session-manager.js +0 -323
- package/dist/mcp/session-manager.js.map +0 -1
- package/dist/mcp/swarm-tools.d.ts +0 -87
- package/dist/mcp/swarm-tools.d.ts.map +0 -1
- package/dist/mcp/swarm-tools.js +0 -731
- package/dist/mcp/swarm-tools.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -145
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -434
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/transports/base.d.ts +0 -22
- package/dist/mcp/transports/base.d.ts.map +0 -1
- package/dist/mcp/transports/base.js +0 -5
- package/dist/mcp/transports/base.js.map +0 -1
- package/dist/mcp/transports/http.d.ts +0 -48
- package/dist/mcp/transports/http.d.ts.map +0 -1
- package/dist/mcp/transports/http.js +0 -400
- package/dist/mcp/transports/http.js.map +0 -1
- package/dist/mcp/transports/stdio.d.ts +0 -37
- package/dist/mcp/transports/stdio.d.ts.map +0 -1
- package/dist/mcp/transports/stdio.js +0 -206
- package/dist/mcp/transports/stdio.js.map +0 -1
- package/dist/memory/advanced-serializer.d.ts +0 -159
- package/dist/memory/advanced-serializer.d.ts.map +0 -1
- package/dist/memory/advanced-serializer.js +0 -564
- package/dist/memory/advanced-serializer.js.map +0 -1
- package/dist/memory/backends/base.d.ts +0 -21
- package/dist/memory/backends/base.d.ts.map +0 -1
- package/dist/memory/backends/base.js +0 -5
- package/dist/memory/backends/base.js.map +0 -1
- package/dist/memory/backends/markdown.d.ts +0 -35
- package/dist/memory/backends/markdown.d.ts.map +0 -1
- package/dist/memory/backends/markdown.js +0 -223
- package/dist/memory/backends/markdown.js.map +0 -1
- package/dist/memory/backends/sqlite.d.ts +0 -33
- package/dist/memory/backends/sqlite.d.ts.map +0 -1
- package/dist/memory/backends/sqlite.js +0 -291
- package/dist/memory/backends/sqlite.js.map +0 -1
- package/dist/memory/cache.d.ts +0 -65
- package/dist/memory/cache.d.ts.map +0 -1
- package/dist/memory/cache.js +0 -188
- package/dist/memory/cache.js.map +0 -1
- package/dist/memory/distributed-memory.d.ts +0 -188
- package/dist/memory/distributed-memory.d.ts.map +0 -1
- package/dist/memory/distributed-memory.js +0 -710
- package/dist/memory/distributed-memory.js.map +0 -1
- package/dist/memory/enhanced-session-serializer.d.ts +0 -115
- package/dist/memory/enhanced-session-serializer.d.ts.map +0 -1
- package/dist/memory/enhanced-session-serializer.js +0 -478
- package/dist/memory/enhanced-session-serializer.js.map +0 -1
- package/dist/memory/fallback-store.d.ts +0 -28
- package/dist/memory/fallback-store.d.ts.map +0 -1
- package/dist/memory/fallback-store.js +0 -101
- package/dist/memory/fallback-store.js.map +0 -1
- package/dist/memory/in-memory-store.d.ts +0 -37
- package/dist/memory/in-memory-store.d.ts.map +0 -1
- package/dist/memory/in-memory-store.js +0 -174
- package/dist/memory/in-memory-store.js.map +0 -1
- package/dist/memory/indexer.d.ts +0 -52
- package/dist/memory/indexer.d.ts.map +0 -1
- package/dist/memory/indexer.js +0 -191
- package/dist/memory/indexer.js.map +0 -1
- package/dist/memory/manager.d.ts +0 -58
- package/dist/memory/manager.d.ts.map +0 -1
- package/dist/memory/manager.js +0 -423
- package/dist/memory/manager.js.map +0 -1
- package/dist/memory/sqlite-store.d.ts +0 -34
- package/dist/memory/sqlite-store.d.ts.map +0 -1
- package/dist/memory/sqlite-store.js +0 -267
- package/dist/memory/sqlite-store.js.map +0 -1
- package/dist/memory/sqlite-wrapper.d.ts +0 -38
- package/dist/memory/sqlite-wrapper.d.ts.map +0 -1
- package/dist/memory/sqlite-wrapper.js +0 -152
- package/dist/memory/sqlite-wrapper.js.map +0 -1
- package/dist/memory/swarm-memory.d.ts +0 -91
- package/dist/memory/swarm-memory.d.ts.map +0 -1
- package/dist/memory/swarm-memory.js +0 -454
- package/dist/memory/swarm-memory.js.map +0 -1
- package/dist/migration/logger.d.ts +0 -26
- package/dist/migration/logger.d.ts.map +0 -1
- package/dist/migration/logger.js +0 -145
- package/dist/migration/logger.js.map +0 -1
- package/dist/migration/migration-analyzer.d.ts +0 -18
- package/dist/migration/migration-analyzer.d.ts.map +0 -1
- package/dist/migration/migration-analyzer.js +0 -284
- package/dist/migration/migration-analyzer.js.map +0 -1
- package/dist/migration/migration-runner.d.ts +0 -26
- package/dist/migration/migration-runner.d.ts.map +0 -1
- package/dist/migration/migration-runner.js +0 -505
- package/dist/migration/migration-runner.js.map +0 -1
- package/dist/migration/migration-validator.d.ts +0 -17
- package/dist/migration/migration-validator.d.ts.map +0 -1
- package/dist/migration/migration-validator.js +0 -309
- package/dist/migration/migration-validator.js.map +0 -1
- package/dist/migration/progress-reporter.d.ts +0 -28
- package/dist/migration/progress-reporter.d.ts.map +0 -1
- package/dist/migration/progress-reporter.js +0 -163
- package/dist/migration/progress-reporter.js.map +0 -1
- package/dist/migration/rollback-manager.d.ts +0 -24
- package/dist/migration/rollback-manager.d.ts.map +0 -1
- package/dist/migration/rollback-manager.js +0 -351
- package/dist/migration/rollback-manager.js.map +0 -1
- package/dist/migration/types.d.ts +0 -103
- package/dist/migration/types.d.ts.map +0 -1
- package/dist/migration/types.js +0 -6
- package/dist/migration/types.js.map +0 -1
- package/dist/swarm/types.d.ts +0 -578
- package/dist/swarm/types.d.ts.map +0 -1
- package/dist/swarm/types.js +0 -54
- package/dist/swarm/types.js.map +0 -1
- package/dist/terminal/adapters/base.d.ts +0 -40
- package/dist/terminal/adapters/base.d.ts.map +0 -1
- package/dist/terminal/adapters/base.js +0 -5
- package/dist/terminal/adapters/base.js.map +0 -1
- package/dist/terminal/adapters/native.d.ts +0 -19
- package/dist/terminal/adapters/native.d.ts.map +0 -1
- package/dist/terminal/adapters/native.js +0 -414
- package/dist/terminal/adapters/native.js.map +0 -1
- package/dist/terminal/adapters/vscode.d.ts +0 -23
- package/dist/terminal/adapters/vscode.d.ts.map +0 -1
- package/dist/terminal/adapters/vscode.js +0 -267
- package/dist/terminal/adapters/vscode.js.map +0 -1
- package/dist/terminal/manager.d.ts +0 -59
- package/dist/terminal/manager.d.ts.map +0 -1
- package/dist/terminal/manager.js +0 -235
- package/dist/terminal/manager.js.map +0 -1
- package/dist/terminal/pool.d.ts +0 -32
- package/dist/terminal/pool.d.ts.map +0 -1
- package/dist/terminal/pool.js +0 -208
- package/dist/terminal/pool.js.map +0 -1
- package/dist/terminal/session.d.ts +0 -41
- package/dist/terminal/session.d.ts.map +0 -1
- package/dist/terminal/session.js +0 -210
- package/dist/terminal/session.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -14
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -29
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -121
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -194
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/formatters.d.ts +0 -15
- package/dist/utils/formatters.d.ts.map +0 -1
- package/dist/utils/formatters.js +0 -75
- package/dist/utils/formatters.js.map +0 -1
- package/dist/utils/helpers.d.ts +0 -134
- package/dist/utils/helpers.d.ts.map +0 -1
- package/dist/utils/helpers.js +0 -444
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/npx-isolated-cache.d.ts +0 -17
- package/dist/utils/npx-isolated-cache.d.ts.map +0 -1
- package/dist/utils/npx-isolated-cache.js +0 -140
- package/dist/utils/npx-isolated-cache.js.map +0 -1
- package/dist/utils/type-guards.d.ts +0 -117
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils/type-guards.js +0 -166
- package/dist/utils/type-guards.js.map +0 -1
- package/dist/utils/types.d.ts +0 -568
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js +0 -37
- package/dist/utils/types.js.map +0 -1
|
@@ -1,1178 +0,0 @@
|
|
|
1
|
-
// init/index.js - Initialize Claude Code integration files
|
|
2
|
-
import { printSuccess, printError, printWarning, exit } from '../../utils.js';
|
|
3
|
-
import { existsSync } from 'fs';
|
|
4
|
-
import process from 'process';
|
|
5
|
-
import { spawn, execSync as execSyncOriginal } from 'child_process';
|
|
6
|
-
import { promisify } from 'util';
|
|
7
|
-
// Helper to replace Deno.Command
|
|
8
|
-
function runCommand(command, args, options = {}) {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
const child = spawn(command, args, {
|
|
11
|
-
cwd: options.cwd,
|
|
12
|
-
env: { ...process.env, ...options.env },
|
|
13
|
-
stdio: options.stdout === 'inherit' ? 'inherit' : 'pipe'
|
|
14
|
-
});
|
|
15
|
-
let stdout = '';
|
|
16
|
-
let stderr = '';
|
|
17
|
-
if (options.stdout !== 'inherit') {
|
|
18
|
-
child.stdout.on('data', (data) => { stdout += data; });
|
|
19
|
-
child.stderr.on('data', (data) => { stderr += data; });
|
|
20
|
-
}
|
|
21
|
-
child.on('close', (code) => {
|
|
22
|
-
if (code === 0) {
|
|
23
|
-
resolve({ success: true, code, stdout, stderr });
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
reject(new Error(`Command failed with exit code ${code}`));
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
child.on('error', reject);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
import { createLocalExecutable } from './executable-wrapper.js';
|
|
33
|
-
import { createSparcStructureManually } from './sparc-structure.js';
|
|
34
|
-
import { createClaudeSlashCommands } from './claude-commands/slash-commands.js';
|
|
35
|
-
import { createOptimizedClaudeSlashCommands } from './claude-commands/optimized-slash-commands.js';
|
|
36
|
-
// execSync imported above as execSyncOriginal\nconst execSync = execSyncOriginal;
|
|
37
|
-
import { promises as fs } from 'fs';
|
|
38
|
-
import { copyTemplates } from './template-copier.js';
|
|
39
|
-
import { copyRevisedTemplates, validateTemplatesExist } from './copy-revised-templates.js';
|
|
40
|
-
import { copyAgentFiles, createAgentDirectories, validateAgentSystem } from './agent-copier.js';
|
|
41
|
-
import { showInitHelp } from './help.js';
|
|
42
|
-
import { batchInitCommand, batchInitFromConfig, validateBatchOptions } from './batch-init.js';
|
|
43
|
-
import { ValidationSystem, runFullValidation } from './validation/index.js';
|
|
44
|
-
import { RollbackSystem, createAtomicOperation } from './rollback/index.js';
|
|
45
|
-
import { createEnhancedClaudeMd, createEnhancedSettingsJson, createWrapperScript, createCommandDoc, createHelperScript, COMMAND_STRUCTURE, } from './templates/enhanced-templates.js';
|
|
46
|
-
import { getIsolatedNpxEnv } from '../../../utils/npx-isolated-cache.js';
|
|
47
|
-
import { updateGitignore, needsGitignoreUpdate } from './gitignore-updater.js';
|
|
48
|
-
import { createFullClaudeMd, createSparcClaudeMd, createMinimalClaudeMd, } from './templates/claude-md.js';
|
|
49
|
-
import { createFullMemoryBankMd, createMinimalMemoryBankMd, } from './templates/memory-bank-md.js';
|
|
50
|
-
import { createFullCoordinationMd, createMinimalCoordinationMd, } from './templates/coordination-md.js';
|
|
51
|
-
import { createAgentsReadme, createSessionsReadme } from './templates/readme-files.js';
|
|
52
|
-
/**
|
|
53
|
-
* Check if Claude Code CLI is installed
|
|
54
|
-
*/
|
|
55
|
-
function isClaudeCodeInstalled() {
|
|
56
|
-
try {
|
|
57
|
-
execSync('which claude', { stdio: 'ignore' });
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Set up MCP servers in Claude Code
|
|
66
|
-
*/
|
|
67
|
-
async function setupMcpServers(dryRun = false) {
|
|
68
|
-
console.log('\n🔌 Setting up MCP servers for Claude Code...');
|
|
69
|
-
const servers = [
|
|
70
|
-
{
|
|
71
|
-
name: 'claude-flow',
|
|
72
|
-
command: 'npx claude-flow@alpha mcp start',
|
|
73
|
-
description: 'Claude Flow MCP server with swarm orchestration (alpha)',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'ruv-swarm',
|
|
77
|
-
command: 'npx ruv-swarm mcp start',
|
|
78
|
-
description: 'ruv-swarm MCP server for enhanced coordination',
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
for (const server of servers) {
|
|
82
|
-
try {
|
|
83
|
-
if (!dryRun) {
|
|
84
|
-
console.log(` 🔄 Adding ${server.name}...`);
|
|
85
|
-
execSync(`claude mcp add ${server.name} ${server.command}`, { stdio: 'inherit' });
|
|
86
|
-
console.log(` ✅ Added ${server.name} - ${server.description}`);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
console.log(` [DRY RUN] Would add ${server.name} - ${server.description}`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (err) {
|
|
93
|
-
console.log(` ⚠️ Failed to add ${server.name}: ${err.message}`);
|
|
94
|
-
console.log(` You can add it manually with: claude mcp add ${server.name} ${server.command}`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (!dryRun) {
|
|
98
|
-
console.log('\n 📋 Verifying MCP servers...');
|
|
99
|
-
try {
|
|
100
|
-
execSync('claude mcp list', { stdio: 'inherit' });
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
console.log(' ⚠️ Could not verify MCP servers');
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
export async function initCommand(subArgs, flags) {
|
|
108
|
-
// Show help if requested
|
|
109
|
-
if (flags.help || flags.h || subArgs.includes('--help') || subArgs.includes('-h')) {
|
|
110
|
-
showInitHelp();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
// Default to enhanced Claude Flow v2 init
|
|
114
|
-
// Use --basic flag for old behavior
|
|
115
|
-
if (!flags.basic && !flags.minimal && !flags.sparc) {
|
|
116
|
-
return await enhancedClaudeFlowInit(flags, subArgs);
|
|
117
|
-
}
|
|
118
|
-
// Check for validation and rollback commands
|
|
119
|
-
if (subArgs.includes('--validate') || subArgs.includes('--validate-only')) {
|
|
120
|
-
return handleValidationCommand(subArgs, flags);
|
|
121
|
-
}
|
|
122
|
-
if (subArgs.includes('--rollback')) {
|
|
123
|
-
return handleRollbackCommand(subArgs, flags);
|
|
124
|
-
}
|
|
125
|
-
if (subArgs.includes('--list-backups')) {
|
|
126
|
-
return handleListBackups(subArgs, flags);
|
|
127
|
-
}
|
|
128
|
-
// Check for batch operations
|
|
129
|
-
const batchInitFlag = flags['batch-init'] || subArgs.includes('--batch-init');
|
|
130
|
-
const configFlag = flags.config || subArgs.includes('--config');
|
|
131
|
-
if (batchInitFlag || configFlag) {
|
|
132
|
-
return handleBatchInit(subArgs, flags);
|
|
133
|
-
}
|
|
134
|
-
// Check if enhanced initialization is requested
|
|
135
|
-
const useEnhanced = subArgs.includes('--enhanced') || subArgs.includes('--safe');
|
|
136
|
-
if (useEnhanced) {
|
|
137
|
-
return enhancedInitCommand(subArgs, flags);
|
|
138
|
-
}
|
|
139
|
-
// Parse init options
|
|
140
|
-
const initForce = subArgs.includes('--force') || subArgs.includes('-f') || flags.force;
|
|
141
|
-
const initMinimal = subArgs.includes('--minimal') || subArgs.includes('-m') || flags.minimal;
|
|
142
|
-
const initSparc = true; // SPARC is now included by default
|
|
143
|
-
const initDryRun = subArgs.includes('--dry-run') || subArgs.includes('-d') || flags.dryRun;
|
|
144
|
-
const initOptimized = initSparc && initForce; // Use optimized templates when both flags are present
|
|
145
|
-
const selectedModes = flags.modes ? flags.modes.split(',') : null; // Support selective mode initialization
|
|
146
|
-
// Get the actual working directory (where the command was run from)
|
|
147
|
-
// Use PWD environment variable which preserves the original directory
|
|
148
|
-
const workingDir = process.env.PWD || cwd();
|
|
149
|
-
console.log(`📁 Initializing in: ${workingDir}`);
|
|
150
|
-
// Change to the working directory to ensure all file operations happen there
|
|
151
|
-
try {
|
|
152
|
-
process.chdir(workingDir);
|
|
153
|
-
}
|
|
154
|
-
catch (err) {
|
|
155
|
-
printWarning(`Could not change to directory ${workingDir}: ${err.message}`);
|
|
156
|
-
}
|
|
157
|
-
try {
|
|
158
|
-
printSuccess('Initializing Claude Code integration files...');
|
|
159
|
-
// Check if files already exist in the working directory
|
|
160
|
-
const files = ['CLAUDE.md', 'memory-bank.md', 'coordination.md'];
|
|
161
|
-
const existingFiles = [];
|
|
162
|
-
for (const file of files) {
|
|
163
|
-
try {
|
|
164
|
-
await fs.stat(`${workingDir}/${file}`);
|
|
165
|
-
existingFiles.push(file);
|
|
166
|
-
}
|
|
167
|
-
catch {
|
|
168
|
-
// File doesn't exist, which is what we want
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (existingFiles.length > 0 && !initForce) {
|
|
172
|
-
printWarning(`The following files already exist: ${existingFiles.join(', ')}`);
|
|
173
|
-
console.log('Use --force to overwrite existing files');
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
// Use template copier to copy all template files
|
|
177
|
-
const templateOptions = {
|
|
178
|
-
sparc: initSparc,
|
|
179
|
-
minimal: initMinimal,
|
|
180
|
-
optimized: initOptimized,
|
|
181
|
-
dryRun: initDryRun,
|
|
182
|
-
force: initForce,
|
|
183
|
-
selectedModes: selectedModes,
|
|
184
|
-
};
|
|
185
|
-
// First try to copy revised templates from repository
|
|
186
|
-
const validation = validateTemplatesExist();
|
|
187
|
-
if (validation.valid) {
|
|
188
|
-
console.log(' 📁 Copying revised template files...');
|
|
189
|
-
const revisedResults = await copyRevisedTemplates(workingDir, {
|
|
190
|
-
force: initForce,
|
|
191
|
-
dryRun: initDryRun,
|
|
192
|
-
verbose: true,
|
|
193
|
-
sparc: initSparc
|
|
194
|
-
});
|
|
195
|
-
if (revisedResults.success) {
|
|
196
|
-
console.log(` ✅ Copied ${revisedResults.copiedFiles.length} template files`);
|
|
197
|
-
if (revisedResults.skippedFiles.length > 0) {
|
|
198
|
-
console.log(` ⏭️ Skipped ${revisedResults.skippedFiles.length} existing files`);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
console.log(' ⚠️ Some template files could not be copied:');
|
|
203
|
-
revisedResults.errors.forEach(err => console.log(` - ${err}`));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
// Fall back to generated templates
|
|
208
|
-
console.log(' ⚠️ Revised templates not available, using generated templates');
|
|
209
|
-
const copyResults = await copyTemplates(workingDir, templateOptions);
|
|
210
|
-
if (!copyResults.success) {
|
|
211
|
-
printError('Failed to copy templates:');
|
|
212
|
-
copyResults.errors.forEach(err => console.log(` ❌ ${err}`));
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
// Agent setup moved to end of function where execution is guaranteed
|
|
217
|
-
// Directory structure is created by template copier
|
|
218
|
-
// SPARC files are created by template copier when --sparc flag is used
|
|
219
|
-
// Memory README files and persistence database are created by template copier
|
|
220
|
-
// Create local claude-flow executable wrapper
|
|
221
|
-
if (!initDryRun) {
|
|
222
|
-
await createLocalExecutable(workingDir);
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
console.log(' [DRY RUN] Would create local claude-flow executable wrapper');
|
|
226
|
-
}
|
|
227
|
-
// SPARC initialization
|
|
228
|
-
if (initSparc) {
|
|
229
|
-
console.log('\n🚀 Initializing SPARC development environment...');
|
|
230
|
-
if (initDryRun) {
|
|
231
|
-
console.log(' [DRY RUN] Would run: npx -y create-sparc init --force');
|
|
232
|
-
console.log(' [DRY RUN] Would create SPARC environment with all modes');
|
|
233
|
-
console.log(' [DRY RUN] Would create Claude slash commands' +
|
|
234
|
-
(initOptimized ? ' (Batchtools-optimized)' : ''));
|
|
235
|
-
if (selectedModes) {
|
|
236
|
-
console.log(` [DRY RUN] Would create commands for selected modes: ${selectedModes.join(', ')}`);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
// Check if create-sparc exists and run it
|
|
241
|
-
let sparcInitialized = false;
|
|
242
|
-
try {
|
|
243
|
-
// Use isolated NPX cache to prevent concurrent conflicts
|
|
244
|
-
console.log(' 🔄 Running: npx -y create-sparc init --force');
|
|
245
|
-
const createSparcResult = await runCommand('npx', ['-y', 'create-sparc', 'init', '--force'], {
|
|
246
|
-
cwd: workingDir,
|
|
247
|
-
stdout: 'inherit',
|
|
248
|
-
stderr: 'inherit',
|
|
249
|
-
env: getIsolatedNpxEnv({
|
|
250
|
-
PWD: workingDir,
|
|
251
|
-
}),
|
|
252
|
-
});
|
|
253
|
-
if (createSparcResult.success) {
|
|
254
|
-
console.log(' ✅ SPARC environment initialized successfully');
|
|
255
|
-
sparcInitialized = true;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
printWarning('create-sparc failed, creating basic SPARC structure manually...');
|
|
259
|
-
// Fallback: create basic SPARC structure manually
|
|
260
|
-
await createSparcStructureManually();
|
|
261
|
-
sparcInitialized = true; // Manual creation still counts as initialized
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
catch (err) {
|
|
265
|
-
printWarning('create-sparc not available, creating basic SPARC structure manually...');
|
|
266
|
-
// Fallback: create basic SPARC structure manually
|
|
267
|
-
await createSparcStructureManually();
|
|
268
|
-
sparcInitialized = true; // Manual creation still counts as initialized
|
|
269
|
-
}
|
|
270
|
-
// Always create Claude slash commands after SPARC initialization
|
|
271
|
-
if (sparcInitialized) {
|
|
272
|
-
try {
|
|
273
|
-
if (initOptimized) {
|
|
274
|
-
await createOptimizedClaudeSlashCommands(workingDir, selectedModes);
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
await createClaudeSlashCommands(workingDir);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
catch (err) {
|
|
281
|
-
// Legacy slash command creation - silently skip if it fails
|
|
282
|
-
// SPARC slash commands are already created successfully above
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
if (initDryRun) {
|
|
288
|
-
printSuccess("🔍 Dry run completed! Here's what would be created:");
|
|
289
|
-
console.log('\n📋 Summary of planned initialization:');
|
|
290
|
-
console.log(` • Configuration: ${initOptimized ? 'Batchtools-optimized SPARC' : initSparc ? 'SPARC-enhanced' : 'Standard'}`);
|
|
291
|
-
console.log(` • Template type: ${initOptimized ? 'Optimized for parallel processing' : 'Standard'}`);
|
|
292
|
-
console.log(' • Core files: CLAUDE.md, memory-bank.md, coordination.md');
|
|
293
|
-
console.log(' • Directory structure: memory/, coordination/, .claude/');
|
|
294
|
-
console.log(' • Local executable: ./claude-flow');
|
|
295
|
-
if (initSparc) {
|
|
296
|
-
console.log(` • Claude Code slash commands: ${selectedModes ? selectedModes.length : 'All'} SPARC mode commands`);
|
|
297
|
-
console.log(' • SPARC environment with all development modes');
|
|
298
|
-
}
|
|
299
|
-
if (initOptimized) {
|
|
300
|
-
console.log(' • Batchtools optimization: Enabled for parallel processing');
|
|
301
|
-
console.log(' • Performance enhancements: Smart batching, concurrent operations');
|
|
302
|
-
}
|
|
303
|
-
console.log('\n🚀 To proceed with initialization, run the same command without --dry-run');
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
printSuccess('🎉 Claude Code integration files initialized successfully!');
|
|
307
|
-
if (initOptimized) {
|
|
308
|
-
console.log('\n⚡ Batchtools Optimization Enabled!');
|
|
309
|
-
console.log(' • Parallel processing capabilities activated');
|
|
310
|
-
console.log(' • Performance improvements: 250-500% faster operations');
|
|
311
|
-
console.log(' • Smart batching and concurrent operations available');
|
|
312
|
-
}
|
|
313
|
-
console.log('\n📋 What was created:');
|
|
314
|
-
console.log(` ✅ CLAUDE.md (${initOptimized ? 'Batchtools-optimized' : initSparc ? 'SPARC-enhanced' : 'Standard configuration'})`);
|
|
315
|
-
console.log(` ✅ memory-bank.md (${initOptimized ? 'With parallel processing' : 'Standard memory system'})`);
|
|
316
|
-
console.log(` ✅ coordination.md (${initOptimized ? 'Enhanced with batchtools' : 'Standard coordination'})`);
|
|
317
|
-
console.log(' ✅ Directory structure with memory/ and coordination/');
|
|
318
|
-
console.log(' ✅ Local executable at ./claude-flow');
|
|
319
|
-
console.log(' ✅ Persistence database at memory/claude-flow-data.json');
|
|
320
|
-
console.log(' ✅ Agent system with 64 specialized agents in .claude/agents/');
|
|
321
|
-
if (initSparc) {
|
|
322
|
-
const modeCount = selectedModes ? selectedModes.length : '20+';
|
|
323
|
-
console.log(` ✅ Claude Code slash commands (${modeCount} SPARC modes)`);
|
|
324
|
-
console.log(' ✅ Complete SPARC development environment');
|
|
325
|
-
}
|
|
326
|
-
console.log('\n🚀 Next steps:');
|
|
327
|
-
console.log('1. Review and customize the generated files for your project');
|
|
328
|
-
console.log("2. Run './claude-flow start' to begin the orchestration system");
|
|
329
|
-
console.log("3. Use './claude-flow' instead of 'npx claude-flow' for all commands");
|
|
330
|
-
console.log("4. Use 'claude --dangerously-skip-permissions' for unattended operation");
|
|
331
|
-
if (initSparc) {
|
|
332
|
-
console.log('5. Use Claude Code slash commands: /sparc, /sparc-architect, /sparc-tdd, etc.');
|
|
333
|
-
console.log("6. Explore SPARC modes with './claude-flow sparc modes'");
|
|
334
|
-
console.log('7. Try TDD workflow with \'./claude-flow sparc tdd "your task"\'');
|
|
335
|
-
if (initOptimized) {
|
|
336
|
-
console.log('8. Use batchtools commands: /batchtools, /performance for optimization');
|
|
337
|
-
console.log('9. Enable parallel processing with --parallel flags');
|
|
338
|
-
console.log("10. Monitor performance with './claude-flow performance monitor'");
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
// Update .gitignore
|
|
342
|
-
const gitignoreResult = await updateGitignore(workingDir, initForce, initDryRun);
|
|
343
|
-
if (gitignoreResult.success) {
|
|
344
|
-
if (!initDryRun) {
|
|
345
|
-
console.log(` ✅ ${gitignoreResult.message}`);
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
console.log(` ${gitignoreResult.message}`);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
else {
|
|
352
|
-
console.log(` ⚠️ ${gitignoreResult.message}`);
|
|
353
|
-
}
|
|
354
|
-
console.log('\n💡 Tips:');
|
|
355
|
-
console.log(" • Type '/' in Claude Code to see all available slash commands");
|
|
356
|
-
console.log(" • Use './claude-flow status' to check system health");
|
|
357
|
-
console.log(" • Store important context with './claude-flow memory store'");
|
|
358
|
-
if (initOptimized) {
|
|
359
|
-
console.log(' • Use --parallel flags for concurrent operations');
|
|
360
|
-
console.log(' • Enable batch processing for multiple related tasks');
|
|
361
|
-
console.log(' • Monitor performance with real-time metrics');
|
|
362
|
-
}
|
|
363
|
-
// Check for Claude Code and set up MCP servers (always enabled by default)
|
|
364
|
-
if (!initDryRun && isClaudeCodeInstalled()) {
|
|
365
|
-
console.log('\n🔍 Claude Code CLI detected!');
|
|
366
|
-
const skipMcp = subArgs && subArgs.includes && subArgs.includes('--skip-mcp');
|
|
367
|
-
if (!skipMcp) {
|
|
368
|
-
await setupMcpServers(initDryRun);
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
console.log(' ℹ️ Skipping MCP setup (--skip-mcp flag used)');
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
else if (!initDryRun && !isClaudeCodeInstalled()) {
|
|
375
|
-
console.log('\n⚠️ Claude Code CLI not detected!');
|
|
376
|
-
console.log(' 📥 Install with: npm install -g @anthropic-ai/claude-code');
|
|
377
|
-
console.log(' 📋 Then add MCP servers manually with:');
|
|
378
|
-
console.log(' claude mcp add claude-flow claude-flow mcp start');
|
|
379
|
-
console.log(' claude mcp add ruv-swarm npx ruv-swarm mcp start');
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
catch (err) {
|
|
384
|
-
printError(`Failed to initialize files: ${err.message}`);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
// Handle batch initialization
|
|
388
|
-
async function handleBatchInit(subArgs, flags) {
|
|
389
|
-
try {
|
|
390
|
-
// Options parsing from flags and subArgs
|
|
391
|
-
const options = {
|
|
392
|
-
parallel: !flags['no-parallel'] && flags.parallel !== false,
|
|
393
|
-
sparc: flags.sparc || flags.s,
|
|
394
|
-
minimal: flags.minimal || flags.m,
|
|
395
|
-
force: flags.force || flags.f,
|
|
396
|
-
maxConcurrency: flags['max-concurrent'] || 5,
|
|
397
|
-
progressTracking: true,
|
|
398
|
-
template: flags.template,
|
|
399
|
-
environments: flags.environments
|
|
400
|
-
? flags.environments.split(',').map((env) => env.trim())
|
|
401
|
-
: ['dev'],
|
|
402
|
-
};
|
|
403
|
-
// Validate options
|
|
404
|
-
const validationErrors = validateBatchOptions(options);
|
|
405
|
-
if (validationErrors.length > 0) {
|
|
406
|
-
printError('Batch options validation failed:');
|
|
407
|
-
validationErrors.forEach((error) => console.error(` - ${error}`));
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
// Config file mode
|
|
411
|
-
if (flags.config) {
|
|
412
|
-
const configFile = flags.config;
|
|
413
|
-
printSuccess(`Loading batch configuration from: ${configFile}`);
|
|
414
|
-
const results = await batchInitFromConfig(configFile, options);
|
|
415
|
-
if (results) {
|
|
416
|
-
printSuccess('Batch initialization from config completed');
|
|
417
|
-
}
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
// Batch init mode
|
|
421
|
-
if (flags['batch-init']) {
|
|
422
|
-
const projectsString = flags['batch-init'];
|
|
423
|
-
const projects = projectsString.split(',').map((project) => project.trim());
|
|
424
|
-
if (projects.length === 0) {
|
|
425
|
-
printError('No projects specified for batch initialization');
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
printSuccess(`Initializing ${projects.length} projects in batch mode`);
|
|
429
|
-
const results = await batchInitCommand(projects, options);
|
|
430
|
-
if (results) {
|
|
431
|
-
const successful = results.filter((r) => r.success).length;
|
|
432
|
-
const failed = results.filter((r) => !r.success).length;
|
|
433
|
-
if (failed === 0) {
|
|
434
|
-
printSuccess(`All ${successful} projects initialized successfully`);
|
|
435
|
-
}
|
|
436
|
-
else {
|
|
437
|
-
printWarning(`${successful} projects succeeded, ${failed} failed`);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
printError('No batch operation specified. Use --batch-init <projects> or --config <file>');
|
|
443
|
-
}
|
|
444
|
-
catch (err) {
|
|
445
|
-
printError(`Batch initialization failed: ${err.message}`);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Enhanced initialization command with validation and rollback
|
|
450
|
-
*/
|
|
451
|
-
async function enhancedInitCommand(subArgs, flags) {
|
|
452
|
-
console.log('🛡️ Starting enhanced initialization with validation and rollback...');
|
|
453
|
-
// Store parameters to avoid scope issues in async context
|
|
454
|
-
const args = subArgs || [];
|
|
455
|
-
const options = flags || {};
|
|
456
|
-
// Get the working directory
|
|
457
|
-
const workingDir = process.env.PWD || process.cwd();
|
|
458
|
-
// Initialize systems
|
|
459
|
-
const rollbackSystem = new RollbackSystem(workingDir);
|
|
460
|
-
const validationSystem = new ValidationSystem(workingDir);
|
|
461
|
-
let atomicOp = null;
|
|
462
|
-
try {
|
|
463
|
-
// Parse options
|
|
464
|
-
const initOptions = {
|
|
465
|
-
force: args.includes('--force') || args.includes('-f') || options.force,
|
|
466
|
-
minimal: args.includes('--minimal') || args.includes('-m') || options.minimal,
|
|
467
|
-
sparc: args.includes('--sparc') || args.includes('-s') || options.sparc,
|
|
468
|
-
skipPreValidation: args.includes('--skip-pre-validation'),
|
|
469
|
-
skipBackup: args.includes('--skip-backup'),
|
|
470
|
-
validateOnly: args.includes('--validate-only'),
|
|
471
|
-
};
|
|
472
|
-
// Phase 1: Pre-initialization validation
|
|
473
|
-
if (!initOptions.skipPreValidation) {
|
|
474
|
-
console.log('\n🔍 Phase 1: Pre-initialization validation...');
|
|
475
|
-
const preValidation = await validationSystem.validatePreInit(initOptions);
|
|
476
|
-
if (!preValidation.success) {
|
|
477
|
-
printError('Pre-initialization validation failed:');
|
|
478
|
-
preValidation.errors.forEach((error) => console.error(` ❌ ${error}`));
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
if (preValidation.warnings.length > 0) {
|
|
482
|
-
printWarning('Pre-initialization warnings:');
|
|
483
|
-
preValidation.warnings.forEach((warning) => console.warn(` ⚠️ ${warning}`));
|
|
484
|
-
}
|
|
485
|
-
printSuccess('Pre-initialization validation passed');
|
|
486
|
-
}
|
|
487
|
-
// Stop here if validation-only mode
|
|
488
|
-
if (options.validateOnly) {
|
|
489
|
-
console.log('\n✅ Validation-only mode completed');
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
// Phase 2: Create backup
|
|
493
|
-
if (!options.skipBackup) {
|
|
494
|
-
console.log('\n💾 Phase 2: Creating backup...');
|
|
495
|
-
const backupResult = await rollbackSystem.createPreInitBackup();
|
|
496
|
-
if (!backupResult.success) {
|
|
497
|
-
printError('Backup creation failed:');
|
|
498
|
-
backupResult.errors.forEach((error) => console.error(` ❌ ${error}`));
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
// Phase 3: Initialize with atomic operations
|
|
503
|
-
console.log('\n🔧 Phase 3: Atomic initialization...');
|
|
504
|
-
atomicOp = createAtomicOperation(rollbackSystem, 'enhanced-init');
|
|
505
|
-
const atomicBegin = await atomicOp.begin();
|
|
506
|
-
if (!atomicBegin) {
|
|
507
|
-
printError('Failed to begin atomic operation');
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
// Perform initialization steps with checkpoints
|
|
511
|
-
await performInitializationWithCheckpoints(rollbackSystem, options, workingDir, dryRun);
|
|
512
|
-
// Phase 4: Post-initialization validation
|
|
513
|
-
console.log('\n✅ Phase 4: Post-initialization validation...');
|
|
514
|
-
const postValidation = await validationSystem.validatePostInit();
|
|
515
|
-
if (!postValidation.success) {
|
|
516
|
-
printError('Post-initialization validation failed:');
|
|
517
|
-
postValidation.errors.forEach((error) => console.error(` ❌ ${error}`));
|
|
518
|
-
// Attempt automatic rollback
|
|
519
|
-
console.log('\n🔄 Attempting automatic rollback...');
|
|
520
|
-
await atomicOp.rollback();
|
|
521
|
-
printWarning('Initialization rolled back due to validation failure');
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
// Phase 5: Configuration validation
|
|
525
|
-
console.log('\n🔧 Phase 5: Configuration validation...');
|
|
526
|
-
const configValidation = await validationSystem.validateConfiguration();
|
|
527
|
-
if (configValidation.warnings.length > 0) {
|
|
528
|
-
printWarning('Configuration warnings:');
|
|
529
|
-
configValidation.warnings.forEach((warning) => console.warn(` ⚠️ ${warning}`));
|
|
530
|
-
}
|
|
531
|
-
// Phase 6: Health checks
|
|
532
|
-
console.log('\n🏥 Phase 6: System health checks...');
|
|
533
|
-
const healthChecks = await validationSystem.runHealthChecks();
|
|
534
|
-
if (healthChecks.warnings.length > 0) {
|
|
535
|
-
printWarning('Health check warnings:');
|
|
536
|
-
healthChecks.warnings.forEach((warning) => console.warn(` ⚠️ ${warning}`));
|
|
537
|
-
}
|
|
538
|
-
// Commit atomic operation
|
|
539
|
-
await atomicOp.commit();
|
|
540
|
-
// Generate and display validation report
|
|
541
|
-
const fullValidation = await runFullValidation(workingDir, {
|
|
542
|
-
postInit: true,
|
|
543
|
-
skipPreInit: options.skipPreValidation,
|
|
544
|
-
});
|
|
545
|
-
console.log('\n📊 Validation Report:');
|
|
546
|
-
console.log(fullValidation.report);
|
|
547
|
-
printSuccess('🎉 Enhanced initialization completed successfully!');
|
|
548
|
-
console.log('\n✨ Your SPARC environment is fully validated and ready to use');
|
|
549
|
-
}
|
|
550
|
-
catch (error) {
|
|
551
|
-
printError(`Enhanced initialization failed: ${error.message}`);
|
|
552
|
-
// Attempt rollback if atomic operation is active
|
|
553
|
-
if (atomicOp && !atomicOp.completed) {
|
|
554
|
-
console.log('\n🔄 Performing emergency rollback...');
|
|
555
|
-
try {
|
|
556
|
-
await atomicOp.rollback();
|
|
557
|
-
printWarning('Emergency rollback completed');
|
|
558
|
-
}
|
|
559
|
-
catch (rollbackError) {
|
|
560
|
-
printError(`Rollback also failed: ${rollbackError.message}`);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* Handle validation commands
|
|
567
|
-
*/
|
|
568
|
-
async function handleValidationCommand(subArgs, flags) {
|
|
569
|
-
const workingDir = process.env.PWD || process.cwd();
|
|
570
|
-
console.log('🔍 Running validation checks...');
|
|
571
|
-
const options = {
|
|
572
|
-
skipPreInit: subArgs.includes('--skip-pre-init'),
|
|
573
|
-
skipConfig: subArgs.includes('--skip-config'),
|
|
574
|
-
skipModeTest: subArgs.includes('--skip-mode-test'),
|
|
575
|
-
postInit: !subArgs.includes('--pre-init-only'),
|
|
576
|
-
};
|
|
577
|
-
try {
|
|
578
|
-
const validationResults = await runFullValidation(workingDir, options);
|
|
579
|
-
console.log('\n📊 Validation Results:');
|
|
580
|
-
console.log(validationResults.report);
|
|
581
|
-
if (validationResults.success) {
|
|
582
|
-
printSuccess('✅ All validation checks passed');
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
printError('❌ Some validation checks failed');
|
|
586
|
-
process.exit(1);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
catch (error) {
|
|
590
|
-
printError(`Validation failed: ${error.message}`);
|
|
591
|
-
process.exit(1);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* Handle rollback commands
|
|
596
|
-
*/
|
|
597
|
-
async function handleRollbackCommand(subArgs, flags) {
|
|
598
|
-
const workingDir = process.env.PWD || process.cwd();
|
|
599
|
-
const rollbackSystem = new RollbackSystem(workingDir);
|
|
600
|
-
try {
|
|
601
|
-
// Check for specific rollback options
|
|
602
|
-
if (subArgs.includes('--full')) {
|
|
603
|
-
console.log('🔄 Performing full rollback...');
|
|
604
|
-
const result = await rollbackSystem.performFullRollback();
|
|
605
|
-
if (result.success) {
|
|
606
|
-
printSuccess('Full rollback completed successfully');
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
printError('Full rollback failed:');
|
|
610
|
-
result.errors.forEach((error) => console.error(` ❌ ${error}`));
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
else if (subArgs.includes('--partial')) {
|
|
614
|
-
const phaseIndex = subArgs.findIndex((arg) => arg === '--phase');
|
|
615
|
-
if (phaseIndex !== -1 && subArgs[phaseIndex + 1]) {
|
|
616
|
-
const phase = subArgs[phaseIndex + 1];
|
|
617
|
-
console.log(`🔄 Performing partial rollback for phase: ${phase}`);
|
|
618
|
-
const result = await rollbackSystem.performPartialRollback(phase);
|
|
619
|
-
if (result.success) {
|
|
620
|
-
printSuccess(`Partial rollback completed for phase: ${phase}`);
|
|
621
|
-
}
|
|
622
|
-
else {
|
|
623
|
-
printError(`Partial rollback failed for phase: ${phase}`);
|
|
624
|
-
result.errors.forEach((error) => console.error(` ❌ ${error}`));
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
printError('Partial rollback requires --phase <phase-name>');
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
// Interactive rollback point selection
|
|
633
|
-
const rollbackPoints = await rollbackSystem.listRollbackPoints();
|
|
634
|
-
if (rollbackPoints.rollbackPoints.length === 0) {
|
|
635
|
-
printWarning('No rollback points available');
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
console.log('\n📋 Available rollback points:');
|
|
639
|
-
rollbackPoints.rollbackPoints.forEach((point, index) => {
|
|
640
|
-
const date = new Date(point.timestamp).toLocaleString();
|
|
641
|
-
console.log(` ${index + 1}. ${point.type} - ${date}`);
|
|
642
|
-
});
|
|
643
|
-
// For now, rollback to the most recent point
|
|
644
|
-
const latest = rollbackPoints.rollbackPoints[0];
|
|
645
|
-
if (latest) {
|
|
646
|
-
console.log(`\n🔄 Rolling back to: ${latest.type} (${new Date(latest.timestamp).toLocaleString()})`);
|
|
647
|
-
const result = await rollbackSystem.performFullRollback(latest.backupId);
|
|
648
|
-
if (result.success) {
|
|
649
|
-
printSuccess('Rollback completed successfully');
|
|
650
|
-
}
|
|
651
|
-
else {
|
|
652
|
-
printError('Rollback failed');
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
catch (error) {
|
|
658
|
-
printError(`Rollback operation failed: ${error.message}`);
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* Handle list backups command
|
|
663
|
-
*/
|
|
664
|
-
async function handleListBackups(subArgs, flags) {
|
|
665
|
-
const workingDir = process.env.PWD || process.cwd();
|
|
666
|
-
const rollbackSystem = new RollbackSystem(workingDir);
|
|
667
|
-
try {
|
|
668
|
-
const rollbackPoints = await rollbackSystem.listRollbackPoints();
|
|
669
|
-
console.log('\n📋 Rollback Points and Backups:');
|
|
670
|
-
if (rollbackPoints.rollbackPoints.length === 0) {
|
|
671
|
-
console.log(' No rollback points available');
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
console.log('\n🔄 Rollback Points:');
|
|
675
|
-
rollbackPoints.rollbackPoints.forEach((point, index) => {
|
|
676
|
-
const date = new Date(point.timestamp).toLocaleString();
|
|
677
|
-
console.log(` ${index + 1}. ${point.type} - ${date} (${point.backupId || 'No backup'})`);
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
if (rollbackPoints.checkpoints.length > 0) {
|
|
681
|
-
console.log('\n📍 Checkpoints:');
|
|
682
|
-
rollbackPoints.checkpoints.slice(-5).forEach((checkpoint, index) => {
|
|
683
|
-
const date = new Date(checkpoint.timestamp).toLocaleString();
|
|
684
|
-
console.log(` ${index + 1}. ${checkpoint.phase} - ${date} (${checkpoint.status})`);
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
catch (error) {
|
|
689
|
-
printError(`Failed to list backups: ${error.message}`);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Perform initialization with checkpoints
|
|
694
|
-
*/
|
|
695
|
-
async function performInitializationWithCheckpoints(rollbackSystem, options, workingDir, dryRun = false) {
|
|
696
|
-
const phases = [
|
|
697
|
-
{ name: 'file-creation', action: () => createInitialFiles(options, workingDir, dryRun) },
|
|
698
|
-
{ name: 'directory-structure', action: () => createDirectoryStructure(workingDir, dryRun) },
|
|
699
|
-
{ name: 'memory-setup', action: () => setupMemorySystem(workingDir, dryRun) },
|
|
700
|
-
{ name: 'coordination-setup', action: () => setupCoordinationSystem(workingDir, dryRun) },
|
|
701
|
-
{ name: 'executable-creation', action: () => createLocalExecutable(workingDir, dryRun) },
|
|
702
|
-
];
|
|
703
|
-
if (options.sparc) {
|
|
704
|
-
phases.push({ name: 'sparc-init', action: () => createSparcStructureManually() }, { name: 'claude-commands', action: () => createClaudeSlashCommands(workingDir) });
|
|
705
|
-
}
|
|
706
|
-
for (const phase of phases) {
|
|
707
|
-
console.log(` 🔧 ${phase.name}...`);
|
|
708
|
-
// Create checkpoint before phase
|
|
709
|
-
await rollbackSystem.createCheckpoint(phase.name, {
|
|
710
|
-
timestamp: Date.now(),
|
|
711
|
-
phase: phase.name,
|
|
712
|
-
});
|
|
713
|
-
try {
|
|
714
|
-
await phase.action();
|
|
715
|
-
console.log(` ✅ ${phase.name} completed`);
|
|
716
|
-
}
|
|
717
|
-
catch (error) {
|
|
718
|
-
console.error(` ❌ ${phase.name} failed: ${error.message}`);
|
|
719
|
-
throw error;
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
// Helper functions for atomic initialization
|
|
724
|
-
async function createInitialFiles(options, workingDir, dryRun = false) {
|
|
725
|
-
if (!dryRun) {
|
|
726
|
-
const claudeMd = options.sparc
|
|
727
|
-
? createSparcClaudeMd()
|
|
728
|
-
: options.minimal
|
|
729
|
-
? createMinimalClaudeMd()
|
|
730
|
-
: createFullClaudeMd();
|
|
731
|
-
await fs.writeFile(`${workingDir}/CLAUDE.md`, claudeMd, 'utf8');
|
|
732
|
-
const memoryBankMd = options.minimal ? createMinimalMemoryBankMd() : createFullMemoryBankMd();
|
|
733
|
-
await fs.writeFile(`${workingDir}/memory-bank.md`, memoryBankMd, 'utf8');
|
|
734
|
-
const coordinationMd = options.minimal
|
|
735
|
-
? createMinimalCoordinationMd()
|
|
736
|
-
: createFullCoordinationMd();
|
|
737
|
-
await fs.writeFile(`${workingDir}/coordination.md`, coordinationMd, 'utf8');
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
async function createDirectoryStructure(workingDir, dryRun = false) {
|
|
741
|
-
const directories = [
|
|
742
|
-
'memory',
|
|
743
|
-
'memory/agents',
|
|
744
|
-
'memory/sessions',
|
|
745
|
-
'coordination',
|
|
746
|
-
'coordination/memory_bank',
|
|
747
|
-
'coordination/subtasks',
|
|
748
|
-
'coordination/orchestration',
|
|
749
|
-
'.claude',
|
|
750
|
-
'.claude/commands',
|
|
751
|
-
'.claude/logs',
|
|
752
|
-
];
|
|
753
|
-
if (!dryRun) {
|
|
754
|
-
for (const dir of directories) {
|
|
755
|
-
await fs.mkdir(`${workingDir}/${dir}`, { recursive: true });
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
async function setupMemorySystem(workingDir, dryRun = false) {
|
|
760
|
-
if (!dryRun) {
|
|
761
|
-
const initialData = { agents: [], tasks: [], lastUpdated: Date.now() };
|
|
762
|
-
await fs.writeFile(`${workingDir}/memory/claude-flow-data.json`, JSON.stringify(initialData, null, 2), 'utf8');
|
|
763
|
-
await fs.writeFile(`${workingDir}/memory/agents/README.md`, createAgentsReadme(), 'utf8');
|
|
764
|
-
await fs.writeFile(`${workingDir}/memory/sessions/README.md`, createSessionsReadme(), 'utf8');
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
async function setupCoordinationSystem(workingDir, dryRun = false) {
|
|
768
|
-
// Coordination system is already set up by createDirectoryStructure
|
|
769
|
-
// This is a placeholder for future coordination setup logic
|
|
770
|
-
}
|
|
771
|
-
/**
|
|
772
|
-
* Enhanced Claude Flow v2.0.0 initialization
|
|
773
|
-
*/
|
|
774
|
-
async function enhancedClaudeFlowInit(flags, subArgs = []) {
|
|
775
|
-
console.log('🚀 Initializing Claude Flow v2.0.0 with enhanced features...');
|
|
776
|
-
const workingDir = process.cwd();
|
|
777
|
-
const force = flags.force || flags.f;
|
|
778
|
-
const dryRun = flags.dryRun || flags['dry-run'] || flags.d;
|
|
779
|
-
// Store parameters to avoid scope issues in async context
|
|
780
|
-
const args = subArgs || [];
|
|
781
|
-
const options = flags || {};
|
|
782
|
-
// Import fs module for Node.js
|
|
783
|
-
const fs = await import('fs/promises');
|
|
784
|
-
const { chmod } = fs;
|
|
785
|
-
try {
|
|
786
|
-
// Check existing files
|
|
787
|
-
const existingFiles = [];
|
|
788
|
-
const filesToCheck = [
|
|
789
|
-
'CLAUDE.md',
|
|
790
|
-
'.claude/settings.json',
|
|
791
|
-
'.mcp.json',
|
|
792
|
-
'claude-flow.config.json',
|
|
793
|
-
];
|
|
794
|
-
for (const file of filesToCheck) {
|
|
795
|
-
if (existsSync(`${workingDir}/${file}`)) {
|
|
796
|
-
existingFiles.push(file);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
if (existingFiles.length > 0 && !force) {
|
|
800
|
-
printWarning(`The following files already exist: ${existingFiles.join(', ')}`);
|
|
801
|
-
console.log('Use --force to overwrite existing files');
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
// Create CLAUDE.md
|
|
805
|
-
if (!dryRun) {
|
|
806
|
-
await fs.writeFile(`${workingDir}/CLAUDE.md`, createEnhancedClaudeMd(), 'utf8');
|
|
807
|
-
printSuccess('✓ Created CLAUDE.md (Claude Flow v2.0.0)');
|
|
808
|
-
}
|
|
809
|
-
else {
|
|
810
|
-
console.log('[DRY RUN] Would create CLAUDE.md (Claude Flow v2.0.0)');
|
|
811
|
-
}
|
|
812
|
-
// Create .claude directory structure
|
|
813
|
-
const claudeDir = `${workingDir}/.claude`;
|
|
814
|
-
if (!dryRun) {
|
|
815
|
-
await fs.mkdir(claudeDir, { recursive: true });
|
|
816
|
-
await fs.mkdir(`${claudeDir}/commands`, { recursive: true });
|
|
817
|
-
await fs.mkdir(`${claudeDir}/helpers`, { recursive: true });
|
|
818
|
-
printSuccess('✓ Created .claude directory structure');
|
|
819
|
-
}
|
|
820
|
-
else {
|
|
821
|
-
console.log('[DRY RUN] Would create .claude directory structure');
|
|
822
|
-
}
|
|
823
|
-
// Create settings.json
|
|
824
|
-
if (!dryRun) {
|
|
825
|
-
await fs.writeFile(`${claudeDir}/settings.json`, createEnhancedSettingsJson(), 'utf8');
|
|
826
|
-
printSuccess('✓ Created .claude/settings.json with hooks and MCP configuration');
|
|
827
|
-
}
|
|
828
|
-
else {
|
|
829
|
-
console.log('[DRY RUN] Would create .claude/settings.json');
|
|
830
|
-
}
|
|
831
|
-
// Create settings.local.json with default MCP permissions
|
|
832
|
-
const settingsLocal = {
|
|
833
|
-
permissions: {
|
|
834
|
-
allow: ['mcp__ruv-swarm', 'mcp__claude-flow'],
|
|
835
|
-
deny: [],
|
|
836
|
-
},
|
|
837
|
-
};
|
|
838
|
-
if (!dryRun) {
|
|
839
|
-
await fs.writeFile(`${claudeDir}/settings.local.json`, JSON.stringify(settingsLocal, null, 2, 'utf8'));
|
|
840
|
-
printSuccess('✓ Created .claude/settings.local.json with default MCP permissions');
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
console.log('[DRY RUN] Would create .claude/settings.local.json with default MCP permissions');
|
|
844
|
-
}
|
|
845
|
-
// Create .mcp.json at project root for MCP server configuration
|
|
846
|
-
const mcpConfig = {
|
|
847
|
-
mcpServers: {
|
|
848
|
-
'claude-flow': {
|
|
849
|
-
command: 'npx',
|
|
850
|
-
args: ['claude-flow@alpha', 'mcp', 'start'],
|
|
851
|
-
type: 'stdio',
|
|
852
|
-
},
|
|
853
|
-
'ruv-swarm': {
|
|
854
|
-
command: 'npx',
|
|
855
|
-
args: ['ruv-swarm@latest', 'mcp', 'start'],
|
|
856
|
-
type: 'stdio',
|
|
857
|
-
},
|
|
858
|
-
},
|
|
859
|
-
};
|
|
860
|
-
if (!dryRun) {
|
|
861
|
-
await fs.writeFile(`${workingDir}/.mcp.json`, JSON.stringify(mcpConfig, null, 2, 'utf8'));
|
|
862
|
-
printSuccess('✓ Created .mcp.json at project root for MCP server configuration');
|
|
863
|
-
}
|
|
864
|
-
else {
|
|
865
|
-
console.log('[DRY RUN] Would create .mcp.json at project root for MCP server configuration');
|
|
866
|
-
}
|
|
867
|
-
// Create claude-flow.config.json for Claude Flow specific settings
|
|
868
|
-
const claudeFlowConfig = {
|
|
869
|
-
features: {
|
|
870
|
-
autoTopologySelection: true,
|
|
871
|
-
parallelExecution: true,
|
|
872
|
-
neuralTraining: true,
|
|
873
|
-
bottleneckAnalysis: true,
|
|
874
|
-
smartAutoSpawning: true,
|
|
875
|
-
selfHealingWorkflows: true,
|
|
876
|
-
crossSessionMemory: true,
|
|
877
|
-
githubIntegration: true,
|
|
878
|
-
},
|
|
879
|
-
performance: {
|
|
880
|
-
maxAgents: 10,
|
|
881
|
-
defaultTopology: 'hierarchical',
|
|
882
|
-
executionStrategy: 'parallel',
|
|
883
|
-
tokenOptimization: true,
|
|
884
|
-
cacheEnabled: true,
|
|
885
|
-
telemetryLevel: 'detailed',
|
|
886
|
-
},
|
|
887
|
-
};
|
|
888
|
-
if (!dryRun) {
|
|
889
|
-
await fs.writeFile(`${workingDir}/claude-flow.config.json`, JSON.stringify(claudeFlowConfig, null, 2, 'utf8'));
|
|
890
|
-
printSuccess('✓ Created claude-flow.config.json for Claude Flow settings');
|
|
891
|
-
}
|
|
892
|
-
else {
|
|
893
|
-
console.log('[DRY RUN] Would create claude-flow.config.json for Claude Flow settings');
|
|
894
|
-
}
|
|
895
|
-
// Create command documentation
|
|
896
|
-
for (const [category, commands] of Object.entries(COMMAND_STRUCTURE)) {
|
|
897
|
-
const categoryDir = `${claudeDir}/commands/${category}`;
|
|
898
|
-
if (!dryRun) {
|
|
899
|
-
await fs.mkdir(categoryDir, { recursive: true });
|
|
900
|
-
// Create category README
|
|
901
|
-
const categoryReadme = `# ${category.charAt(0).toUpperCase() + category.slice(1)} Commands
|
|
902
|
-
|
|
903
|
-
Commands for ${category} operations in Claude Flow.
|
|
904
|
-
|
|
905
|
-
## Available Commands
|
|
906
|
-
|
|
907
|
-
${commands.map((cmd) => `- [${cmd}](./${cmd}.md)`).join('\n')}
|
|
908
|
-
`;
|
|
909
|
-
await fs.writeFile(`${categoryDir}/README.md`, categoryReadme, 'utf8');
|
|
910
|
-
// Create individual command docs
|
|
911
|
-
for (const command of commands) {
|
|
912
|
-
const doc = createCommandDoc(category, command);
|
|
913
|
-
if (doc) {
|
|
914
|
-
await fs.writeFile(`${categoryDir}/${command}.md`, doc, 'utf8');
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
console.log(` ✓ Created ${commands.length} ${category} command docs`);
|
|
918
|
-
}
|
|
919
|
-
else {
|
|
920
|
-
console.log(`[DRY RUN] Would create ${commands.length} ${category} command docs`);
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
// Create wrapper scripts
|
|
924
|
-
if (!dryRun) {
|
|
925
|
-
// Unix wrapper - now uses universal ES module compatible wrapper
|
|
926
|
-
const unixWrapper = createWrapperScript('unix');
|
|
927
|
-
await fs.writeFile(`${workingDir}/claude-flow`, unixWrapper, 'utf8');
|
|
928
|
-
await fs.chmod(`${workingDir}/claude-flow`, 0o755);
|
|
929
|
-
// Windows wrapper
|
|
930
|
-
await fs.writeFile(`${workingDir}/claude-flow.bat`, createWrapperScript('windows', 'utf8'));
|
|
931
|
-
// PowerShell wrapper
|
|
932
|
-
await fs.writeFile(`${workingDir}/claude-flow.ps1`, createWrapperScript('powershell', 'utf8'));
|
|
933
|
-
printSuccess('✓ Created platform-specific wrapper scripts');
|
|
934
|
-
}
|
|
935
|
-
else {
|
|
936
|
-
console.log('[DRY RUN] Would create wrapper scripts');
|
|
937
|
-
}
|
|
938
|
-
// Create helper scripts
|
|
939
|
-
const helpers = ['setup-mcp.sh', 'quick-start.sh', 'github-setup.sh', 'github-safe.js'];
|
|
940
|
-
for (const helper of helpers) {
|
|
941
|
-
if (!dryRun) {
|
|
942
|
-
const content = createHelperScript(helper);
|
|
943
|
-
if (content) {
|
|
944
|
-
await fs.writeFile(`${claudeDir}/helpers/${helper}`, content, 'utf8');
|
|
945
|
-
await fs.chmod(`${claudeDir}/helpers/${helper}`, 0o755);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
if (!dryRun) {
|
|
950
|
-
printSuccess(`✓ Created ${helpers.length} helper scripts`);
|
|
951
|
-
}
|
|
952
|
-
else {
|
|
953
|
-
console.log(`[DRY RUN] Would create ${helpers.length} helper scripts`);
|
|
954
|
-
}
|
|
955
|
-
// Create standard directories from original init
|
|
956
|
-
const standardDirs = [
|
|
957
|
-
'memory',
|
|
958
|
-
'memory/agents',
|
|
959
|
-
'memory/sessions',
|
|
960
|
-
'coordination',
|
|
961
|
-
'coordination/memory_bank',
|
|
962
|
-
'coordination/subtasks',
|
|
963
|
-
'coordination/orchestration',
|
|
964
|
-
'.swarm', // Add .swarm directory for shared memory
|
|
965
|
-
'.hive-mind', // Add .hive-mind directory for hive-mind system
|
|
966
|
-
];
|
|
967
|
-
for (const dir of standardDirs) {
|
|
968
|
-
if (!dryRun) {
|
|
969
|
-
await fs.mkdir(`${workingDir}/${dir}`, { recursive: true });
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
if (!dryRun) {
|
|
973
|
-
printSuccess('✓ Created standard directory structure');
|
|
974
|
-
// Initialize memory system
|
|
975
|
-
const initialData = { agents: [], tasks: [], lastUpdated: Date.now() };
|
|
976
|
-
await fs.writeFile(`${workingDir}/memory/claude-flow-data.json`, JSON.stringify(initialData, null, 2, 'utf8'));
|
|
977
|
-
// Create README files
|
|
978
|
-
await fs.writeFile(`${workingDir}/memory/agents/README.md`, createAgentsReadme(), 'utf8');
|
|
979
|
-
await fs.writeFile(`${workingDir}/memory/sessions/README.md`, createSessionsReadme(), 'utf8');
|
|
980
|
-
printSuccess('✓ Initialized memory system');
|
|
981
|
-
// Initialize memory database with fallback support
|
|
982
|
-
try {
|
|
983
|
-
// Import and initialize FallbackMemoryStore to create the database
|
|
984
|
-
const { FallbackMemoryStore } = await import('../../../memory/fallback-store.js');
|
|
985
|
-
const memoryStore = new FallbackMemoryStore();
|
|
986
|
-
await memoryStore.initialize();
|
|
987
|
-
if (memoryStore.isUsingFallback()) {
|
|
988
|
-
printSuccess('✓ Initialized memory system (in-memory fallback for npx compatibility)');
|
|
989
|
-
console.log(' 💡 For persistent storage, install locally: npm install claude-flow@alpha');
|
|
990
|
-
}
|
|
991
|
-
else {
|
|
992
|
-
printSuccess('✓ Initialized memory database (.swarm/memory.db)');
|
|
993
|
-
}
|
|
994
|
-
memoryStore.close();
|
|
995
|
-
}
|
|
996
|
-
catch (err) {
|
|
997
|
-
console.log(` ⚠️ Could not initialize memory system: ${err.message}`);
|
|
998
|
-
console.log(' Memory will be initialized on first use');
|
|
999
|
-
}
|
|
1000
|
-
// Initialize hive-mind configuration
|
|
1001
|
-
try {
|
|
1002
|
-
const hiveMindConfig = {
|
|
1003
|
-
version: '2.0.0',
|
|
1004
|
-
initialized: new Date().toISOString(),
|
|
1005
|
-
defaults: {
|
|
1006
|
-
queenType: 'strategic',
|
|
1007
|
-
maxWorkers: 8,
|
|
1008
|
-
consensusAlgorithm: 'majority',
|
|
1009
|
-
memorySize: 100,
|
|
1010
|
-
autoScale: true,
|
|
1011
|
-
encryption: false,
|
|
1012
|
-
},
|
|
1013
|
-
mcpTools: {
|
|
1014
|
-
enabled: true,
|
|
1015
|
-
parallel: true,
|
|
1016
|
-
timeout: 60000,
|
|
1017
|
-
},
|
|
1018
|
-
};
|
|
1019
|
-
await fs.writeFile(`${workingDir}/.hive-mind/config.json`, JSON.stringify(hiveMindConfig, null, 2, 'utf8'));
|
|
1020
|
-
// Initialize hive.db
|
|
1021
|
-
try {
|
|
1022
|
-
const Database = (await import('better-sqlite3')).default;
|
|
1023
|
-
const hivePath = `${workingDir}/.hive-mind/hive.db`;
|
|
1024
|
-
const hiveDb = new Database(hivePath);
|
|
1025
|
-
// Create initial tables
|
|
1026
|
-
hiveDb.exec(`
|
|
1027
|
-
CREATE TABLE IF NOT EXISTS swarms (
|
|
1028
|
-
id TEXT PRIMARY KEY,
|
|
1029
|
-
name TEXT NOT NULL,
|
|
1030
|
-
objective TEXT,
|
|
1031
|
-
status TEXT DEFAULT 'active',
|
|
1032
|
-
queen_type TEXT DEFAULT 'strategic',
|
|
1033
|
-
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
1034
|
-
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
1035
|
-
);
|
|
1036
|
-
|
|
1037
|
-
CREATE TABLE IF NOT EXISTS agents (
|
|
1038
|
-
id TEXT PRIMARY KEY,
|
|
1039
|
-
swarm_id TEXT,
|
|
1040
|
-
name TEXT NOT NULL,
|
|
1041
|
-
type TEXT NOT NULL,
|
|
1042
|
-
role TEXT,
|
|
1043
|
-
capabilities TEXT,
|
|
1044
|
-
status TEXT DEFAULT 'active',
|
|
1045
|
-
performance_score REAL DEFAULT 0.5,
|
|
1046
|
-
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
1047
|
-
FOREIGN KEY (swarm_id) REFERENCES swarms (id)
|
|
1048
|
-
);
|
|
1049
|
-
|
|
1050
|
-
CREATE TABLE IF NOT EXISTS messages (
|
|
1051
|
-
id TEXT PRIMARY KEY,
|
|
1052
|
-
swarm_id TEXT,
|
|
1053
|
-
agent_id TEXT,
|
|
1054
|
-
content TEXT NOT NULL,
|
|
1055
|
-
type TEXT DEFAULT 'task',
|
|
1056
|
-
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
1057
|
-
FOREIGN KEY (swarm_id) REFERENCES swarms (id),
|
|
1058
|
-
FOREIGN KEY (agent_id) REFERENCES agents (id)
|
|
1059
|
-
);
|
|
1060
|
-
`);
|
|
1061
|
-
hiveDb.close();
|
|
1062
|
-
printSuccess('✓ Initialized hive-mind database (.hive-mind/hive.db)');
|
|
1063
|
-
}
|
|
1064
|
-
catch (dbErr) {
|
|
1065
|
-
console.log(` ⚠️ Could not initialize hive-mind database: ${dbErr.message}`);
|
|
1066
|
-
}
|
|
1067
|
-
printSuccess('✓ Initialized hive-mind system');
|
|
1068
|
-
}
|
|
1069
|
-
catch (err) {
|
|
1070
|
-
console.log(` ⚠️ Could not initialize hive-mind system: ${err.message}`);
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
// Update .gitignore with Claude Flow entries
|
|
1074
|
-
const gitignoreResult = await updateGitignore(workingDir, force, dryRun);
|
|
1075
|
-
if (gitignoreResult.success) {
|
|
1076
|
-
if (!dryRun) {
|
|
1077
|
-
printSuccess(`✓ ${gitignoreResult.message}`);
|
|
1078
|
-
}
|
|
1079
|
-
else {
|
|
1080
|
-
console.log(gitignoreResult.message);
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
else {
|
|
1084
|
-
console.log(` ⚠️ ${gitignoreResult.message}`);
|
|
1085
|
-
}
|
|
1086
|
-
// SPARC initialization (now included by default)
|
|
1087
|
-
console.log('\n🚀 Initializing SPARC development environment...');
|
|
1088
|
-
let sparcInitialized = false;
|
|
1089
|
-
try {
|
|
1090
|
-
// Run create-sparc
|
|
1091
|
-
console.log(' 🔄 Running: npx -y create-sparc init --force');
|
|
1092
|
-
execSync('npx -y create-sparc init --force', {
|
|
1093
|
-
cwd: workingDir,
|
|
1094
|
-
stdio: 'inherit',
|
|
1095
|
-
});
|
|
1096
|
-
sparcInitialized = true;
|
|
1097
|
-
printSuccess('✅ SPARC environment initialized successfully');
|
|
1098
|
-
}
|
|
1099
|
-
catch (err) {
|
|
1100
|
-
console.log(` ⚠️ Could not run create-sparc: ${err.message}`);
|
|
1101
|
-
console.log(' SPARC features will be limited to basic functionality');
|
|
1102
|
-
}
|
|
1103
|
-
// Create Claude slash commands for SPARC
|
|
1104
|
-
if (sparcInitialized && !dryRun) {
|
|
1105
|
-
console.log('\n📝 Creating Claude Code slash commands...');
|
|
1106
|
-
await createClaudeSlashCommands(workingDir);
|
|
1107
|
-
}
|
|
1108
|
-
// Check for Claude Code and set up MCP servers (always enabled by default)
|
|
1109
|
-
if (!dryRun && isClaudeCodeInstalled()) {
|
|
1110
|
-
console.log('\n🔍 Claude Code CLI detected!');
|
|
1111
|
-
const skipMcp = (options && options['skip-mcp']) ||
|
|
1112
|
-
(subArgs && subArgs.includes && subArgs.includes('--skip-mcp'));
|
|
1113
|
-
if (!skipMcp) {
|
|
1114
|
-
await setupMcpServers(dryRun);
|
|
1115
|
-
}
|
|
1116
|
-
else {
|
|
1117
|
-
console.log(' ℹ️ Skipping MCP setup (--skip-mcp flag used)');
|
|
1118
|
-
console.log('\n 📋 To add MCP servers manually:');
|
|
1119
|
-
console.log(' claude mcp add claude-flow npx claude-flow@alpha mcp start');
|
|
1120
|
-
console.log(' claude mcp add ruv-swarm npx ruv-swarm@latest mcp start');
|
|
1121
|
-
console.log('\n 💡 MCP servers are defined in .mcp.json (project scope)');
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
else if (!dryRun && !isClaudeCodeInstalled()) {
|
|
1125
|
-
console.log('\n⚠️ Claude Code CLI not detected!');
|
|
1126
|
-
console.log('\n 📥 To install Claude Code:');
|
|
1127
|
-
console.log(' npm install -g @anthropic-ai/claude-code');
|
|
1128
|
-
console.log('\n 📋 After installing, add MCP servers:');
|
|
1129
|
-
console.log(' claude mcp add claude-flow npx claude-flow@alpha mcp start');
|
|
1130
|
-
console.log(' claude mcp add ruv-swarm npx ruv-swarm@latest mcp start');
|
|
1131
|
-
console.log('\n 💡 MCP servers are defined in .mcp.json (project scope)');
|
|
1132
|
-
}
|
|
1133
|
-
// Create agent directories and copy all agent files
|
|
1134
|
-
console.log('\n🤖 Setting up agent system...');
|
|
1135
|
-
if (!dryRun) {
|
|
1136
|
-
await createAgentDirectories(workingDir, dryRun);
|
|
1137
|
-
const agentResult = await copyAgentFiles(workingDir, {
|
|
1138
|
-
force: force,
|
|
1139
|
-
dryRun: dryRun
|
|
1140
|
-
});
|
|
1141
|
-
if (agentResult.success) {
|
|
1142
|
-
await validateAgentSystem(workingDir);
|
|
1143
|
-
console.log('✅ ✓ Agent system setup complete with 64 specialized agents');
|
|
1144
|
-
}
|
|
1145
|
-
else {
|
|
1146
|
-
console.log('⚠️ Agent system setup failed:', agentResult.error);
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
else {
|
|
1150
|
-
console.log(' [DRY RUN] Would create agent system with 64 specialized agents');
|
|
1151
|
-
}
|
|
1152
|
-
// Final instructions
|
|
1153
|
-
console.log('\n🎉 Claude Flow v2.0.0 initialization complete!');
|
|
1154
|
-
console.log('\n📚 Quick Start:');
|
|
1155
|
-
if (isClaudeCodeInstalled()) {
|
|
1156
|
-
console.log('1. View available commands: ls .claude/commands/');
|
|
1157
|
-
console.log('2. Start a swarm: npx claude-flow@alpha swarm "your objective" --claude');
|
|
1158
|
-
console.log('3. Use hive-mind: npx claude-flow@alpha hive-mind spawn "command" --claude');
|
|
1159
|
-
console.log('4. Use MCP tools in Claude Code for enhanced coordination');
|
|
1160
|
-
}
|
|
1161
|
-
else {
|
|
1162
|
-
console.log('1. Install Claude Code: npm install -g @anthropic-ai/claude-code');
|
|
1163
|
-
console.log('2. Add MCP servers (see instructions above)');
|
|
1164
|
-
console.log('3. View available commands: ls .claude/commands/');
|
|
1165
|
-
console.log('4. Start a swarm: npx claude-flow@alpha swarm "your objective" --claude');
|
|
1166
|
-
console.log('5. Use hive-mind: npx claude-flow@alpha hive-mind spawn "command" --claude');
|
|
1167
|
-
}
|
|
1168
|
-
console.log('\n💡 Tips:');
|
|
1169
|
-
console.log('• Check .claude/commands/ for detailed documentation');
|
|
1170
|
-
console.log('• Use --help with any command for options');
|
|
1171
|
-
console.log('• Run commands with --claude flag for best Claude Code integration');
|
|
1172
|
-
console.log('• Enable GitHub integration with .claude/helpers/github-setup.sh');
|
|
1173
|
-
}
|
|
1174
|
-
catch (err) {
|
|
1175
|
-
printError(`Failed to initialize Claude Flow v2.0.0: ${err.message}`);
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
//# sourceMappingURL=index.js.map
|