claude-flow 2.0.0-alpha.60 → 2.0.0-alpha.62
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/commands/sparc/analyzer.md +24 -77
- package/.claude/commands/sparc/architect.md +25 -76
- package/.claude/commands/sparc/batch-executor.md +28 -78
- package/.claude/commands/sparc/coder.md +28 -79
- package/.claude/commands/sparc/debugger.md +26 -76
- package/.claude/commands/sparc/designer.md +25 -75
- package/.claude/commands/sparc/documenter.md +26 -75
- package/.claude/commands/sparc/innovator.md +26 -76
- package/.claude/commands/sparc/memory-manager.md +28 -77
- package/.claude/commands/sparc/optimizer.md +26 -76
- package/.claude/commands/sparc/orchestrator.md +23 -74
- package/.claude/commands/sparc/researcher.md +26 -77
- package/.claude/commands/sparc/reviewer.md +26 -76
- package/.claude/commands/sparc/sparc-modes.md +38 -358
- package/.claude/commands/sparc/swarm-coordinator.md +28 -77
- package/.claude/commands/sparc/tdd.md +28 -78
- package/.claude/commands/sparc/tester.md +26 -76
- package/.claude/commands/sparc/workflow-manager.md +28 -77
- package/.claude/commands/swarm/analysis.md +14 -17
- package/.claude/commands/swarm/development.md +14 -16
- package/.claude/commands/swarm/examples.md +20 -53
- package/.claude/commands/swarm/maintenance.md +14 -17
- package/.claude/commands/swarm/optimization.md +15 -17
- package/.claude/commands/swarm/research.md +14 -17
- package/.claude/commands/swarm/testing.md +15 -17
- package/.claude/config.json +32 -11
- package/CHANGELOG.md +113 -0
- package/bin/claude-flow +1 -1
- package/dist/adapters/cliffy-node.d.ts.map +1 -1
- package/dist/adapters/cliffy-node.js +13 -7
- package/dist/adapters/cliffy-node.js.map +1 -1
- package/dist/agents/agent-manager.d.ts.map +1 -1
- package/dist/agents/agent-manager.js +77 -65
- package/dist/agents/agent-manager.js.map +1 -1
- package/dist/agents/agent-registry.d.ts.map +1 -1
- package/dist/agents/agent-registry.js +38 -30
- package/dist/agents/agent-registry.js.map +1 -1
- package/dist/api/claude-client.d.ts.map +1 -1
- package/dist/api/claude-client.js +22 -16
- package/dist/api/claude-client.js.map +1 -1
- package/dist/cli/agents/analyst.d.ts.map +1 -1
- package/dist/cli/agents/analyst.js +94 -114
- package/dist/cli/agents/analyst.js.map +1 -1
- package/dist/cli/agents/architect.d.ts.map +1 -1
- package/dist/cli/agents/architect.js +100 -114
- package/dist/cli/agents/architect.js.map +1 -1
- package/dist/cli/agents/base-agent.d.ts.map +1 -1
- package/dist/cli/agents/base-agent.js +27 -27
- package/dist/cli/agents/base-agent.js.map +1 -1
- package/dist/cli/agents/capabilities.d.ts.map +1 -1
- package/dist/cli/agents/capabilities.js +49 -51
- package/dist/cli/agents/capabilities.js.map +1 -1
- package/dist/cli/agents/coder.d.ts.map +1 -1
- package/dist/cli/agents/coder.js +92 -98
- package/dist/cli/agents/coder.js.map +1 -1
- package/dist/cli/agents/coordinator.d.ts.map +1 -1
- package/dist/cli/agents/coordinator.js +59 -64
- package/dist/cli/agents/coordinator.js.map +1 -1
- package/dist/cli/agents/hive-agents.d.ts.map +1 -1
- package/dist/cli/agents/hive-agents.js +22 -24
- package/dist/cli/agents/hive-agents.js.map +1 -1
- package/dist/cli/agents/index.d.ts.map +1 -1
- package/dist/cli/agents/index.js +17 -17
- package/dist/cli/agents/index.js.map +1 -1
- package/dist/cli/agents/researcher.d.ts.map +1 -1
- package/dist/cli/agents/researcher.js +41 -61
- package/dist/cli/agents/researcher.js.map +1 -1
- package/dist/cli/agents/tester.d.ts.map +1 -1
- package/dist/cli/agents/tester.js +78 -90
- package/dist/cli/agents/tester.js.map +1 -1
- package/dist/cli/cli-core.d.ts +4 -1
- package/dist/cli/cli-core.d.ts.map +1 -1
- package/dist/cli/cli-core.js +40 -39
- package/dist/cli/cli-core.js.map +1 -1
- package/dist/cli/command-registry.d.ts.map +1 -1
- package/dist/cli/command-registry.js +99 -74
- package/dist/cli/command-registry.js.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.js +49 -40
- package/dist/cli/commands/advanced-memory-commands.js.map +1 -1
- package/dist/cli/commands/agent-simple.d.ts +3 -0
- package/dist/cli/commands/agent-simple.d.ts.map +1 -1
- package/dist/cli/commands/agent-simple.js +30 -27
- package/dist/cli/commands/agent-simple.js.map +1 -1
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +53 -40
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/claude-api.js +4 -4
- package/dist/cli/commands/claude-api.js.map +1 -1
- package/dist/cli/commands/claude.d.ts.map +1 -1
- package/dist/cli/commands/claude.js +2 -2
- package/dist/cli/commands/claude.js.map +1 -1
- package/dist/cli/commands/config-integration.d.ts +7 -1
- package/dist/cli/commands/config-integration.d.ts.map +1 -1
- package/dist/cli/commands/config-integration.js +18 -9
- package/dist/cli/commands/config-integration.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +2 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/enterprise.d.ts.map +1 -1
- package/dist/cli/commands/enterprise.js +115 -95
- package/dist/cli/commands/enterprise.js.map +1 -1
- package/dist/cli/commands/help-new.d.ts +7 -0
- package/dist/cli/commands/help-new.d.ts.map +1 -0
- package/dist/cli/commands/help-new.js +236 -0
- package/dist/cli/commands/help-new.js.map +1 -0
- package/dist/cli/commands/help.d.ts +2 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +283 -133
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/index.js +1 -1
- package/dist/cli/commands/hive-mind/index.js.map +1 -1
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/init.js.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.js +35 -26
- package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -1
- package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/pause.js +8 -6
- package/dist/cli/commands/hive-mind/pause.js.map +1 -1
- package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/ps.js +17 -12
- package/dist/cli/commands/hive-mind/ps.js.map +1 -1
- package/dist/cli/commands/hive-mind/resume.js +12 -10
- package/dist/cli/commands/hive-mind/resume.js.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.js +20 -11
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -1
- package/dist/cli/commands/hive-mind/status.js +17 -22
- package/dist/cli/commands/hive-mind/status.js.map +1 -1
- package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/stop.js +23 -15
- package/dist/cli/commands/hive-mind/stop.js.map +1 -1
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/task.js +25 -19
- package/dist/cli/commands/hive-mind/task.js.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.js +86 -68
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -1
- package/dist/cli/commands/hive.js +73 -38
- package/dist/cli/commands/hive.js.map +1 -1
- package/dist/cli/commands/hook-validator.d.ts.map +1 -1
- package/dist/cli/commands/hook-validator.js +4 -2
- package/dist/cli/commands/hook-validator.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +8 -8
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +850 -784
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +8 -16
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/memory.d.ts.map +1 -1
- package/dist/cli/commands/memory.js +8 -8
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +3 -3
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/monitor.d.ts.map +1 -1
- package/dist/cli/commands/monitor.js +50 -34
- package/dist/cli/commands/monitor.js.map +1 -1
- package/dist/cli/commands/ruv-swarm.d.ts +7 -1
- package/dist/cli/commands/ruv-swarm.d.ts.map +1 -1
- package/dist/cli/commands/ruv-swarm.js +6 -6
- package/dist/cli/commands/ruv-swarm.js.map +1 -1
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +22 -17
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/sparc.d.ts +1 -1
- package/dist/cli/commands/sparc.d.ts.map +1 -1
- package/dist/cli/commands/sparc.js +146 -126
- package/dist/cli/commands/sparc.js.map +1 -1
- package/dist/cli/commands/start/event-emitter.js +1 -1
- package/dist/cli/commands/start/event-emitter.js.map +1 -1
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -1
- package/dist/cli/commands/start/process-manager.js +20 -18
- package/dist/cli/commands/start/process-manager.js.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.d.ts +4 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.js +2 -2
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -1
- package/dist/cli/commands/start/start-command.d.ts.map +1 -1
- package/dist/cli/commands/start/start-command.js +27 -15
- package/dist/cli/commands/start/start-command.js.map +1 -1
- package/dist/cli/commands/start/system-monitor.d.ts +3 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -1
- package/dist/cli/commands/start/system-monitor.js +16 -18
- package/dist/cli/commands/start/system-monitor.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +28 -33
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/swarm-spawn.d.ts.map +1 -1
- package/dist/cli/commands/swarm-spawn.js +1 -1
- package/dist/cli/commands/swarm-spawn.js.map +1 -1
- package/dist/cli/commands/swarm.d.ts +4 -1
- package/dist/cli/commands/swarm.d.ts.map +1 -1
- package/dist/cli/commands/swarm.js +23 -18
- package/dist/cli/commands/swarm.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts.map +1 -1
- package/dist/cli/commands/workflow.js +49 -45
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/completion.d.ts +3 -0
- package/dist/cli/completion.d.ts.map +1 -1
- package/dist/cli/completion.js +15 -5
- package/dist/cli/completion.js.map +1 -1
- package/dist/cli/formatter.d.ts +3 -0
- package/dist/cli/formatter.d.ts.map +1 -1
- package/dist/cli/formatter.js +3 -3
- package/dist/cli/formatter.js.map +1 -1
- package/dist/cli/help-formatter.d.ts +49 -0
- package/dist/cli/help-formatter.d.ts.map +1 -0
- package/dist/cli/help-formatter.js +108 -0
- package/dist/cli/help-formatter.js.map +1 -0
- package/dist/cli/index-remote.d.ts +4 -0
- package/dist/cli/index-remote.d.ts.map +1 -1
- package/dist/cli/index-remote.js +1 -1
- package/dist/cli/index-remote.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +32 -34
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/batch-tools.d.ts.map +1 -1
- package/dist/cli/init/batch-tools.js.map +1 -1
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +111 -106
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/cli/init/directory-structure.d.ts.map +1 -1
- package/dist/cli/init/directory-structure.js +3 -3
- package/dist/cli/init/directory-structure.js.map +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +1 -1
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/sparc-environment.d.ts.map +1 -1
- package/dist/cli/init/sparc-environment.js +69 -69
- package/dist/cli/init/sparc-environment.js.map +1 -1
- package/dist/cli/init/swarm-commands.d.ts.map +1 -1
- package/dist/cli/init/swarm-commands.js +1 -1
- package/dist/cli/init/swarm-commands.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/node-compat.d.ts.map +1 -1
- package/dist/cli/node-compat.js +24 -18
- package/dist/cli/node-compat.js.map +1 -1
- package/dist/cli/node-repl.d.ts +4 -0
- package/dist/cli/node-repl.d.ts.map +1 -1
- package/dist/cli/node-repl.js +24 -30
- package/dist/cli/node-repl.js.map +1 -1
- package/dist/cli/repl.d.ts.map +1 -1
- package/dist/cli/repl.js +81 -70
- package/dist/cli/repl.js.map +1 -1
- package/dist/cli/runtime-detector.d.ts.map +1 -1
- package/dist/cli/runtime-detector.js +11 -7
- package/dist/cli/runtime-detector.js.map +1 -1
- package/dist/cli/simple-cli.d.ts +4 -0
- package/dist/cli/simple-cli.d.ts.map +1 -1
- package/dist/cli/simple-cli.js +109 -95
- package/dist/cli/simple-cli.js.map +1 -1
- package/dist/cli/simple-commands/analysis.d.ts.map +1 -1
- package/dist/cli/simple-commands/analysis.js +18 -11
- package/dist/cli/simple-commands/analysis.js.map +1 -1
- package/dist/cli/simple-commands/automation.js +32 -17
- package/dist/cli/simple-commands/automation.js.map +1 -1
- package/dist/cli/simple-commands/batch-manager.js +44 -39
- package/dist/cli/simple-commands/batch-manager.js.map +1 -1
- package/dist/cli/simple-commands/config.d.ts.map +1 -1
- package/dist/cli/simple-commands/config.js +22 -21
- package/dist/cli/simple-commands/config.js.map +1 -1
- package/dist/cli/simple-commands/coordination.d.ts.map +1 -1
- package/dist/cli/simple-commands/coordination.js +12 -12
- package/dist/cli/simple-commands/coordination.js.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.js +36 -30
- package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -1
- package/dist/cli/simple-commands/github.d.ts.map +1 -1
- package/dist/cli/simple-commands/github.js +15 -15
- package/dist/cli/simple-commands/github.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +12 -10
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.js +42 -45
- package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.js +97 -89
- package/dist/cli/simple-commands/hive-mind/core.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +114 -59
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +182 -103
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.js +105 -75
- package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +45 -43
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.js +101 -88
- package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/session-manager.js +75 -53
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind-optimize.js +18 -18
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind.js +207 -144
- package/dist/cli/simple-commands/hive-mind.js.map +1 -1
- package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -1
- package/dist/cli/simple-commands/hook-safety.js +19 -19
- package/dist/cli/simple-commands/hook-safety.js.map +1 -1
- package/dist/cli/simple-commands/hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/hooks.js +85 -71
- package/dist/cli/simple-commands/hooks.js.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.js +62 -55
- package/dist/cli/simple-commands/init/batch-init.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +2 -2
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +58 -50
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +34 -28
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.js +7 -4
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.js +10 -9
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -1
- package/dist/cli/simple-commands/init/help.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/help.js.map +1 -1
- package/dist/cli/simple-commands/init/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/index.js +159 -103
- package/dist/cli/simple-commands/init/index.js.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.js +17 -18
- package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +19 -25
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.js +18 -15
- package/dist/cli/simple-commands/init/rollback/index.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +49 -68
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +16 -24
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +25 -25
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +57 -57
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.js +21 -21
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +69 -78
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +2 -2
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/config-validator.js +12 -16
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.js +39 -41
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.js +8 -8
- package/dist/cli/simple-commands/init/validation/index.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.js +12 -12
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +13 -13
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +19 -24
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/mcp.js +2 -2
- package/dist/cli/simple-commands/mcp.js.map +1 -1
- package/dist/cli/simple-commands/memory.js +4 -4
- package/dist/cli/simple-commands/memory.js.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.js +3 -3
- package/dist/cli/simple-commands/migrate-hooks.js.map +1 -1
- package/dist/cli/simple-commands/monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/monitor.js +34 -26
- package/dist/cli/simple-commands/monitor.js.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.js +53 -39
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/index.js +11 -11
- package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/swarm.js +50 -50
- package/dist/cli/simple-commands/sparc.d.ts.map +1 -1
- package/dist/cli/simple-commands/sparc.js +21 -11
- package/dist/cli/simple-commands/sparc.js.map +1 -1
- package/dist/cli/simple-commands/start-ui.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-ui.js +5 -3
- package/dist/cli/simple-commands/start-ui.js.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.js +1 -1
- package/dist/cli/simple-commands/start-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/status.js +14 -14
- package/dist/cli/simple-commands/status.js.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.js +19 -19
- package/dist/cli/simple-commands/swarm-executor.js.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.js +30 -21
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.js +30 -18
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm.d.ts +1 -1
- package/dist/cli/simple-commands/swarm.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm.js +81 -76
- package/dist/cli/simple-commands/swarm.js.map +1 -1
- package/dist/cli/simple-commands/training.d.ts.map +1 -1
- package/dist/cli/simple-commands/training.js +7 -7
- package/dist/cli/simple-commands/training.js.map +1 -1
- package/dist/cli/simple-commands/web-server.d.ts.map +1 -1
- package/dist/cli/simple-commands/web-server.js +68 -66
- package/dist/cli/simple-commands/web-server.js.map +1 -1
- package/dist/cli/simple-mcp.d.ts.map +1 -1
- package/dist/cli/simple-mcp.js +2 -4
- package/dist/cli/simple-mcp.js.map +1 -1
- package/dist/cli/simple-orchestrator.d.ts +3 -0
- package/dist/cli/simple-orchestrator.d.ts.map +1 -1
- package/dist/cli/simple-orchestrator.js +36 -35
- package/dist/cli/simple-orchestrator.js.map +1 -1
- package/dist/cli/ui/compatible-ui.d.ts +4 -0
- package/dist/cli/ui/compatible-ui.d.ts.map +1 -1
- package/dist/cli/ui/compatible-ui.js +9 -8
- package/dist/cli/ui/compatible-ui.js.map +1 -1
- package/dist/cli/ui/fallback-handler.d.ts.map +1 -1
- package/dist/cli/ui/fallback-handler.js +4 -4
- package/dist/cli/ui/fallback-handler.js.map +1 -1
- package/dist/cli/ui/index.d.ts +2 -2
- package/dist/cli/ui/index.d.ts.map +1 -1
- package/dist/cli/ui/index.js +3 -3
- package/dist/cli/ui/index.js.map +1 -1
- package/dist/cli/utils/environment-detector.d.ts.map +1 -1
- package/dist/cli/utils/environment-detector.js +13 -11
- package/dist/cli/utils/environment-detector.js.map +1 -1
- package/dist/cli/utils/interactive-detector.d.ts.map +1 -1
- package/dist/cli/utils/interactive-detector.js +1 -1
- package/dist/cli/utils/interactive-detector.js.map +1 -1
- package/dist/cli/utils/prompt-defaults.d.ts.map +1 -1
- package/dist/cli/utils/prompt-defaults.js +6 -7
- package/dist/cli/utils/prompt-defaults.js.map +1 -1
- package/dist/cli/utils/safe-interactive.d.ts.map +1 -1
- package/dist/cli/utils/safe-interactive.js +7 -6
- package/dist/cli/utils/safe-interactive.js.map +1 -1
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +58 -50
- package/dist/cli/utils.js.map +1 -1
- package/dist/cli/validation-helper.d.ts +27 -0
- package/dist/cli/validation-helper.d.ts.map +1 -0
- package/dist/cli/validation-helper.js +72 -0
- package/dist/cli/validation-helper.js.map +1 -0
- package/dist/communication/message-bus.d.ts.map +1 -1
- package/dist/communication/message-bus.js +80 -74
- package/dist/communication/message-bus.js.map +1 -1
- package/dist/config/config-manager.d.ts +3 -0
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +23 -6
- package/dist/config/config-manager.js.map +1 -1
- package/dist/config/ruv-swarm-config.d.ts +6 -0
- package/dist/config/ruv-swarm-config.d.ts.map +1 -1
- package/dist/config/ruv-swarm-config.js +37 -22
- package/dist/config/ruv-swarm-config.js.map +1 -1
- package/dist/config/ruv-swarm-integration.d.ts.map +1 -1
- package/dist/config/ruv-swarm-integration.js +21 -21
- package/dist/config/ruv-swarm-integration.js.map +1 -1
- package/dist/constants/agent-types.d.ts +4 -4
- package/dist/constants/agent-types.d.ts.map +1 -1
- package/dist/constants/agent-types.js +4 -4
- package/dist/constants/agent-types.js.map +1 -1
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -1
- package/dist/coordination/advanced-scheduler.js +6 -10
- package/dist/coordination/advanced-scheduler.js.map +1 -1
- package/dist/coordination/advanced-task-executor.d.ts.map +1 -1
- package/dist/coordination/advanced-task-executor.js +33 -33
- package/dist/coordination/advanced-task-executor.js.map +1 -1
- package/dist/coordination/background-executor.d.ts.map +1 -1
- package/dist/coordination/background-executor.js +17 -16
- package/dist/coordination/background-executor.js.map +1 -1
- package/dist/coordination/circuit-breaker.d.ts.map +1 -1
- package/dist/coordination/circuit-breaker.js +3 -0
- package/dist/coordination/circuit-breaker.js.map +1 -1
- package/dist/coordination/conflict-resolution.d.ts.map +1 -1
- package/dist/coordination/conflict-resolution.js +10 -8
- package/dist/coordination/conflict-resolution.js.map +1 -1
- package/dist/coordination/dependency-graph.d.ts.map +1 -1
- package/dist/coordination/dependency-graph.js +4 -3
- package/dist/coordination/dependency-graph.js.map +1 -1
- package/dist/coordination/hive-orchestrator.d.ts.map +1 -1
- package/dist/coordination/hive-orchestrator.js +29 -25
- package/dist/coordination/hive-orchestrator.js.map +1 -1
- package/dist/coordination/hive-protocol.d.ts.map +1 -1
- package/dist/coordination/hive-protocol.js +22 -23
- package/dist/coordination/hive-protocol.js.map +1 -1
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +1 -1
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/load-balancer.d.ts.map +1 -1
- package/dist/coordination/load-balancer.js +55 -56
- package/dist/coordination/load-balancer.js.map +1 -1
- package/dist/coordination/manager.d.ts.map +1 -1
- package/dist/coordination/manager.js +2 -8
- package/dist/coordination/manager.js.map +1 -1
- package/dist/coordination/messaging.d.ts.map +1 -1
- package/dist/coordination/messaging.js +4 -4
- package/dist/coordination/messaging.js.map +1 -1
- package/dist/coordination/metrics.d.ts.map +1 -1
- package/dist/coordination/metrics.js +11 -9
- package/dist/coordination/metrics.js.map +1 -1
- package/dist/coordination/resources.d.ts.map +1 -1
- package/dist/coordination/resources.js +10 -6
- package/dist/coordination/resources.js.map +1 -1
- package/dist/coordination/scheduler.d.ts.map +1 -1
- package/dist/coordination/scheduler.js +4 -4
- package/dist/coordination/scheduler.js.map +1 -1
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -1
- package/dist/coordination/swarm-coordinator.js +32 -34
- package/dist/coordination/swarm-coordinator.js.map +1 -1
- package/dist/coordination/swarm-monitor.d.ts.map +1 -1
- package/dist/coordination/swarm-monitor.js +17 -17
- package/dist/coordination/swarm-monitor.js.map +1 -1
- package/dist/coordination/work-stealing.d.ts.map +1 -1
- package/dist/coordination/work-stealing.js +3 -0
- package/dist/coordination/work-stealing.js.map +1 -1
- package/dist/core/config.d.ts +4 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -31
- package/dist/core/config.js.map +1 -1
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/json-persistence.d.ts +3 -0
- package/dist/core/json-persistence.d.ts.map +1 -1
- package/dist/core/json-persistence.js +19 -23
- package/dist/core/json-persistence.js.map +1 -1
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -6
- package/dist/core/logger.js.map +1 -1
- package/dist/core/orchestrator-fixed.d.ts.map +1 -1
- package/dist/core/orchestrator-fixed.js +4 -1
- package/dist/core/orchestrator-fixed.js.map +1 -1
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +66 -33
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/persistence.d.ts +3 -0
- package/dist/core/persistence.d.ts.map +1 -1
- package/dist/core/persistence.js +25 -19
- package/dist/core/persistence.js.map +1 -1
- package/dist/enterprise/analytics-manager.d.ts.map +1 -1
- package/dist/enterprise/analytics-manager.js +141 -134
- package/dist/enterprise/analytics-manager.js.map +1 -1
- package/dist/enterprise/audit-manager.d.ts.map +1 -1
- package/dist/enterprise/audit-manager.js +144 -122
- package/dist/enterprise/audit-manager.js.map +1 -1
- package/dist/enterprise/cloud-manager.d.ts.map +1 -1
- package/dist/enterprise/cloud-manager.js +104 -99
- package/dist/enterprise/cloud-manager.js.map +1 -1
- package/dist/enterprise/deployment-manager.d.ts.map +1 -1
- package/dist/enterprise/deployment-manager.js +104 -97
- package/dist/enterprise/deployment-manager.js.map +1 -1
- package/dist/enterprise/index.d.ts +6 -6
- package/dist/enterprise/index.d.ts.map +1 -1
- package/dist/enterprise/project-manager.d.ts.map +1 -1
- package/dist/enterprise/project-manager.js +74 -66
- package/dist/enterprise/project-manager.js.map +1 -1
- package/dist/enterprise/security-manager.d.ts.map +1 -1
- package/dist/enterprise/security-manager.js +137 -129
- package/dist/enterprise/security-manager.js.map +1 -1
- package/dist/hive-mind/core/Agent.d.ts.map +1 -1
- package/dist/hive-mind/core/Agent.js +36 -36
- package/dist/hive-mind/core/Agent.js.map +1 -1
- package/dist/hive-mind/core/Communication.d.ts.map +1 -1
- package/dist/hive-mind/core/Communication.js +17 -17
- package/dist/hive-mind/core/Communication.js.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.js +104 -58
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -1
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -1
- package/dist/hive-mind/core/HiveMind.js +35 -35
- package/dist/hive-mind/core/HiveMind.js.map +1 -1
- package/dist/hive-mind/core/Memory.d.ts.map +1 -1
- package/dist/hive-mind/core/Memory.js +78 -71
- package/dist/hive-mind/core/Memory.js.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.js +38 -38
- package/dist/hive-mind/core/MemoryMonitor.js.map +1 -1
- package/dist/hive-mind/core/Queen.d.ts.map +1 -1
- package/dist/hive-mind/core/Queen.js +110 -47
- package/dist/hive-mind/core/Queen.js.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.js +25 -23
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.js +60 -58
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -1
- package/dist/hive-mind/types.d.ts.map +1 -1
- package/dist/integration/mock-components.d.ts.map +1 -1
- package/dist/integration/mock-components.js +21 -21
- package/dist/integration/mock-components.js.map +1 -1
- package/dist/integration/system-integration.d.ts.map +1 -1
- package/dist/integration/system-integration.js +29 -12
- package/dist/integration/system-integration.js.map +1 -1
- package/dist/mcp/auth.d.ts +1 -1
- package/dist/mcp/auth.d.ts.map +1 -1
- package/dist/mcp/auth.js +8 -1
- package/dist/mcp/auth.js.map +1 -1
- package/dist/mcp/claude-code-wrapper.d.ts.map +1 -1
- package/dist/mcp/claude-code-wrapper.js +169 -68
- package/dist/mcp/claude-code-wrapper.js.map +1 -1
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -1
- package/dist/mcp/claude-flow-tools.js +42 -3
- package/dist/mcp/claude-flow-tools.js.map +1 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/integrate-wrapper.d.ts.map +1 -1
- package/dist/mcp/integrate-wrapper.js +5 -7
- package/dist/mcp/integrate-wrapper.js.map +1 -1
- package/dist/mcp/lifecycle-manager.d.ts.map +1 -1
- package/dist/mcp/lifecycle-manager.js +8 -7
- package/dist/mcp/lifecycle-manager.js.map +1 -1
- package/dist/mcp/load-balancer.d.ts.map +1 -1
- package/dist/mcp/load-balancer.js +5 -1
- package/dist/mcp/load-balancer.js.map +1 -1
- package/dist/mcp/orchestration-integration.d.ts.map +1 -1
- package/dist/mcp/orchestration-integration.js +22 -9
- package/dist/mcp/orchestration-integration.js.map +1 -1
- package/dist/mcp/performance-monitor.d.ts.map +1 -1
- package/dist/mcp/performance-monitor.js +22 -19
- package/dist/mcp/performance-monitor.js.map +1 -1
- package/dist/mcp/protocol-manager.d.ts.map +1 -1
- package/dist/mcp/protocol-manager.js +8 -19
- package/dist/mcp/protocol-manager.js.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.js +5 -5
- package/dist/mcp/recovery/connection-health-monitor.js.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.d.ts +4 -0
- package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.js +13 -13
- package/dist/mcp/recovery/connection-state-manager.js.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.js +5 -5
- package/dist/mcp/recovery/fallback-coordinator.js.map +1 -1
- package/dist/mcp/recovery/index.d.ts +4 -4
- package/dist/mcp/recovery/index.d.ts.map +1 -1
- package/dist/mcp/recovery/index.js +4 -4
- package/dist/mcp/recovery/index.js.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.js +1 -1
- package/dist/mcp/recovery/reconnection-manager.js.map +1 -1
- package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/recovery-manager.js +2 -4
- package/dist/mcp/recovery/recovery-manager.js.map +1 -1
- package/dist/mcp/router.d.ts.map +1 -1
- package/dist/mcp/router.js +3 -0
- package/dist/mcp/router.js.map +1 -1
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -1
- package/dist/mcp/ruv-swarm-tools.js +132 -102
- package/dist/mcp/ruv-swarm-tools.js.map +1 -1
- package/dist/mcp/server-with-wrapper.d.ts +3 -0
- package/dist/mcp/server-with-wrapper.d.ts.map +1 -1
- package/dist/mcp/server-with-wrapper.js +2 -3
- package/dist/mcp/server-with-wrapper.js.map +1 -1
- package/dist/mcp/server-wrapper-mode.d.ts +5 -0
- package/dist/mcp/server-wrapper-mode.d.ts.map +1 -1
- package/dist/mcp/server-wrapper-mode.js +2 -3
- package/dist/mcp/server-wrapper-mode.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session-manager.d.ts.map +1 -1
- package/dist/mcp/session-manager.js +4 -3
- package/dist/mcp/session-manager.js.map +1 -1
- package/dist/mcp/sparc-modes.d.ts.map +1 -1
- package/dist/mcp/sparc-modes.js +15 -15
- package/dist/mcp/sparc-modes.js.map +1 -1
- package/dist/mcp/swarm-tools.d.ts.map +1 -1
- package/dist/mcp/swarm-tools.js +100 -80
- package/dist/mcp/swarm-tools.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +28 -12
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transports/base.d.ts.map +1 -1
- package/dist/mcp/transports/base.js +3 -0
- package/dist/mcp/transports/base.js.map +1 -1
- package/dist/mcp/transports/http.d.ts +3 -0
- package/dist/mcp/transports/http.d.ts.map +1 -1
- package/dist/mcp/transports/http.js +3 -3
- package/dist/mcp/transports/http.js.map +1 -1
- package/dist/mcp/transports/stdio.d.ts +3 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -1
- package/dist/mcp/transports/stdio.js +3 -0
- package/dist/mcp/transports/stdio.js.map +1 -1
- package/dist/memory/advanced-memory-manager.d.ts.map +1 -1
- package/dist/memory/advanced-memory-manager.js +109 -100
- package/dist/memory/advanced-memory-manager.js.map +1 -1
- package/dist/memory/backends/base.d.ts.map +1 -1
- package/dist/memory/backends/base.js +3 -0
- package/dist/memory/backends/base.js.map +1 -1
- package/dist/memory/backends/markdown.d.ts +3 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -1
- package/dist/memory/backends/markdown.js +8 -8
- package/dist/memory/backends/markdown.js.map +1 -1
- package/dist/memory/backends/sqlite.d.ts +3 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -1
- package/dist/memory/backends/sqlite.js +6 -2
- package/dist/memory/backends/sqlite.js.map +1 -1
- package/dist/memory/cache.d.ts.map +1 -1
- package/dist/memory/cache.js +5 -3
- package/dist/memory/cache.js.map +1 -1
- package/dist/memory/distributed-memory.d.ts.map +1 -1
- package/dist/memory/distributed-memory.js +27 -28
- package/dist/memory/distributed-memory.js.map +1 -1
- package/dist/memory/fallback-store.d.ts.map +1 -1
- package/dist/memory/fallback-store.js.map +1 -1
- package/dist/memory/in-memory-store.d.ts.map +1 -1
- package/dist/memory/in-memory-store.js +8 -8
- package/dist/memory/in-memory-store.js.map +1 -1
- package/dist/memory/indexer.d.ts.map +1 -1
- package/dist/memory/indexer.js +4 -1
- package/dist/memory/indexer.js.map +1 -1
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +17 -20
- package/dist/memory/manager.js.map +1 -1
- package/dist/memory/sqlite-store.js +12 -8
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/memory/swarm-memory.d.ts.map +1 -1
- package/dist/memory/swarm-memory.js +37 -44
- package/dist/memory/swarm-memory.js.map +1 -1
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -8
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/logger.d.ts.map +1 -1
- package/dist/migration/logger.js +5 -5
- package/dist/migration/logger.js.map +1 -1
- package/dist/migration/migration-analyzer.d.ts +3 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -1
- package/dist/migration/migration-analyzer.js +25 -20
- package/dist/migration/migration-analyzer.js.map +1 -1
- package/dist/migration/migration-runner.d.ts.map +1 -1
- package/dist/migration/migration-runner.js +35 -29
- package/dist/migration/migration-runner.js.map +1 -1
- package/dist/migration/migration-validator.d.ts +3 -0
- package/dist/migration/migration-validator.d.ts.map +1 -1
- package/dist/migration/migration-validator.js +22 -26
- package/dist/migration/migration-validator.js.map +1 -1
- package/dist/migration/progress-reporter.d.ts +3 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -1
- package/dist/migration/progress-reporter.js +8 -8
- package/dist/migration/progress-reporter.js.map +1 -1
- package/dist/migration/rollback-manager.d.ts +3 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -1
- package/dist/migration/rollback-manager.js +29 -26
- package/dist/migration/rollback-manager.js.map +1 -1
- package/dist/monitoring/diagnostics.d.ts.map +1 -1
- package/dist/monitoring/diagnostics.js +49 -37
- package/dist/monitoring/diagnostics.js.map +1 -1
- package/dist/monitoring/health-check.d.ts.map +1 -1
- package/dist/monitoring/health-check.js +24 -25
- package/dist/monitoring/health-check.js.map +1 -1
- package/dist/monitoring/real-time-monitor.d.ts.map +1 -1
- package/dist/monitoring/real-time-monitor.js +71 -58
- package/dist/monitoring/real-time-monitor.js.map +1 -1
- package/dist/resources/resource-manager.d.ts.map +1 -1
- package/dist/resources/resource-manager.js +96 -83
- package/dist/resources/resource-manager.js.map +1 -1
- package/dist/swarm/claude-flow-executor.d.ts.map +1 -1
- package/dist/swarm/claude-flow-executor.js +37 -31
- package/dist/swarm/claude-flow-executor.js.map +1 -1
- package/dist/swarm/coordinator.d.ts.map +1 -1
- package/dist/swarm/coordinator.js +330 -280
- package/dist/swarm/coordinator.js.map +1 -1
- package/dist/swarm/direct-executor.d.ts.map +1 -1
- package/dist/swarm/direct-executor.js +44 -37
- package/dist/swarm/direct-executor.js.map +1 -1
- package/dist/swarm/executor-v2.d.ts.map +1 -1
- package/dist/swarm/executor-v2.js +28 -27
- package/dist/swarm/executor-v2.js.map +1 -1
- package/dist/swarm/executor.d.ts +3 -0
- package/dist/swarm/executor.d.ts.map +1 -1
- package/dist/swarm/executor.js +58 -52
- package/dist/swarm/executor.js.map +1 -1
- package/dist/swarm/index.d.ts.map +1 -1
- package/dist/swarm/index.js +2 -2
- package/dist/swarm/index.js.map +1 -1
- package/dist/swarm/json-output-aggregator.d.ts.map +1 -1
- package/dist/swarm/json-output-aggregator.js +20 -19
- package/dist/swarm/json-output-aggregator.js.map +1 -1
- package/dist/swarm/memory.d.ts.map +1 -1
- package/dist/swarm/memory.js +67 -67
- package/dist/swarm/memory.js.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.d.ts +4 -0
- package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.js +19 -23
- package/dist/swarm/optimizations/async-file-manager.js.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.js +2 -4
- package/dist/swarm/optimizations/circular-buffer.js.map +1 -1
- package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -1
- package/dist/swarm/optimizations/connection-pool.js +12 -13
- package/dist/swarm/optimizations/connection-pool.js.map +1 -1
- package/dist/swarm/optimizations/index.js +2 -2
- package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -1
- package/dist/swarm/optimizations/optimized-executor.js +23 -29
- package/dist/swarm/optimizations/optimized-executor.js.map +1 -1
- package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -1
- package/dist/swarm/optimizations/ttl-map.js +4 -4
- package/dist/swarm/optimizations/ttl-map.js.map +1 -1
- package/dist/swarm/prompt-cli.d.ts.map +1 -1
- package/dist/swarm/prompt-cli.js +18 -13
- package/dist/swarm/prompt-cli.js.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.js +12 -12
- package/dist/swarm/prompt-copier-enhanced.js.map +1 -1
- package/dist/swarm/prompt-copier.d.ts.map +1 -1
- package/dist/swarm/prompt-copier.js +15 -18
- package/dist/swarm/prompt-copier.js.map +1 -1
- package/dist/swarm/prompt-manager.d.ts.map +1 -1
- package/dist/swarm/prompt-manager.js +27 -21
- package/dist/swarm/prompt-manager.js.map +1 -1
- package/dist/swarm/prompt-utils.d.ts.map +1 -1
- package/dist/swarm/prompt-utils.js +34 -32
- package/dist/swarm/prompt-utils.js.map +1 -1
- package/dist/swarm/sparc-executor.d.ts.map +1 -1
- package/dist/swarm/sparc-executor.js +189 -123
- package/dist/swarm/sparc-executor.js.map +1 -1
- package/dist/swarm/strategies/auto.d.ts.map +1 -1
- package/dist/swarm/strategies/auto.js +105 -86
- package/dist/swarm/strategies/auto.js.map +1 -1
- package/dist/swarm/strategies/base.d.ts.map +1 -1
- package/dist/swarm/strategies/base.js +14 -11
- package/dist/swarm/strategies/base.js.map +1 -1
- package/dist/swarm/strategies/research.d.ts.map +1 -1
- package/dist/swarm/strategies/research.js +76 -71
- package/dist/swarm/strategies/research.js.map +1 -1
- package/dist/swarm/types.d.ts.map +1 -1
- package/dist/swarm/types.js +3 -0
- package/dist/swarm/types.js.map +1 -1
- package/dist/swarm/workers/copy-worker.js +4 -4
- package/dist/swarm/workers/copy-worker.js.map +1 -1
- package/dist/task/commands.d.ts.map +1 -1
- package/dist/task/commands.js +11 -7
- package/dist/task/commands.js.map +1 -1
- package/dist/task/coordination.d.ts.map +1 -1
- package/dist/task/coordination.js +75 -70
- package/dist/task/coordination.js.map +1 -1
- package/dist/task/engine.d.ts.map +1 -1
- package/dist/task/engine.js +34 -32
- package/dist/task/engine.js.map +1 -1
- package/dist/task/index.d.ts +3 -3
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/index.js +11 -11
- package/dist/task/index.js.map +1 -1
- package/dist/terminal/adapters/native.d.ts.map +1 -1
- package/dist/terminal/adapters/native.js +6 -6
- package/dist/terminal/adapters/native.js.map +1 -1
- package/dist/terminal/adapters/vscode.d.ts +3 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -1
- package/dist/terminal/adapters/vscode.js +6 -4
- package/dist/terminal/adapters/vscode.js.map +1 -1
- package/dist/terminal/manager.d.ts.map +1 -1
- package/dist/terminal/manager.js +6 -8
- package/dist/terminal/manager.js.map +1 -1
- package/dist/terminal/pool.d.ts.map +1 -1
- package/dist/terminal/pool.js +3 -0
- package/dist/terminal/pool.js.map +1 -1
- package/dist/terminal/session.d.ts.map +1 -1
- package/dist/terminal/session.js +6 -2
- package/dist/terminal/session.js.map +1 -1
- package/dist/ui/hive-dashboard.d.ts.map +1 -1
- package/dist/ui/hive-dashboard.js +52 -33
- package/dist/ui/hive-dashboard.js.map +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +5 -8
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/npx-isolated-cache.js +3 -3
- package/dist/utils/npx-isolated-cache.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +8 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/type-guards.d.ts +1 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/dist/utils/type-guards.js +11 -10
- package/dist/utils/type-guards.js.map +1 -1
- package/package.json +7 -6
- package/src/adapters/cliffy-node.ts +27 -22
- package/src/agents/agent-manager.ts +145 -121
- package/src/agents/agent-registry.ts +77 -70
- package/src/api/claude-client.ts +59 -38
- package/src/api/routes/analysis.js +750 -735
- package/src/cli/__tests__/command-registry.test.js +42 -32
- package/src/cli/__tests__/simple-cli.test.js +42 -37
- package/src/cli/__tests__/utils.test.js +9 -9
- package/src/cli/agents/README.md +30 -4
- package/src/cli/agents/analyst.ts +161 -163
- package/src/cli/agents/architect.ts +126 -131
- package/src/cli/agents/base-agent.ts +48 -47
- package/src/cli/agents/capabilities.ts +87 -85
- package/src/cli/agents/coder.ts +127 -120
- package/src/cli/agents/coordinator.ts +72 -72
- package/src/cli/agents/hive-agents.ts +96 -70
- package/src/cli/agents/index.ts +70 -55
- package/src/cli/agents/researcher.ts +63 -74
- package/src/cli/agents/tester.ts +91 -98
- package/src/cli/cli-core.ts +56 -47
- package/src/cli/command-registry.js +125 -83
- package/src/cli/commands/advanced-memory-commands.ts +210 -142
- package/src/cli/commands/agent-simple.ts +146 -114
- package/src/cli/commands/agent.ts +119 -95
- package/src/cli/commands/claude-api.ts +19 -15
- package/src/cli/commands/claude.ts +96 -88
- package/src/cli/commands/config-integration.ts +120 -101
- package/src/cli/commands/config.ts +10 -8
- package/src/cli/commands/enterprise.ts +323 -187
- package/src/cli/commands/help-new.ts +246 -0
- package/src/cli/commands/help.ts +326 -183
- package/src/cli/commands/hive-mind/index.ts +3 -3
- package/src/cli/commands/hive-mind/init.ts +19 -12
- package/src/cli/commands/hive-mind/optimize-memory.ts +83 -53
- package/src/cli/commands/hive-mind/pause.ts +27 -25
- package/src/cli/commands/hive-mind/ps.ts +43 -37
- package/src/cli/commands/hive-mind/resume.ts +26 -26
- package/src/cli/commands/hive-mind/spawn.ts +37 -29
- package/src/cli/commands/hive-mind/status.ts +51 -51
- package/src/cli/commands/hive-mind/stop.ts +56 -51
- package/src/cli/commands/hive-mind/task.ts +65 -54
- package/src/cli/commands/hive-mind/wizard.ts +181 -167
- package/src/cli/commands/hive.ts +136 -96
- package/src/cli/commands/hook-types.ts +2 -2
- package/src/cli/commands/hook-validator.ts +8 -4
- package/src/cli/commands/hook.ts +44 -42
- package/src/cli/commands/index.ts +1162 -1031
- package/src/cli/commands/mcp.ts +105 -94
- package/src/cli/commands/memory.ts +24 -21
- package/src/cli/commands/migrate.ts +24 -24
- package/src/cli/commands/monitor.ts +123 -93
- package/src/cli/commands/ruv-swarm.ts +131 -122
- package/src/cli/commands/session.ts +60 -45
- package/src/cli/commands/sparc.ts +170 -139
- package/src/cli/commands/start/event-emitter.ts +2 -2
- package/src/cli/commands/start/index.ts +1 -1
- package/src/cli/commands/start/process-manager.ts +30 -47
- package/src/cli/commands/start/process-ui-simple.ts +60 -49
- package/src/cli/commands/start/process-ui.ts +1 -1
- package/src/cli/commands/start/start-command.ts +104 -75
- package/src/cli/commands/start/system-monitor.ts +35 -41
- package/src/cli/commands/start/types.ts +3 -3
- package/src/cli/commands/start.ts +1 -1
- package/src/cli/commands/status.ts +67 -67
- package/src/cli/commands/swarm-spawn.ts +21 -12
- package/src/cli/commands/swarm.ts +221 -150
- package/src/cli/commands/task.ts +55 -55
- package/src/cli/commands/workflow.ts +174 -157
- package/src/cli/completion.ts +34 -19
- package/src/cli/create-enhanced-task.js +49 -17
- package/src/cli/formatter.ts +38 -37
- package/src/cli/help-formatter.js +145 -0
- package/src/cli/help-formatter.ts +173 -0
- package/src/cli/help-text.js +273 -6
- package/src/cli/index-remote.ts +12 -9
- package/src/cli/index.ts +77 -67
- package/src/cli/init/batch-tools.ts +4 -5
- package/src/cli/init/claude-config.ts +125 -118
- package/src/cli/init/directory-structure.ts +10 -11
- package/src/cli/init/index.ts +13 -13
- package/src/cli/init/sparc-environment.ts +90 -74
- package/src/cli/init/swarm-commands.ts +5 -6
- package/src/cli/init/utils.ts +1 -1
- package/src/cli/main.ts +9 -10
- package/src/cli/node-compat.js +26 -19
- package/src/cli/node-repl.ts +104 -87
- package/src/cli/repl.ts +190 -158
- package/src/cli/runtime-detector.js +24 -19
- package/src/cli/simple-cli.js +479 -394
- package/src/cli/simple-cli.ts +426 -366
- package/src/cli/simple-commands/__tests__/agent.test.js +49 -55
- package/src/cli/simple-commands/__tests__/memory.test.js +4 -401
- package/src/cli/simple-commands/__tests__/swarm.test.js +49 -55
- package/src/cli/simple-commands/__tests__/task.test.js +4 -478
- package/src/cli/simple-commands/agent.js +27 -27
- package/src/cli/simple-commands/analysis.js +179 -161
- package/src/cli/simple-commands/automation.js +226 -205
- package/src/cli/simple-commands/batch-manager.js +98 -88
- package/src/cli/simple-commands/config.js +65 -60
- package/src/cli/simple-commands/coordination.js +197 -185
- package/src/cli/simple-commands/enhanced-ui-views.js +142 -115
- package/src/cli/simple-commands/enhanced-webui-complete.js +267 -167
- package/src/cli/simple-commands/fix-hook-variables.js +73 -67
- package/src/cli/simple-commands/github/gh-coordinator.js +63 -53
- package/src/cli/simple-commands/github/github-api.js +45 -47
- package/src/cli/simple-commands/github.js +33 -34
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +44 -40
- package/src/cli/simple-commands/hive-mind/communication.js +198 -185
- package/src/cli/simple-commands/hive-mind/core.js +289 -304
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +278 -168
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +352 -258
- package/src/cli/simple-commands/hive-mind/memory.js +356 -287
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +88 -79
- package/src/cli/simple-commands/hive-mind/performance-test.js +61 -49
- package/src/cli/simple-commands/hive-mind/queen.js +223 -213
- package/src/cli/simple-commands/hive-mind/session-manager.js +217 -157
- package/src/cli/simple-commands/hive-mind-optimize.js +69 -65
- package/src/cli/simple-commands/hive-mind-wizard.js +213 -211
- package/src/cli/simple-commands/hive-mind.js +602 -435
- package/src/cli/simple-commands/hive.js +12 -12
- package/src/cli/simple-commands/hook-safety.js +114 -111
- package/src/cli/simple-commands/hooks.js +1077 -1017
- package/src/cli/simple-commands/init/README.md +8 -1
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +27 -1
- package/src/cli/simple-commands/init/batch-init.js +105 -100
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +20 -18
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +85 -71
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +6 -7
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +42 -33
- package/src/cli/simple-commands/init/executable-wrapper.js +13 -10
- package/src/cli/simple-commands/init/gitignore-updater.js +22 -22
- package/src/cli/simple-commands/init/help.js +4 -2
- package/src/cli/simple-commands/init/index.js +405 -303
- package/src/cli/simple-commands/init/performance-monitor.js +71 -64
- package/src/cli/simple-commands/init/rollback/backup-manager.js +44 -64
- package/src/cli/simple-commands/init/rollback/index.js +31 -39
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +71 -101
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +34 -53
- package/src/cli/simple-commands/init/rollback/state-tracker.js +38 -49
- package/src/cli/simple-commands/init/sparc/roo-readme.js +1 -1
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -77
- package/src/cli/simple-commands/init/sparc/workflows.js +37 -33
- package/src/cli/simple-commands/init/sparc-structure.js +9 -10
- package/src/cli/simple-commands/init/templates/CLAUDE.md +94 -26
- package/src/cli/simple-commands/init/templates/claude-flow-universal +9 -7
- package/src/cli/simple-commands/init/templates/claude-md.js +1 -1
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +15 -3
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +12 -2
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +10 -1
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +18 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +13 -6
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +13 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +12 -1
- package/src/cli/simple-commands/init/templates/coordination-md.js +1 -1
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +116 -113
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +1 -1
- package/src/cli/simple-commands/init/templates/readme-files.js +1 -1
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +176 -127
- package/src/cli/simple-commands/init/templates/settings.json +2 -5
- package/src/cli/simple-commands/init/templates/sparc-modes.js +3 -3
- package/src/cli/simple-commands/init/validation/config-validator.js +17 -28
- package/src/cli/simple-commands/init/validation/health-checker.js +54 -62
- package/src/cli/simple-commands/init/validation/index.js +18 -23
- package/src/cli/simple-commands/init/validation/mode-validator.js +22 -32
- package/src/cli/simple-commands/init/validation/post-init-validator.js +25 -26
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +32 -36
- package/src/cli/simple-commands/init/validation/test-runner.js +55 -63
- package/src/cli/simple-commands/init.js +1 -1
- package/src/cli/simple-commands/mcp-integration-layer.js +179 -110
- package/src/cli/simple-commands/mcp.js +55 -48
- package/src/cli/simple-commands/memory.js +62 -56
- package/src/cli/simple-commands/migrate-hooks.js +9 -10
- package/src/cli/simple-commands/monitor.js +87 -67
- package/src/cli/simple-commands/process-ui-enhanced.js +207 -155
- package/src/cli/simple-commands/process-ui.js +65 -56
- package/src/cli/simple-commands/realtime-update-system.js +136 -129
- package/src/cli/simple-commands/sparc/architecture.js +352 -251
- package/src/cli/simple-commands/sparc/commands.js +122 -94
- package/src/cli/simple-commands/sparc/completion.js +274 -199
- package/src/cli/simple-commands/sparc/coordinator.js +217 -169
- package/src/cli/simple-commands/sparc/index.js +40 -36
- package/src/cli/simple-commands/sparc/phase-base.js +72 -58
- package/src/cli/simple-commands/sparc/pseudocode.js +275 -159
- package/src/cli/simple-commands/sparc/refinement.js +306 -212
- package/src/cli/simple-commands/sparc/specification.js +164 -94
- package/src/cli/simple-commands/sparc-modes/architect.js +1 -1
- package/src/cli/simple-commands/sparc-modes/ask.js +1 -1
- package/src/cli/simple-commands/sparc-modes/code.js +1 -1
- package/src/cli/simple-commands/sparc-modes/debug.js +1 -1
- package/src/cli/simple-commands/sparc-modes/devops.js +1 -1
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
- package/src/cli/simple-commands/sparc-modes/generic.js +1 -1
- package/src/cli/simple-commands/sparc-modes/index.js +15 -15
- package/src/cli/simple-commands/sparc-modes/integration.js +1 -1
- package/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
- package/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
- package/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
- package/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
- package/src/cli/simple-commands/sparc-modes/swarm.js +52 -52
- package/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
- package/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
- package/src/cli/simple-commands/sparc.js +87 -69
- package/src/cli/simple-commands/start-ui.js +21 -20
- package/src/cli/simple-commands/start-wrapper.js +29 -31
- package/src/cli/simple-commands/start.js +1 -1
- package/src/cli/simple-commands/status.js +53 -47
- package/src/cli/simple-commands/swarm-executor.js +47 -57
- package/src/cli/simple-commands/swarm-metrics-integration.js +119 -79
- package/src/cli/simple-commands/swarm-ui.js +120 -118
- package/src/cli/simple-commands/swarm-webui-integration.js +48 -27
- package/src/cli/simple-commands/swarm.js +216 -181
- package/src/cli/simple-commands/task.js +29 -29
- package/src/cli/simple-commands/timestamp-fix.js +28 -25
- package/src/cli/simple-commands/tool-execution-framework.js +115 -118
- package/src/cli/simple-commands/training.js +219 -194
- package/src/cli/simple-commands/web-server.js +118 -117
- package/src/cli/simple-commands/webui-validator.js +4 -3
- package/src/cli/simple-mcp.ts +14 -17
- package/src/cli/simple-orchestrator.ts +113 -101
- package/src/cli/swarm-standalone.js +20 -21
- package/src/cli/ui/compatible-ui.ts +55 -44
- package/src/cli/ui/fallback-handler.ts +19 -16
- package/src/cli/ui/index.ts +14 -15
- package/src/cli/utils/environment-detector.ts +75 -67
- package/src/cli/utils/interactive-detector.js +17 -11
- package/src/cli/utils/prompt-defaults.ts +32 -28
- package/src/cli/utils/safe-interactive.js +21 -20
- package/src/cli/utils.js +127 -110
- package/src/cli/validation-helper.js +113 -0
- package/src/cli/validation-helper.ts +128 -0
- package/src/communication/message-bus.ts +137 -124
- package/src/config/config-manager.ts +62 -30
- package/src/config/ruv-swarm-config.ts +105 -86
- package/src/config/ruv-swarm-integration.ts +38 -38
- package/src/constants/agent-types.ts +9 -8
- package/src/coordination/README.md +54 -31
- package/src/coordination/advanced-scheduler.ts +23 -26
- package/src/coordination/advanced-task-executor.ts +74 -68
- package/src/coordination/background-executor.ts +33 -30
- package/src/coordination/circuit-breaker.ts +26 -27
- package/src/coordination/conflict-resolution.ts +18 -27
- package/src/coordination/dependency-graph.ts +15 -18
- package/src/coordination/hive-orchestrator.ts +111 -81
- package/src/coordination/hive-protocol.ts +68 -77
- package/src/coordination/index.ts +3 -7
- package/src/coordination/load-balancer.ts +115 -105
- package/src/coordination/manager.ts +38 -51
- package/src/coordination/messaging.ts +19 -29
- package/src/coordination/metrics.ts +57 -60
- package/src/coordination/resources.ts +32 -37
- package/src/coordination/scheduler.ts +29 -30
- package/src/coordination/swarm-coordinator.ts +81 -70
- package/src/coordination/swarm-monitor.ts +90 -69
- package/src/coordination/work-stealing.ts +6 -13
- package/src/core/config.ts +148 -143
- package/src/core/event-bus.ts +5 -6
- package/src/core/json-persistence.ts +27 -34
- package/src/core/logger.ts +13 -16
- package/src/core/orchestrator-fixed.ts +33 -32
- package/src/core/orchestrator.ts +166 -159
- package/src/core/persistence.ts +47 -36
- package/src/enterprise/analytics-manager.ts +242 -233
- package/src/enterprise/audit-manager.ts +238 -184
- package/src/enterprise/cloud-manager.ts +167 -151
- package/src/enterprise/deployment-manager.ts +223 -180
- package/src/enterprise/index.ts +7 -7
- package/src/enterprise/project-manager.ts +151 -133
- package/src/enterprise/security-manager.ts +278 -223
- package/src/hive-mind/core/Agent.ts +112 -109
- package/src/hive-mind/core/Communication.ts +67 -69
- package/src/hive-mind/core/DatabaseManager.ts +299 -166
- package/src/hive-mind/core/HiveMind.ts +100 -96
- package/src/hive-mind/core/Memory.ts +304 -295
- package/src/hive-mind/core/MemoryMonitor.ts +46 -47
- package/src/hive-mind/core/Queen.ts +187 -114
- package/src/hive-mind/index.ts +2 -2
- package/src/hive-mind/integration/ConsensusEngine.ts +88 -92
- package/src/hive-mind/integration/MCPToolWrapper.ts +20 -72
- package/src/hive-mind/integration/SwarmOrchestrator.ts +173 -165
- package/src/hive-mind/types.ts +24 -12
- package/src/integration/mock-components.ts +42 -30
- package/src/integration/system-integration.ts +93 -69
- package/src/integration/types.ts +7 -7
- package/src/mcp/README.md +23 -4
- package/src/mcp/auth.ts +25 -18
- package/src/mcp/claude-code-wrapper.ts +257 -150
- package/src/mcp/claude-flow-tools.ts +52 -13
- package/src/mcp/client.ts +15 -13
- package/src/mcp/index.ts +22 -27
- package/src/mcp/integrate-wrapper.ts +18 -18
- package/src/mcp/lifecycle-manager.ts +30 -27
- package/src/mcp/load-balancer.ts +10 -11
- package/src/mcp/mcp-server.js +755 -370
- package/src/mcp/orchestration-integration.ts +32 -17
- package/src/mcp/performance-monitor.ts +65 -51
- package/src/mcp/protocol-manager.ts +36 -52
- package/src/mcp/recovery/connection-health-monitor.ts +40 -35
- package/src/mcp/recovery/connection-state-manager.ts +52 -50
- package/src/mcp/recovery/fallback-coordinator.ts +24 -24
- package/src/mcp/recovery/index.ts +23 -4
- package/src/mcp/recovery/reconnection-manager.ts +14 -15
- package/src/mcp/recovery/recovery-manager.ts +52 -68
- package/src/mcp/router.ts +1 -2
- package/src/mcp/ruv-swarm-tools.ts +167 -138
- package/src/mcp/ruv-swarm-wrapper.js +31 -23
- package/src/mcp/server-with-wrapper.ts +4 -5
- package/src/mcp/server-wrapper-mode.ts +5 -6
- package/src/mcp/server.ts +45 -40
- package/src/mcp/session-manager.ts +8 -11
- package/src/mcp/sparc-modes.ts +29 -28
- package/src/mcp/swarm-tools.ts +131 -114
- package/src/mcp/tests/mcp-integration.test.ts +49 -55
- package/src/mcp/tools.ts +53 -38
- package/src/mcp/transports/base.ts +4 -5
- package/src/mcp/transports/http.ts +45 -42
- package/src/mcp/transports/stdio.ts +9 -12
- package/src/memory/README.md +37 -27
- package/src/memory/advanced-memory-manager.ts +336 -279
- package/src/memory/backends/base.ts +4 -5
- package/src/memory/backends/markdown.ts +16 -22
- package/src/memory/backends/sqlite.ts +19 -15
- package/src/memory/cache.ts +18 -18
- package/src/memory/distributed-memory.ts +84 -92
- package/src/memory/enhanced-examples.js +68 -59
- package/src/memory/enhanced-memory.js +99 -80
- package/src/memory/fallback-store.js +16 -7
- package/src/memory/in-memory-store.js +31 -27
- package/src/memory/index.js +4 -4
- package/src/memory/indexer.ts +6 -10
- package/src/memory/manager.ts +45 -59
- package/src/memory/migration.js +107 -90
- package/src/memory/shared-memory.js +155 -157
- package/src/memory/sqlite-store.js +76 -59
- package/src/memory/swarm-memory.js +138 -131
- package/src/memory/swarm-memory.ts +74 -75
- package/src/memory/test-example.js +28 -30
- package/src/migration/README.md +25 -9
- package/src/migration/index.ts +13 -14
- package/src/migration/logger.ts +9 -7
- package/src/migration/migration-analyzer.ts +66 -52
- package/src/migration/migration-manifest.json +2 -6
- package/src/migration/migration-runner.ts +86 -63
- package/src/migration/migration-validator.ts +93 -68
- package/src/migration/package.json +1 -1
- package/src/migration/progress-reporter.ts +25 -21
- package/src/migration/rollback-manager.ts +79 -63
- package/src/migration/tests/migration-system.test.ts +4 -491
- package/src/migration/tsconfig.json +3 -10
- package/src/migration/types.ts +1 -1
- package/src/monitoring/diagnostics.ts +123 -97
- package/src/monitoring/health-check.ts +45 -51
- package/src/monitoring/real-time-monitor.ts +105 -92
- package/src/resources/resource-manager.ts +205 -159
- package/src/swarm/__tests__/integration.test.ts +59 -65
- package/src/swarm/__tests__/prompt-copier.test.ts +27 -27
- package/src/swarm/claude-flow-executor.ts +50 -49
- package/src/swarm/coordinator.ts +727 -635
- package/src/swarm/direct-executor.ts +80 -86
- package/src/swarm/executor-v2.ts +81 -66
- package/src/swarm/executor.ts +124 -124
- package/src/swarm/index.ts +7 -8
- package/src/swarm/json-output-aggregator.ts +56 -40
- package/src/swarm/memory.ts +152 -147
- package/src/swarm/optimizations/README.md +20 -12
- package/src/swarm/optimizations/__tests__/optimization.test.ts +84 -87
- package/src/swarm/optimizations/async-file-manager.ts +70 -80
- package/src/swarm/optimizations/circular-buffer.ts +37 -37
- package/src/swarm/optimizations/connection-pool.ts +64 -64
- package/src/swarm/optimizations/index.ts +4 -4
- package/src/swarm/optimizations/migration-guide.md +27 -16
- package/src/swarm/optimizations/optimized-executor.ts +104 -114
- package/src/swarm/optimizations/ttl-map.ts +66 -63
- package/src/swarm/prompt-cli.ts +48 -42
- package/src/swarm/prompt-copier-enhanced.ts +54 -55
- package/src/swarm/prompt-copier.ts +59 -65
- package/src/swarm/prompt-copying-README.md +49 -33
- package/src/swarm/prompt-manager.ts +69 -63
- package/src/swarm/prompt-utils.ts +71 -66
- package/src/swarm/sparc-executor.ts +298 -225
- package/src/swarm/strategies/auto.ts +367 -252
- package/src/swarm/strategies/base.ts +24 -20
- package/src/swarm/strategies/research.ts +144 -124
- package/src/swarm/types.ts +340 -309
- package/src/swarm/workers/copy-worker.ts +12 -13
- package/src/task/README.md +99 -70
- package/src/task/commands.ts +16 -8
- package/src/task/coordination.ts +209 -162
- package/src/task/engine.ts +81 -65
- package/src/task/index.ts +28 -31
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_BEST_PRACTICES.md +479 -481
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_GUIDE.md +210 -188
- package/src/templates/claude-optimized/.claude/MIGRATION_GUIDE.md +151 -105
- package/src/templates/claude-optimized/.claude/PERFORMANCE_BENCHMARKS.md +102 -87
- package/src/templates/claude-optimized/.claude/commands/claude-flow-help.md +18 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-memory.md +17 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-swarm.md +21 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/architect.md +11 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/ask.md +16 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/code.md +26 -7
- package/src/templates/claude-optimized/.claude/commands/sparc/debug.md +14 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/devops.md +23 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/docs-writer.md +8 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/integration.md +43 -27
- package/src/templates/claude-optimized/.claude/commands/sparc/mcp.md +15 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/post-deployment-monitoring-mode.md +45 -30
- package/src/templates/claude-optimized/.claude/commands/sparc/refinement-optimization-mode.md +23 -13
- package/src/templates/claude-optimized/.claude/commands/sparc/security-review.md +31 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/sparc.md +54 -47
- package/src/templates/claude-optimized/.claude/commands/sparc/spec-pseudocode.md +27 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/supabase-admin.md +18 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/tdd.md +23 -9
- package/src/templates/claude-optimized/.claude/commands/sparc/tutorial.md +22 -16
- package/src/templates/claude-optimized/.claude/commands/sparc.md +20 -1
- package/src/templates/claude-optimized/README.md +10 -1
- package/src/templates/claude-optimized/SUMMARY.md +23 -1
- package/src/templates/claude-optimized/deploy-to-project.js +22 -10
- package/src/templates/claude-optimized/install-template.js +14 -10
- package/src/templates/claude-optimized/manifest.json +1 -1
- package/src/templates/claude-optimized/package.json +1 -1
- package/src/templates/claude-optimized/template-manager.js +8 -8
- package/src/templates/claude-optimized/validate-template.js +33 -23
- package/src/terminal/adapters/base.ts +1 -1
- package/src/terminal/adapters/native.ts +47 -47
- package/src/terminal/adapters/vscode.ts +21 -28
- package/src/terminal/manager.ts +27 -22
- package/src/terminal/pool.ts +24 -27
- package/src/terminal/session.ts +18 -18
- package/src/terminal/vscode-bridge.ts +21 -21
- package/src/tests/validation-consistency.test.ts +4 -4
- package/src/types/cliffy.d.ts +11 -14
- package/src/types/global.d.ts +1 -2
- package/src/types/index.ts +2 -2
- package/src/types/mcp.d.ts +11 -17
- package/src/types/vscode.d.ts +18 -5
- package/src/ui/console/README-analysis-tools.md +52 -2
- package/src/ui/console/README.md +33 -1
- package/src/ui/console/WORKFLOW_DESIGNER_README.md +81 -22
- package/src/ui/console/analysis-tools.html +282 -261
- package/src/ui/console/analytics.html +329 -326
- package/src/ui/console/index.html +221 -209
- package/src/ui/console/js/analysis-tools.js +815 -754
- package/src/ui/console/js/command-handler.js +226 -196
- package/src/ui/console/js/console.js +117 -119
- package/src/ui/console/js/daa-tools.js +797 -787
- package/src/ui/console/js/memory-interface.js +676 -638
- package/src/ui/console/js/memory-test.js +49 -46
- package/src/ui/console/js/memory-tools.js +181 -159
- package/src/ui/console/js/settings.js +124 -103
- package/src/ui/console/js/terminal-emulator.js +147 -130
- package/src/ui/console/js/websocket-client.js +71 -71
- package/src/ui/console/js/workflow-designer.js +1126 -1110
- package/src/ui/console/neural-networks-demo.md +45 -16
- package/src/ui/console/styles/analysis-tools.css +571 -561
- package/src/ui/console/styles/console.css +16 -12
- package/src/ui/console/styles/daa-tools.css +322 -319
- package/src/ui/console/styles/responsive.css +71 -70
- package/src/ui/console/styles/settings.css +12 -12
- package/src/ui/console/styles/workflow-designer.css +628 -584
- package/src/ui/console/test-neural-networks.js +59 -54
- package/src/ui/console/test-neural.html +194 -196
- package/src/ui/console/workflow-designer-demo.html +433 -424
- package/src/ui/hive-dashboard.ts +74 -52
- package/src/ui/web-ui/EnhancedProcessUI.js +570 -424
- package/src/ui/web-ui/EnhancedWebUI.js +65 -65
- package/src/ui/web-ui/README.md +16 -16
- package/src/ui/web-ui/components/ComponentLibrary.js +173 -124
- package/src/ui/web-ui/core/EventBus.js +27 -25
- package/src/ui/web-ui/core/MCPIntegrationLayer.js +294 -108
- package/src/ui/web-ui/core/StateManager.js +43 -46
- package/src/ui/web-ui/core/UIManager.js +120 -70
- package/src/ui/web-ui/core/ViewManager.js +16 -19
- package/src/ui/web-ui/index.js +101 -48
- package/src/ui/web-ui/neural-panel-test.js +109 -108
- package/src/ui/web-ui/test-github-view.js +11 -12
- package/src/ui/web-ui/test-neural-panel.html +219 -205
- package/src/ui/web-ui/views/DAAView.js +88 -85
- package/src/ui/web-ui/views/GitHubIntegrationTest.js +42 -42
- package/src/ui/web-ui/views/GitHubIntegrationView.js +59 -53
- package/src/ui/web-ui/views/NeuralNetworkView.js +20 -21
- package/src/ui/web-ui/views/WorkflowAutomationView.js +31 -32
- package/src/utils/error-handler.js +1 -1
- package/src/utils/error-handler.ts +9 -5
- package/src/utils/errors.ts +20 -18
- package/src/utils/formatters.ts +6 -6
- package/src/utils/helpers.ts +53 -55
- package/src/utils/npx-isolated-cache.js +16 -16
- package/src/utils/paths.ts +9 -6
- package/src/utils/timezone-utils.js +16 -16
- package/src/utils/type-guards.ts +37 -26
- package/src/utils/types.ts +2 -2
|
@@ -18,9 +18,9 @@ export class SparcRefinement extends SparcPhase {
|
|
|
18
18
|
*/
|
|
19
19
|
async execute() {
|
|
20
20
|
console.log('🔧 Starting Refinement Phase');
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
await this.initializePhase();
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
const result = {
|
|
25
25
|
tddCycles: [],
|
|
26
26
|
implementations: [],
|
|
@@ -31,7 +31,7 @@ export class SparcRefinement extends SparcPhase {
|
|
|
31
31
|
security: {},
|
|
32
32
|
documentation: {},
|
|
33
33
|
refactoring: {},
|
|
34
|
-
validation: {}
|
|
34
|
+
validation: {},
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
try {
|
|
@@ -39,38 +39,43 @@ export class SparcRefinement extends SparcPhase {
|
|
|
39
39
|
const specification = await this.retrieveFromMemory('specification_complete');
|
|
40
40
|
const pseudocode = await this.retrieveFromMemory('pseudocode_complete');
|
|
41
41
|
const architecture = await this.retrieveFromMemory('architecture_complete');
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
if (!specification || !pseudocode || !architecture) {
|
|
44
|
-
throw new Error(
|
|
44
|
+
throw new Error(
|
|
45
|
+
'Specification, Pseudocode, and Architecture phases must be completed first',
|
|
46
|
+
);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
// Execute TDD cycles
|
|
48
50
|
result.tddCycles = await this.executeTddCycles(specification, pseudocode, architecture);
|
|
49
|
-
|
|
51
|
+
|
|
50
52
|
// Generate implementations
|
|
51
53
|
result.implementations = await this.generateImplementations(architecture);
|
|
52
|
-
|
|
54
|
+
|
|
53
55
|
// Run tests and collect results
|
|
54
56
|
result.testResults = await this.runTests(result.tddCycles);
|
|
55
|
-
|
|
57
|
+
|
|
56
58
|
// Analyze code quality
|
|
57
59
|
result.codeQuality = await this.analyzeCodeQuality(result.implementations);
|
|
58
|
-
|
|
60
|
+
|
|
59
61
|
// Apply optimizations
|
|
60
|
-
result.optimizations = await this.applyOptimizations(
|
|
61
|
-
|
|
62
|
+
result.optimizations = await this.applyOptimizations(
|
|
63
|
+
result.implementations,
|
|
64
|
+
result.codeQuality,
|
|
65
|
+
);
|
|
66
|
+
|
|
62
67
|
// Analyze performance
|
|
63
68
|
result.performance = await this.analyzePerformance(result.implementations);
|
|
64
|
-
|
|
69
|
+
|
|
65
70
|
// Analyze security
|
|
66
71
|
result.security = await this.analyzeSecurity(result.implementations);
|
|
67
|
-
|
|
72
|
+
|
|
68
73
|
// Generate documentation
|
|
69
74
|
result.documentation = await this.generateDocumentation(result.implementations);
|
|
70
|
-
|
|
75
|
+
|
|
71
76
|
// Apply refactoring
|
|
72
77
|
result.refactoring = await this.applyRefactoring(result.implementations, result.codeQuality);
|
|
73
|
-
|
|
78
|
+
|
|
74
79
|
// Final validation
|
|
75
80
|
result.validation = await this.performFinalValidation(result);
|
|
76
81
|
|
|
@@ -82,7 +87,6 @@ export class SparcRefinement extends SparcPhase {
|
|
|
82
87
|
|
|
83
88
|
console.log('✅ Refinement phase completed');
|
|
84
89
|
return result;
|
|
85
|
-
|
|
86
90
|
} catch (error) {
|
|
87
91
|
console.error('❌ Refinement phase failed:', error.message);
|
|
88
92
|
throw error;
|
|
@@ -95,10 +99,10 @@ export class SparcRefinement extends SparcPhase {
|
|
|
95
99
|
async executeTddCycles(specification, pseudocode, architecture) {
|
|
96
100
|
const cycles = [];
|
|
97
101
|
const requirements = specification.requirements || [];
|
|
98
|
-
|
|
102
|
+
|
|
99
103
|
for (const [index, requirement] of requirements.entries()) {
|
|
100
104
|
console.log(`🔄 TDD Cycle ${index + 1}: ${requirement}`);
|
|
101
|
-
|
|
105
|
+
|
|
102
106
|
const cycle = {
|
|
103
107
|
id: `tdd-cycle-${index + 1}`,
|
|
104
108
|
requirement: requirement,
|
|
@@ -106,31 +110,31 @@ export class SparcRefinement extends SparcPhase {
|
|
|
106
110
|
greenPhase: null,
|
|
107
111
|
refactorPhase: null,
|
|
108
112
|
duration: 0,
|
|
109
|
-
success: false
|
|
113
|
+
success: false,
|
|
110
114
|
};
|
|
111
115
|
|
|
112
116
|
const startTime = Date.now();
|
|
113
|
-
|
|
117
|
+
|
|
114
118
|
try {
|
|
115
119
|
// RED: Write failing test
|
|
116
120
|
cycle.redPhase = await this.executeRedPhase(requirement, architecture);
|
|
117
|
-
|
|
121
|
+
|
|
118
122
|
// GREEN: Make test pass with minimal implementation
|
|
119
123
|
cycle.greenPhase = await this.executeGreenPhase(cycle.redPhase, architecture);
|
|
120
|
-
|
|
124
|
+
|
|
121
125
|
// REFACTOR: Improve code while keeping tests green
|
|
122
126
|
cycle.refactorPhase = await this.executeRefactorPhase(cycle.greenPhase, architecture);
|
|
123
|
-
|
|
127
|
+
|
|
124
128
|
cycle.success = true;
|
|
125
129
|
} catch (error) {
|
|
126
130
|
cycle.error = error.message;
|
|
127
131
|
cycle.success = false;
|
|
128
132
|
}
|
|
129
|
-
|
|
133
|
+
|
|
130
134
|
cycle.duration = Date.now() - startTime;
|
|
131
135
|
cycles.push(cycle);
|
|
132
136
|
}
|
|
133
|
-
|
|
137
|
+
|
|
134
138
|
return cycles;
|
|
135
139
|
}
|
|
136
140
|
|
|
@@ -142,12 +146,12 @@ export class SparcRefinement extends SparcPhase {
|
|
|
142
146
|
phase: 'red',
|
|
143
147
|
requirement: requirement,
|
|
144
148
|
tests: [],
|
|
145
|
-
status: 'completed'
|
|
149
|
+
status: 'completed',
|
|
146
150
|
};
|
|
147
151
|
|
|
148
152
|
// Generate test cases for the requirement
|
|
149
153
|
const testCases = this.generateTestCases(requirement, architecture);
|
|
150
|
-
|
|
154
|
+
|
|
151
155
|
for (const testCase of testCases) {
|
|
152
156
|
const test = {
|
|
153
157
|
name: testCase.name,
|
|
@@ -155,9 +159,9 @@ export class SparcRefinement extends SparcPhase {
|
|
|
155
159
|
code: this.generateTestCode(testCase),
|
|
156
160
|
expected: 'fail',
|
|
157
161
|
actual: 'fail',
|
|
158
|
-
passed: false
|
|
162
|
+
passed: false,
|
|
159
163
|
};
|
|
160
|
-
|
|
164
|
+
|
|
161
165
|
redPhase.tests.push(test);
|
|
162
166
|
}
|
|
163
167
|
|
|
@@ -173,26 +177,28 @@ export class SparcRefinement extends SparcPhase {
|
|
|
173
177
|
phase: 'green',
|
|
174
178
|
implementations: [],
|
|
175
179
|
testResults: [],
|
|
176
|
-
status: 'completed'
|
|
180
|
+
status: 'completed',
|
|
177
181
|
};
|
|
178
182
|
|
|
179
183
|
// Generate minimal implementation for each test
|
|
180
184
|
for (const test of redPhase.tests) {
|
|
181
185
|
const implementation = this.generateMinimalImplementation(test, architecture);
|
|
182
186
|
greenPhase.implementations.push(implementation);
|
|
183
|
-
|
|
187
|
+
|
|
184
188
|
// Simulate test run
|
|
185
189
|
const testResult = {
|
|
186
190
|
testName: test.name,
|
|
187
191
|
passed: true,
|
|
188
192
|
executionTime: Math.random() * 100 + 50, // 50-150ms
|
|
189
|
-
assertions: this.generateAssertions(test)
|
|
193
|
+
assertions: this.generateAssertions(test),
|
|
190
194
|
};
|
|
191
|
-
|
|
195
|
+
|
|
192
196
|
greenPhase.testResults.push(testResult);
|
|
193
197
|
}
|
|
194
198
|
|
|
195
|
-
console.log(
|
|
199
|
+
console.log(
|
|
200
|
+
` 🟢 GREEN: Made ${greenPhase.testResults.filter((t) => t.passed).length} tests pass`,
|
|
201
|
+
);
|
|
196
202
|
return greenPhase;
|
|
197
203
|
}
|
|
198
204
|
|
|
@@ -205,14 +211,14 @@ export class SparcRefinement extends SparcPhase {
|
|
|
205
211
|
refactorings: [],
|
|
206
212
|
improvedImplementations: [],
|
|
207
213
|
testResults: [],
|
|
208
|
-
status: 'completed'
|
|
214
|
+
status: 'completed',
|
|
209
215
|
};
|
|
210
216
|
|
|
211
217
|
// Apply refactoring to each implementation
|
|
212
218
|
for (const implementation of greenPhase.implementations) {
|
|
213
219
|
const refactoring = this.applyRefactoringTechniques(implementation);
|
|
214
220
|
refactorPhase.refactorings.push(refactoring);
|
|
215
|
-
|
|
221
|
+
|
|
216
222
|
const improvedImplementation = this.generateRefactoredCode(implementation, refactoring);
|
|
217
223
|
refactorPhase.improvedImplementations.push(improvedImplementation);
|
|
218
224
|
}
|
|
@@ -222,13 +228,15 @@ export class SparcRefinement extends SparcPhase {
|
|
|
222
228
|
const newTestResult = {
|
|
223
229
|
...testResult,
|
|
224
230
|
passed: true, // Assume refactoring maintains functionality
|
|
225
|
-
executionTime: testResult.executionTime * (0.8 + Math.random() * 0.4) // Slight performance variation
|
|
231
|
+
executionTime: testResult.executionTime * (0.8 + Math.random() * 0.4), // Slight performance variation
|
|
226
232
|
};
|
|
227
|
-
|
|
233
|
+
|
|
228
234
|
refactorPhase.testResults.push(newTestResult);
|
|
229
235
|
}
|
|
230
236
|
|
|
231
|
-
console.log(
|
|
237
|
+
console.log(
|
|
238
|
+
` 🔵 REFACTOR: Applied ${refactorPhase.refactorings.length} refactoring techniques`,
|
|
239
|
+
);
|
|
232
240
|
return refactorPhase;
|
|
233
241
|
}
|
|
234
242
|
|
|
@@ -238,14 +246,14 @@ export class SparcRefinement extends SparcPhase {
|
|
|
238
246
|
generateTestCases(requirement, architecture) {
|
|
239
247
|
const testCases = [];
|
|
240
248
|
const reqLower = requirement.toLowerCase();
|
|
241
|
-
|
|
249
|
+
|
|
242
250
|
// Happy path test
|
|
243
251
|
testCases.push({
|
|
244
252
|
name: `test_${this.camelCase(requirement)}_success`,
|
|
245
253
|
description: `Test successful execution of ${requirement}`,
|
|
246
254
|
type: 'positive',
|
|
247
255
|
scenario: 'valid input',
|
|
248
|
-
expected: 'success'
|
|
256
|
+
expected: 'success',
|
|
249
257
|
});
|
|
250
258
|
|
|
251
259
|
// Error cases
|
|
@@ -254,7 +262,7 @@ export class SparcRefinement extends SparcPhase {
|
|
|
254
262
|
description: `Test ${requirement} with invalid input`,
|
|
255
263
|
type: 'negative',
|
|
256
264
|
scenario: 'invalid input',
|
|
257
|
-
expected: 'error'
|
|
265
|
+
expected: 'error',
|
|
258
266
|
});
|
|
259
267
|
|
|
260
268
|
// Edge cases
|
|
@@ -264,7 +272,7 @@ export class SparcRefinement extends SparcPhase {
|
|
|
264
272
|
description: `Test ${requirement} with empty data`,
|
|
265
273
|
type: 'edge',
|
|
266
274
|
scenario: 'empty data',
|
|
267
|
-
expected: 'handled gracefully'
|
|
275
|
+
expected: 'handled gracefully',
|
|
268
276
|
});
|
|
269
277
|
}
|
|
270
278
|
|
|
@@ -275,7 +283,7 @@ export class SparcRefinement extends SparcPhase {
|
|
|
275
283
|
description: `Test ${requirement} performance under load`,
|
|
276
284
|
type: 'performance',
|
|
277
285
|
scenario: 'high load',
|
|
278
|
-
expected: 'acceptable response time'
|
|
286
|
+
expected: 'acceptable response time',
|
|
279
287
|
});
|
|
280
288
|
}
|
|
281
289
|
|
|
@@ -287,7 +295,7 @@ export class SparcRefinement extends SparcPhase {
|
|
|
287
295
|
*/
|
|
288
296
|
generateTestCode(testCase) {
|
|
289
297
|
const functionName = this.extractFunctionName(testCase.name);
|
|
290
|
-
|
|
298
|
+
|
|
291
299
|
return `describe('${testCase.description}', () => {
|
|
292
300
|
test('${testCase.name}', async () => {
|
|
293
301
|
// Arrange
|
|
@@ -295,15 +303,19 @@ export class SparcRefinement extends SparcPhase {
|
|
|
295
303
|
const expected = ${this.generateExpectedOutput(testCase)};
|
|
296
304
|
|
|
297
305
|
// Act
|
|
298
|
-
${
|
|
306
|
+
${
|
|
307
|
+
testCase.type === 'negative'
|
|
308
|
+
? `
|
|
299
309
|
const action = () => ${functionName}(input);
|
|
300
310
|
|
|
301
311
|
// Assert
|
|
302
|
-
expect(action).toThrow();`
|
|
312
|
+
expect(action).toThrow();`
|
|
313
|
+
: `
|
|
303
314
|
const result = await ${functionName}(input);
|
|
304
315
|
|
|
305
316
|
// Assert
|
|
306
|
-
expect(result).toEqual(expected);`
|
|
317
|
+
expect(result).toEqual(expected);`
|
|
318
|
+
}
|
|
307
319
|
});
|
|
308
320
|
});`;
|
|
309
321
|
}
|
|
@@ -314,14 +326,14 @@ export class SparcRefinement extends SparcPhase {
|
|
|
314
326
|
generateMinimalImplementation(test, architecture) {
|
|
315
327
|
const functionName = this.extractFunctionName(test.name);
|
|
316
328
|
const component = this.findRelevantComponent(test, architecture);
|
|
317
|
-
|
|
329
|
+
|
|
318
330
|
return {
|
|
319
331
|
name: functionName,
|
|
320
332
|
component: component ? component.name : 'DefaultComponent',
|
|
321
333
|
code: this.generateMinimalCode(test, functionName),
|
|
322
334
|
dependencies: component ? component.dependencies : [],
|
|
323
335
|
complexity: 'low',
|
|
324
|
-
testCoverage: 100
|
|
336
|
+
testCoverage: 100,
|
|
325
337
|
};
|
|
326
338
|
}
|
|
327
339
|
|
|
@@ -330,7 +342,7 @@ export class SparcRefinement extends SparcPhase {
|
|
|
330
342
|
*/
|
|
331
343
|
generateMinimalCode(test, functionName) {
|
|
332
344
|
const testType = test.expected;
|
|
333
|
-
|
|
345
|
+
|
|
334
346
|
if (testType === 'fail' || test.type === 'negative') {
|
|
335
347
|
return `async function ${functionName}(input) {
|
|
336
348
|
// Minimal implementation to make test pass
|
|
@@ -379,13 +391,13 @@ function processInput(input) {
|
|
|
379
391
|
*/
|
|
380
392
|
applyRefactoringTechniques(implementation) {
|
|
381
393
|
const refactorings = [];
|
|
382
|
-
|
|
394
|
+
|
|
383
395
|
// Extract method refactoring
|
|
384
396
|
if (implementation.code.length > 500) {
|
|
385
397
|
refactorings.push({
|
|
386
398
|
technique: 'Extract Method',
|
|
387
399
|
reason: 'Method too long',
|
|
388
|
-
description: 'Break down long method into smaller, focused methods'
|
|
400
|
+
description: 'Break down long method into smaller, focused methods',
|
|
389
401
|
});
|
|
390
402
|
}
|
|
391
403
|
|
|
@@ -393,28 +405,28 @@ function processInput(input) {
|
|
|
393
405
|
refactorings.push({
|
|
394
406
|
technique: 'Extract Variable',
|
|
395
407
|
reason: 'Improve readability',
|
|
396
|
-
description: 'Extract complex expressions into well-named variables'
|
|
408
|
+
description: 'Extract complex expressions into well-named variables',
|
|
397
409
|
});
|
|
398
410
|
|
|
399
411
|
// Remove code duplication
|
|
400
412
|
refactorings.push({
|
|
401
413
|
technique: 'Remove Duplication',
|
|
402
414
|
reason: 'DRY principle',
|
|
403
|
-
description: 'Extract common code into reusable functions'
|
|
415
|
+
description: 'Extract common code into reusable functions',
|
|
404
416
|
});
|
|
405
417
|
|
|
406
418
|
// Improve naming
|
|
407
419
|
refactorings.push({
|
|
408
420
|
technique: 'Rename Variables',
|
|
409
421
|
reason: 'Clarity',
|
|
410
|
-
description: 'Use more descriptive variable and function names'
|
|
422
|
+
description: 'Use more descriptive variable and function names',
|
|
411
423
|
});
|
|
412
424
|
|
|
413
425
|
// Add error handling
|
|
414
426
|
refactorings.push({
|
|
415
427
|
technique: 'Improve Error Handling',
|
|
416
428
|
reason: 'Robustness',
|
|
417
|
-
description: 'Add comprehensive error handling and logging'
|
|
429
|
+
description: 'Add comprehensive error handling and logging',
|
|
418
430
|
});
|
|
419
431
|
|
|
420
432
|
return refactorings;
|
|
@@ -430,7 +442,7 @@ function processInput(input) {
|
|
|
430
442
|
code: this.improveCode(implementation.code, refactoring),
|
|
431
443
|
complexity: this.reduceComplexity(implementation.complexity),
|
|
432
444
|
maintainability: 'improved',
|
|
433
|
-
readability: 'improved'
|
|
445
|
+
readability: 'improved',
|
|
434
446
|
};
|
|
435
447
|
}
|
|
436
448
|
|
|
@@ -467,7 +479,7 @@ const ERROR_MESSAGES = {
|
|
|
467
479
|
*/
|
|
468
480
|
async generateImplementations(architecture) {
|
|
469
481
|
const implementations = [];
|
|
470
|
-
|
|
482
|
+
|
|
471
483
|
for (const component of architecture.components) {
|
|
472
484
|
const implementation = {
|
|
473
485
|
component: component.name,
|
|
@@ -477,7 +489,7 @@ const ERROR_MESSAGES = {
|
|
|
477
489
|
interfaces: component.interfaces,
|
|
478
490
|
patterns: component.patterns,
|
|
479
491
|
size: 0,
|
|
480
|
-
complexity: component.complexity
|
|
492
|
+
complexity: component.complexity,
|
|
481
493
|
};
|
|
482
494
|
|
|
483
495
|
// Generate main implementation file
|
|
@@ -499,7 +511,7 @@ const ERROR_MESSAGES = {
|
|
|
499
511
|
|
|
500
512
|
implementations.push(implementation);
|
|
501
513
|
}
|
|
502
|
-
|
|
514
|
+
|
|
503
515
|
return implementations;
|
|
504
516
|
}
|
|
505
517
|
|
|
@@ -508,8 +520,10 @@ const ERROR_MESSAGES = {
|
|
|
508
520
|
*/
|
|
509
521
|
generateMainImplementationFile(component) {
|
|
510
522
|
const className = component.name;
|
|
511
|
-
const dependencies = component.dependencies
|
|
512
|
-
|
|
523
|
+
const dependencies = component.dependencies
|
|
524
|
+
.map((dep) => `import { ${dep} } from './${dep}';`)
|
|
525
|
+
.join('\n');
|
|
526
|
+
|
|
513
527
|
const code = `${dependencies}
|
|
514
528
|
|
|
515
529
|
/**
|
|
@@ -517,8 +531,8 @@ const ERROR_MESSAGES = {
|
|
|
517
531
|
* Patterns: ${component.patterns.join(', ')}
|
|
518
532
|
*/
|
|
519
533
|
export class ${className} {
|
|
520
|
-
constructor(${component.dependencies.map(dep => dep.toLowerCase()).join(', ')}) {
|
|
521
|
-
${component.dependencies.map(dep => `this.${dep.toLowerCase()} = ${dep.toLowerCase()};`).join('\n ')}
|
|
534
|
+
constructor(${component.dependencies.map((dep) => dep.toLowerCase()).join(', ')}) {
|
|
535
|
+
${component.dependencies.map((dep) => `this.${dep.toLowerCase()} = ${dep.toLowerCase()};`).join('\n ')}
|
|
522
536
|
this.initialized = false;
|
|
523
537
|
this.startTime = Date.now();
|
|
524
538
|
}
|
|
@@ -529,7 +543,7 @@ export class ${className} {
|
|
|
529
543
|
}
|
|
530
544
|
|
|
531
545
|
// Initialize dependencies
|
|
532
|
-
${component.dependencies.map(dep => `await this.${dep.toLowerCase()}.initialize();`).join('\n ')}
|
|
546
|
+
${component.dependencies.map((dep) => `await this.${dep.toLowerCase()}.initialize();`).join('\n ')}
|
|
533
547
|
|
|
534
548
|
this.initialized = true;
|
|
535
549
|
console.log('${className} initialized successfully');
|
|
@@ -577,7 +591,7 @@ export class ${className} {
|
|
|
577
591
|
|
|
578
592
|
async cleanup() {
|
|
579
593
|
// Cleanup resources
|
|
580
|
-
${component.dependencies.map(dep => `await this.${dep.toLowerCase()}.cleanup();`).join('\n ')}
|
|
594
|
+
${component.dependencies.map((dep) => `await this.${dep.toLowerCase()}.cleanup();`).join('\n ')}
|
|
581
595
|
|
|
582
596
|
this.initialized = false;
|
|
583
597
|
console.log('${className} cleanup completed');
|
|
@@ -588,7 +602,7 @@ export class ${className} {
|
|
|
588
602
|
component: '${className}',
|
|
589
603
|
initialized: this.initialized,
|
|
590
604
|
uptime: Date.now() - this.startTime,
|
|
591
|
-
dependencies: [${component.dependencies.map(dep => `'${dep}'`).join(', ')}]
|
|
605
|
+
dependencies: [${component.dependencies.map((dep) => `'${dep}'`).join(', ')}]
|
|
592
606
|
};
|
|
593
607
|
}
|
|
594
608
|
}
|
|
@@ -601,7 +615,7 @@ export default ${className};`;
|
|
|
601
615
|
type: 'implementation',
|
|
602
616
|
size: code.length,
|
|
603
617
|
lines: code.split('\n').length,
|
|
604
|
-
code: code
|
|
618
|
+
code: code,
|
|
605
619
|
};
|
|
606
620
|
}
|
|
607
621
|
|
|
@@ -610,26 +624,26 @@ export default ${className};`;
|
|
|
610
624
|
*/
|
|
611
625
|
generateComponentValidation(component) {
|
|
612
626
|
const compType = component.type.toLowerCase();
|
|
613
|
-
|
|
627
|
+
|
|
614
628
|
switch (compType) {
|
|
615
629
|
case 'controller':
|
|
616
630
|
return `// Validate HTTP request structure
|
|
617
631
|
if (!input.method || !input.path) {
|
|
618
632
|
throw new Error('HTTP method and path required');
|
|
619
633
|
}`;
|
|
620
|
-
|
|
634
|
+
|
|
621
635
|
case 'service':
|
|
622
636
|
return `// Validate service input
|
|
623
637
|
if (!input.data) {
|
|
624
638
|
throw new Error('Service data required');
|
|
625
639
|
}`;
|
|
626
|
-
|
|
640
|
+
|
|
627
641
|
case 'repository':
|
|
628
642
|
return `// Validate data operations
|
|
629
643
|
if (!input.operation || !input.entity) {
|
|
630
644
|
throw new Error('Operation and entity required');
|
|
631
645
|
}`;
|
|
632
|
-
|
|
646
|
+
|
|
633
647
|
default:
|
|
634
648
|
return `// Generic validation
|
|
635
649
|
if (Object.keys(input).length === 0) {
|
|
@@ -643,7 +657,7 @@ export default ${className};`;
|
|
|
643
657
|
*/
|
|
644
658
|
generateComponentLogic(component) {
|
|
645
659
|
const compType = component.type.toLowerCase();
|
|
646
|
-
|
|
660
|
+
|
|
647
661
|
switch (compType) {
|
|
648
662
|
case 'controller':
|
|
649
663
|
return `// Handle HTTP request
|
|
@@ -658,7 +672,7 @@ export default ${className};`;
|
|
|
658
672
|
data: result,
|
|
659
673
|
timestamp: new Date().toISOString()
|
|
660
674
|
};`;
|
|
661
|
-
|
|
675
|
+
|
|
662
676
|
case 'service':
|
|
663
677
|
return `// Process business logic
|
|
664
678
|
const { data, operation } = input;
|
|
@@ -674,7 +688,7 @@ export default ${className};`;
|
|
|
674
688
|
result: result,
|
|
675
689
|
operation: operation
|
|
676
690
|
};`;
|
|
677
|
-
|
|
691
|
+
|
|
678
692
|
case 'repository':
|
|
679
693
|
return `// Handle data operations
|
|
680
694
|
const { operation, entity, data } = input;
|
|
@@ -691,7 +705,7 @@ export default ${className};`;
|
|
|
691
705
|
default:
|
|
692
706
|
throw new Error(\`Unknown operation: \${operation}\`);
|
|
693
707
|
}`;
|
|
694
|
-
|
|
708
|
+
|
|
695
709
|
default:
|
|
696
710
|
return `// Generic processing
|
|
697
711
|
const processedInput = await this.preProcess(input);
|
|
@@ -707,20 +721,20 @@ export default ${className};`;
|
|
|
707
721
|
*/
|
|
708
722
|
generateTestFile(component) {
|
|
709
723
|
const className = component.name;
|
|
710
|
-
|
|
724
|
+
|
|
711
725
|
const code = `import { ${className} } from '../${component.type}/${className}';
|
|
712
|
-
${component.dependencies.map(dep => `import { Mock${dep} } from '../mocks/Mock${dep}';`).join('\n')}
|
|
726
|
+
${component.dependencies.map((dep) => `import { Mock${dep} } from '../mocks/Mock${dep}';`).join('\n')}
|
|
713
727
|
|
|
714
728
|
describe('${className}', () => {
|
|
715
729
|
let ${className.toLowerCase()};
|
|
716
|
-
${component.dependencies.map(dep => `let mock${dep};`).join('\n ')}
|
|
730
|
+
${component.dependencies.map((dep) => `let mock${dep};`).join('\n ')}
|
|
717
731
|
|
|
718
732
|
beforeEach(async () => {
|
|
719
733
|
// Setup mocks
|
|
720
|
-
${component.dependencies.map(dep => `mock${dep} = new Mock${dep}();`).join('\n ')}
|
|
734
|
+
${component.dependencies.map((dep) => `mock${dep} = new Mock${dep}();`).join('\n ')}
|
|
721
735
|
|
|
722
736
|
// Create instance
|
|
723
|
-
${className.toLowerCase()} = new ${className}(${component.dependencies.map(dep => `mock${dep}`).join(', ')});
|
|
737
|
+
${className.toLowerCase()} = new ${className}(${component.dependencies.map((dep) => `mock${dep}`).join(', ')});
|
|
724
738
|
|
|
725
739
|
// Initialize
|
|
726
740
|
await ${className.toLowerCase()}.initialize();
|
|
@@ -756,7 +770,7 @@ describe('${className}', () => {
|
|
|
756
770
|
});
|
|
757
771
|
|
|
758
772
|
test('should throw error when not initialized', async () => {
|
|
759
|
-
const uninitializedInstance = new ${className}(${component.dependencies.map(dep => `mock${dep}`).join(', ')});
|
|
773
|
+
const uninitializedInstance = new ${className}(${component.dependencies.map((dep) => `mock${dep}`).join(', ')});
|
|
760
774
|
const input = ${this.generateValidTestInput(component)};
|
|
761
775
|
|
|
762
776
|
await expect(uninitializedInstance.execute(input)).rejects.toThrow();
|
|
@@ -794,7 +808,7 @@ describe('${className}', () => {
|
|
|
794
808
|
type: 'test',
|
|
795
809
|
size: code.length,
|
|
796
810
|
lines: code.split('\n').length,
|
|
797
|
-
code: code
|
|
811
|
+
code: code,
|
|
798
812
|
};
|
|
799
813
|
}
|
|
800
814
|
|
|
@@ -803,7 +817,7 @@ describe('${className}', () => {
|
|
|
803
817
|
*/
|
|
804
818
|
generateValidTestInput(component) {
|
|
805
819
|
const compType = component.type.toLowerCase();
|
|
806
|
-
|
|
820
|
+
|
|
807
821
|
switch (compType) {
|
|
808
822
|
case 'controller':
|
|
809
823
|
return `{
|
|
@@ -812,20 +826,20 @@ describe('${className}', () => {
|
|
|
812
826
|
body: {},
|
|
813
827
|
query: {}
|
|
814
828
|
}`;
|
|
815
|
-
|
|
829
|
+
|
|
816
830
|
case 'service':
|
|
817
831
|
return `{
|
|
818
832
|
data: { id: 1, name: 'test' },
|
|
819
833
|
operation: 'process'
|
|
820
834
|
}`;
|
|
821
|
-
|
|
835
|
+
|
|
822
836
|
case 'repository':
|
|
823
837
|
return `{
|
|
824
838
|
operation: 'read',
|
|
825
839
|
entity: 'User',
|
|
826
840
|
data: { id: 1 }
|
|
827
841
|
}`;
|
|
828
|
-
|
|
842
|
+
|
|
829
843
|
default:
|
|
830
844
|
return `{
|
|
831
845
|
id: 1,
|
|
@@ -847,7 +861,7 @@ describe('${className}', () => {
|
|
|
847
861
|
*/
|
|
848
862
|
generateInterfaceFile(component) {
|
|
849
863
|
const interfaceName = component.interfaces[0];
|
|
850
|
-
|
|
864
|
+
|
|
851
865
|
const code = `/**
|
|
852
866
|
* ${interfaceName} - Interface for ${component.name}
|
|
853
867
|
*/
|
|
@@ -896,7 +910,7 @@ export default ${interfaceName};`;
|
|
|
896
910
|
type: 'interface',
|
|
897
911
|
size: code.length,
|
|
898
912
|
lines: code.split('\n').length,
|
|
899
|
-
code: code
|
|
913
|
+
code: code,
|
|
900
914
|
};
|
|
901
915
|
}
|
|
902
916
|
|
|
@@ -911,7 +925,7 @@ export default ${interfaceName};`;
|
|
|
911
925
|
skipped: 0,
|
|
912
926
|
coverage: 0,
|
|
913
927
|
duration: 0,
|
|
914
|
-
suites: []
|
|
928
|
+
suites: [],
|
|
915
929
|
};
|
|
916
930
|
|
|
917
931
|
for (const cycle of tddCycles) {
|
|
@@ -919,10 +933,10 @@ export default ${interfaceName};`;
|
|
|
919
933
|
const suiteResult = {
|
|
920
934
|
name: cycle.requirement,
|
|
921
935
|
tests: cycle.refactorPhase.testResults.length,
|
|
922
|
-
passed: cycle.refactorPhase.testResults.filter(t => t.passed).length,
|
|
923
|
-
failed: cycle.refactorPhase.testResults.filter(t => !t.passed).length,
|
|
936
|
+
passed: cycle.refactorPhase.testResults.filter((t) => t.passed).length,
|
|
937
|
+
failed: cycle.refactorPhase.testResults.filter((t) => !t.passed).length,
|
|
924
938
|
duration: cycle.duration,
|
|
925
|
-
coverage: 95 + Math.random() * 5 // 95-100% coverage
|
|
939
|
+
coverage: 95 + Math.random() * 5, // 95-100% coverage
|
|
926
940
|
};
|
|
927
941
|
|
|
928
942
|
testResults.suites.push(suiteResult);
|
|
@@ -932,7 +946,8 @@ export default ${interfaceName};`;
|
|
|
932
946
|
}
|
|
933
947
|
}
|
|
934
948
|
|
|
935
|
-
testResults.coverage =
|
|
949
|
+
testResults.coverage =
|
|
950
|
+
testResults.total > 0 ? (testResults.passed / testResults.total) * 100 : 0;
|
|
936
951
|
testResults.duration = tddCycles.reduce((total, cycle) => total + cycle.duration, 0);
|
|
937
952
|
|
|
938
953
|
return testResults;
|
|
@@ -950,7 +965,7 @@ export default ${interfaceName};`;
|
|
|
950
965
|
duplication: 0,
|
|
951
966
|
testCoverage: 0,
|
|
952
967
|
violations: [],
|
|
953
|
-
metrics: {}
|
|
968
|
+
metrics: {},
|
|
954
969
|
};
|
|
955
970
|
|
|
956
971
|
let totalSize = 0;
|
|
@@ -975,25 +990,37 @@ export default ${interfaceName};`;
|
|
|
975
990
|
averageFileSize: totalFiles > 0 ? totalSize / totalFiles : 0,
|
|
976
991
|
averageComplexity: implementations.length > 0 ? totalComplexity / implementations.length : 0,
|
|
977
992
|
totalFiles: totalFiles,
|
|
978
|
-
totalLines: implementations.reduce(
|
|
979
|
-
total + impl.files.reduce((fileTotal, file) => fileTotal + file.lines, 0),
|
|
993
|
+
totalLines: implementations.reduce(
|
|
994
|
+
(total, impl) => total + impl.files.reduce((fileTotal, file) => fileTotal + file.lines, 0),
|
|
995
|
+
0,
|
|
980
996
|
),
|
|
981
|
-
implementationFiles: implementations.reduce(
|
|
982
|
-
total + impl.files.filter(f => f.type === 'implementation').length,
|
|
997
|
+
implementationFiles: implementations.reduce(
|
|
998
|
+
(total, impl) => total + impl.files.filter((f) => f.type === 'implementation').length,
|
|
999
|
+
0,
|
|
1000
|
+
),
|
|
1001
|
+
testFiles: implementations.reduce(
|
|
1002
|
+
(total, impl) => total + impl.files.filter((f) => f.type === 'test').length,
|
|
1003
|
+
0,
|
|
983
1004
|
),
|
|
984
|
-
testFiles: implementations.reduce((total, impl) =>
|
|
985
|
-
total + impl.files.filter(f => f.type === 'test').length, 0
|
|
986
|
-
)
|
|
987
1005
|
};
|
|
988
1006
|
|
|
989
1007
|
// Calculate quality scores
|
|
990
|
-
quality.complexity = Math.max(0, 100 -
|
|
991
|
-
quality.maintainability = Math.max(0, 100 -
|
|
992
|
-
quality.readability = Math.max(0, 100 -
|
|
1008
|
+
quality.complexity = Math.max(0, 100 - quality.metrics.averageComplexity * 10);
|
|
1009
|
+
quality.maintainability = Math.max(0, 100 - quality.violations.length * 5);
|
|
1010
|
+
quality.readability = Math.max(0, 100 - quality.metrics.averageFileSize / 20);
|
|
993
1011
|
quality.testCoverage = 95; // High coverage from TDD
|
|
994
|
-
quality.duplication = Math.max(
|
|
1012
|
+
quality.duplication = Math.max(
|
|
1013
|
+
0,
|
|
1014
|
+
100 - quality.violations.filter((v) => v.type === 'duplication').length * 10,
|
|
1015
|
+
);
|
|
995
1016
|
|
|
996
|
-
quality.overall =
|
|
1017
|
+
quality.overall =
|
|
1018
|
+
(quality.maintainability +
|
|
1019
|
+
quality.readability +
|
|
1020
|
+
quality.complexity +
|
|
1021
|
+
quality.testCoverage +
|
|
1022
|
+
quality.duplication) /
|
|
1023
|
+
5;
|
|
997
1024
|
|
|
998
1025
|
return quality;
|
|
999
1026
|
}
|
|
@@ -1019,7 +1046,7 @@ export default ${interfaceName};`;
|
|
|
1019
1046
|
type: 'file_size',
|
|
1020
1047
|
severity: 'warning',
|
|
1021
1048
|
message: `File ${file.name} has ${file.lines} lines (>500)`,
|
|
1022
|
-
file: file.name
|
|
1049
|
+
file: file.name,
|
|
1023
1050
|
});
|
|
1024
1051
|
}
|
|
1025
1052
|
}
|
|
@@ -1030,7 +1057,7 @@ export default ${interfaceName};`;
|
|
|
1030
1057
|
type: 'complexity',
|
|
1031
1058
|
severity: 'warning',
|
|
1032
1059
|
message: `Component ${implementation.component} has high complexity`,
|
|
1033
|
-
component: implementation.component
|
|
1060
|
+
component: implementation.component,
|
|
1034
1061
|
});
|
|
1035
1062
|
}
|
|
1036
1063
|
|
|
@@ -1040,7 +1067,7 @@ export default ${interfaceName};`;
|
|
|
1040
1067
|
type: 'dependencies',
|
|
1041
1068
|
severity: 'info',
|
|
1042
1069
|
message: `Component ${implementation.component} has ${implementation.dependencies.length} dependencies`,
|
|
1043
|
-
component: implementation.component
|
|
1070
|
+
component: implementation.component,
|
|
1044
1071
|
});
|
|
1045
1072
|
}
|
|
1046
1073
|
|
|
@@ -1060,7 +1087,7 @@ export default ${interfaceName};`;
|
|
|
1060
1087
|
description: 'Apply caching to frequently accessed data',
|
|
1061
1088
|
impact: 'Reduce response time by 30-50%',
|
|
1062
1089
|
effort: 'medium',
|
|
1063
|
-
implementation: 'Add Redis caching layer'
|
|
1090
|
+
implementation: 'Add Redis caching layer',
|
|
1064
1091
|
});
|
|
1065
1092
|
}
|
|
1066
1093
|
|
|
@@ -1070,7 +1097,7 @@ export default ${interfaceName};`;
|
|
|
1070
1097
|
description: 'Implement object pooling for heavy objects',
|
|
1071
1098
|
impact: 'Reduce memory allocation overhead',
|
|
1072
1099
|
effort: 'low',
|
|
1073
|
-
implementation: 'Use object pools for database connections'
|
|
1100
|
+
implementation: 'Use object pools for database connections',
|
|
1074
1101
|
});
|
|
1075
1102
|
|
|
1076
1103
|
// Database optimizations
|
|
@@ -1079,7 +1106,7 @@ export default ${interfaceName};`;
|
|
|
1079
1106
|
description: 'Add database query optimization',
|
|
1080
1107
|
impact: 'Reduce database load by 40%',
|
|
1081
1108
|
effort: 'medium',
|
|
1082
|
-
implementation: 'Add indexes and query optimization'
|
|
1109
|
+
implementation: 'Add indexes and query optimization',
|
|
1083
1110
|
});
|
|
1084
1111
|
|
|
1085
1112
|
// Code structure optimizations
|
|
@@ -1089,7 +1116,7 @@ export default ${interfaceName};`;
|
|
|
1089
1116
|
description: 'Refactor complex components',
|
|
1090
1117
|
impact: 'Improve maintainability',
|
|
1091
1118
|
effort: 'high',
|
|
1092
|
-
implementation: 'Break down large classes into smaller ones'
|
|
1119
|
+
implementation: 'Break down large classes into smaller ones',
|
|
1093
1120
|
});
|
|
1094
1121
|
}
|
|
1095
1122
|
|
|
@@ -1105,39 +1132,39 @@ export default ${interfaceName};`;
|
|
|
1105
1132
|
average: 150,
|
|
1106
1133
|
p95: 200,
|
|
1107
1134
|
p99: 350,
|
|
1108
|
-
max: 500
|
|
1135
|
+
max: 500,
|
|
1109
1136
|
},
|
|
1110
1137
|
throughput: {
|
|
1111
1138
|
requestsPerSecond: 1000,
|
|
1112
1139
|
concurrent: 100,
|
|
1113
|
-
peak: 1500
|
|
1140
|
+
peak: 1500,
|
|
1114
1141
|
},
|
|
1115
1142
|
resource: {
|
|
1116
1143
|
cpuUsage: 45,
|
|
1117
1144
|
memoryUsage: 60,
|
|
1118
1145
|
diskIO: 20,
|
|
1119
|
-
networkIO: 30
|
|
1146
|
+
networkIO: 30,
|
|
1120
1147
|
},
|
|
1121
1148
|
bottlenecks: [
|
|
1122
1149
|
{
|
|
1123
1150
|
component: 'Database queries',
|
|
1124
1151
|
impact: 'High',
|
|
1125
1152
|
description: 'Complex queries taking 100-200ms',
|
|
1126
|
-
recommendation: 'Add indexes and query optimization'
|
|
1153
|
+
recommendation: 'Add indexes and query optimization',
|
|
1127
1154
|
},
|
|
1128
1155
|
{
|
|
1129
1156
|
component: 'External API calls',
|
|
1130
1157
|
impact: 'Medium',
|
|
1131
1158
|
description: 'Third-party API latency 50-100ms',
|
|
1132
|
-
recommendation: 'Implement caching and connection pooling'
|
|
1133
|
-
}
|
|
1159
|
+
recommendation: 'Implement caching and connection pooling',
|
|
1160
|
+
},
|
|
1134
1161
|
],
|
|
1135
1162
|
recommendations: [
|
|
1136
1163
|
'Implement caching for frequently accessed data',
|
|
1137
1164
|
'Optimize database queries with proper indexing',
|
|
1138
1165
|
'Use connection pooling for external services',
|
|
1139
|
-
'Implement async processing for non-critical operations'
|
|
1140
|
-
]
|
|
1166
|
+
'Implement async processing for non-critical operations',
|
|
1167
|
+
],
|
|
1141
1168
|
};
|
|
1142
1169
|
|
|
1143
1170
|
return performance;
|
|
@@ -1155,8 +1182,8 @@ export default ${interfaceName};`;
|
|
|
1155
1182
|
compliance: {
|
|
1156
1183
|
owasp: 'Partial',
|
|
1157
1184
|
gdpr: 'Compliant',
|
|
1158
|
-
iso27001: 'Partial'
|
|
1159
|
-
}
|
|
1185
|
+
iso27001: 'Partial',
|
|
1186
|
+
},
|
|
1160
1187
|
};
|
|
1161
1188
|
|
|
1162
1189
|
// Check for common vulnerabilities
|
|
@@ -1166,15 +1193,15 @@ export default ${interfaceName};`;
|
|
|
1166
1193
|
severity: 'Medium',
|
|
1167
1194
|
description: 'Some inputs not fully validated',
|
|
1168
1195
|
location: 'API endpoints',
|
|
1169
|
-
remediation: 'Implement comprehensive input validation'
|
|
1196
|
+
remediation: 'Implement comprehensive input validation',
|
|
1170
1197
|
},
|
|
1171
1198
|
{
|
|
1172
1199
|
type: 'Error Handling',
|
|
1173
1200
|
severity: 'Low',
|
|
1174
1201
|
description: 'Error messages may leak sensitive information',
|
|
1175
1202
|
location: 'Error handlers',
|
|
1176
|
-
remediation: 'Sanitize error messages in production'
|
|
1177
|
-
}
|
|
1203
|
+
remediation: 'Sanitize error messages in production',
|
|
1204
|
+
},
|
|
1178
1205
|
];
|
|
1179
1206
|
|
|
1180
1207
|
// Security recommendations
|
|
@@ -1184,7 +1211,7 @@ export default ${interfaceName};`;
|
|
|
1184
1211
|
'Use parameterized queries to prevent SQL injection',
|
|
1185
1212
|
'Implement proper session management',
|
|
1186
1213
|
'Add security headers (HSTS, CSP, etc.)',
|
|
1187
|
-
'Regular security audits and penetration testing'
|
|
1214
|
+
'Regular security audits and penetration testing',
|
|
1188
1215
|
];
|
|
1189
1216
|
|
|
1190
1217
|
return security;
|
|
@@ -1199,21 +1226,23 @@ export default ${interfaceName};`;
|
|
|
1199
1226
|
components: [],
|
|
1200
1227
|
deployment: null,
|
|
1201
1228
|
userGuide: null,
|
|
1202
|
-
developerGuide: null
|
|
1229
|
+
developerGuide: null,
|
|
1203
1230
|
};
|
|
1204
1231
|
|
|
1205
1232
|
// Generate API documentation
|
|
1206
1233
|
documentation.api = this.generateApiDocumentation(implementations);
|
|
1207
|
-
|
|
1234
|
+
|
|
1208
1235
|
// Generate component documentation
|
|
1209
|
-
documentation.components = implementations.map(impl =>
|
|
1210
|
-
|
|
1236
|
+
documentation.components = implementations.map((impl) =>
|
|
1237
|
+
this.generateComponentDocumentation(impl),
|
|
1238
|
+
);
|
|
1239
|
+
|
|
1211
1240
|
// Generate deployment documentation
|
|
1212
1241
|
documentation.deployment = this.generateDeploymentDocumentation();
|
|
1213
|
-
|
|
1242
|
+
|
|
1214
1243
|
// Generate user guide
|
|
1215
1244
|
documentation.userGuide = this.generateUserGuide();
|
|
1216
|
-
|
|
1245
|
+
|
|
1217
1246
|
// Generate developer guide
|
|
1218
1247
|
documentation.developerGuide = this.generateDeveloperGuide();
|
|
1219
1248
|
|
|
@@ -1230,13 +1259,13 @@ export default ${interfaceName};`;
|
|
|
1230
1259
|
description: 'RESTful API for the application',
|
|
1231
1260
|
baseUrl: '/api/v1',
|
|
1232
1261
|
endpoints: implementations
|
|
1233
|
-
.filter(impl => impl.type === 'controller')
|
|
1234
|
-
.map(impl => ({
|
|
1262
|
+
.filter((impl) => impl.type === 'controller')
|
|
1263
|
+
.map((impl) => ({
|
|
1235
1264
|
path: `/api/${impl.component.toLowerCase()}`,
|
|
1236
1265
|
methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
1237
1266
|
description: `${impl.component} operations`,
|
|
1238
|
-
authentication: 'Bearer token required'
|
|
1239
|
-
}))
|
|
1267
|
+
authentication: 'Bearer token required',
|
|
1268
|
+
})),
|
|
1240
1269
|
};
|
|
1241
1270
|
}
|
|
1242
1271
|
|
|
@@ -1248,15 +1277,15 @@ export default ${interfaceName};`;
|
|
|
1248
1277
|
name: implementation.component,
|
|
1249
1278
|
type: implementation.type,
|
|
1250
1279
|
description: `${implementation.component} component documentation`,
|
|
1251
|
-
files: implementation.files.map(file => ({
|
|
1280
|
+
files: implementation.files.map((file) => ({
|
|
1252
1281
|
name: file.name,
|
|
1253
1282
|
path: file.path,
|
|
1254
1283
|
type: file.type,
|
|
1255
|
-
lines: file.lines
|
|
1284
|
+
lines: file.lines,
|
|
1256
1285
|
})),
|
|
1257
1286
|
dependencies: implementation.dependencies,
|
|
1258
1287
|
interfaces: implementation.interfaces,
|
|
1259
|
-
usage: `Import and use ${implementation.component} for ${implementation.type} operations
|
|
1288
|
+
usage: `Import and use ${implementation.component} for ${implementation.type} operations`,
|
|
1260
1289
|
};
|
|
1261
1290
|
}
|
|
1262
1291
|
|
|
@@ -1270,17 +1299,17 @@ export default ${interfaceName};`;
|
|
|
1270
1299
|
'Node.js 18+ installed',
|
|
1271
1300
|
'npm or yarn package manager',
|
|
1272
1301
|
'Database server configured',
|
|
1273
|
-
'Environment variables set'
|
|
1302
|
+
'Environment variables set',
|
|
1274
1303
|
],
|
|
1275
1304
|
steps: [
|
|
1276
1305
|
'Clone the repository',
|
|
1277
1306
|
'Install dependencies: npm install',
|
|
1278
1307
|
'Configure environment variables',
|
|
1279
1308
|
'Run database migrations',
|
|
1280
|
-
'Start the application: npm start'
|
|
1309
|
+
'Start the application: npm start',
|
|
1281
1310
|
],
|
|
1282
1311
|
environments: ['development', 'staging', 'production'],
|
|
1283
|
-
monitoring: 'Use provided health check endpoints'
|
|
1312
|
+
monitoring: 'Use provided health check endpoints',
|
|
1284
1313
|
};
|
|
1285
1314
|
}
|
|
1286
1315
|
|
|
@@ -1295,9 +1324,9 @@ export default ${interfaceName};`;
|
|
|
1295
1324
|
'Basic Operations',
|
|
1296
1325
|
'Advanced Features',
|
|
1297
1326
|
'Troubleshooting',
|
|
1298
|
-
'FAQ'
|
|
1327
|
+
'FAQ',
|
|
1299
1328
|
],
|
|
1300
|
-
description: 'Comprehensive guide for end users'
|
|
1329
|
+
description: 'Comprehensive guide for end users',
|
|
1301
1330
|
};
|
|
1302
1331
|
}
|
|
1303
1332
|
|
|
@@ -1312,9 +1341,9 @@ export default ${interfaceName};`;
|
|
|
1312
1341
|
'Development Setup',
|
|
1313
1342
|
'Code Standards',
|
|
1314
1343
|
'Testing Guidelines',
|
|
1315
|
-
'Contribution Process'
|
|
1344
|
+
'Contribution Process',
|
|
1316
1345
|
],
|
|
1317
|
-
description: 'Guide for developers contributing to the project'
|
|
1346
|
+
description: 'Guide for developers contributing to the project',
|
|
1318
1347
|
};
|
|
1319
1348
|
}
|
|
1320
1349
|
|
|
@@ -1326,7 +1355,7 @@ export default ${interfaceName};`;
|
|
|
1326
1355
|
techniques: [],
|
|
1327
1356
|
improvements: [],
|
|
1328
1357
|
before: codeQuality,
|
|
1329
|
-
after: null
|
|
1358
|
+
after: null,
|
|
1330
1359
|
};
|
|
1331
1360
|
|
|
1332
1361
|
// Apply refactoring techniques based on quality issues
|
|
@@ -1334,7 +1363,7 @@ export default ${interfaceName};`;
|
|
|
1334
1363
|
refactoring.techniques.push({
|
|
1335
1364
|
name: 'Extract Method',
|
|
1336
1365
|
description: 'Break down complex methods into smaller ones',
|
|
1337
|
-
impact: 'Improved readability and testability'
|
|
1366
|
+
impact: 'Improved readability and testability',
|
|
1338
1367
|
});
|
|
1339
1368
|
}
|
|
1340
1369
|
|
|
@@ -1342,7 +1371,7 @@ export default ${interfaceName};`;
|
|
|
1342
1371
|
refactoring.techniques.push({
|
|
1343
1372
|
name: 'Extract Common Code',
|
|
1344
1373
|
description: 'Remove code duplication by extracting common functionality',
|
|
1345
|
-
impact: 'Better maintainability and consistency'
|
|
1374
|
+
impact: 'Better maintainability and consistency',
|
|
1346
1375
|
});
|
|
1347
1376
|
}
|
|
1348
1377
|
|
|
@@ -1350,7 +1379,7 @@ export default ${interfaceName};`;
|
|
|
1350
1379
|
refactoring.techniques.push({
|
|
1351
1380
|
name: 'Improve Naming',
|
|
1352
1381
|
description: 'Use more descriptive variable and method names',
|
|
1353
|
-
impact: 'Better code understanding'
|
|
1382
|
+
impact: 'Better code understanding',
|
|
1354
1383
|
});
|
|
1355
1384
|
}
|
|
1356
1385
|
|
|
@@ -1360,7 +1389,7 @@ export default ${interfaceName};`;
|
|
|
1360
1389
|
'Eliminated code duplication',
|
|
1361
1390
|
'Improved variable naming consistency',
|
|
1362
1391
|
'Enhanced error handling',
|
|
1363
|
-
'Added comprehensive logging'
|
|
1392
|
+
'Added comprehensive logging',
|
|
1364
1393
|
];
|
|
1365
1394
|
|
|
1366
1395
|
// Simulate improved quality after refactoring
|
|
@@ -1370,16 +1399,16 @@ export default ${interfaceName};`;
|
|
|
1370
1399
|
maintainability: Math.min(100, codeQuality.maintainability + 20),
|
|
1371
1400
|
readability: Math.min(100, codeQuality.readability + 10),
|
|
1372
1401
|
duplication: Math.min(100, codeQuality.duplication + 25),
|
|
1373
|
-
overall: 0
|
|
1402
|
+
overall: 0,
|
|
1374
1403
|
};
|
|
1375
|
-
|
|
1376
|
-
refactoring.after.overall =
|
|
1377
|
-
refactoring.after.complexity +
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1404
|
+
|
|
1405
|
+
refactoring.after.overall =
|
|
1406
|
+
(refactoring.after.complexity +
|
|
1407
|
+
refactoring.after.maintainability +
|
|
1408
|
+
refactoring.after.readability +
|
|
1409
|
+
refactoring.after.testCoverage +
|
|
1410
|
+
refactoring.after.duplication) /
|
|
1411
|
+
5;
|
|
1383
1412
|
|
|
1384
1413
|
return refactoring;
|
|
1385
1414
|
}
|
|
@@ -1393,7 +1422,7 @@ export default ${interfaceName};`;
|
|
|
1393
1422
|
score: 0,
|
|
1394
1423
|
checks: [],
|
|
1395
1424
|
issues: [],
|
|
1396
|
-
recommendations: []
|
|
1425
|
+
recommendations: [],
|
|
1397
1426
|
};
|
|
1398
1427
|
|
|
1399
1428
|
// Check test coverage
|
|
@@ -1402,7 +1431,7 @@ export default ${interfaceName};`;
|
|
|
1402
1431
|
passed: result.testResults.coverage >= 80,
|
|
1403
1432
|
score: result.testResults.coverage,
|
|
1404
1433
|
threshold: 80,
|
|
1405
|
-
message: `Test coverage: ${result.testResults.coverage.toFixed(1)}
|
|
1434
|
+
message: `Test coverage: ${result.testResults.coverage.toFixed(1)}%`,
|
|
1406
1435
|
};
|
|
1407
1436
|
validation.checks.push(testCoverageCheck);
|
|
1408
1437
|
|
|
@@ -1412,7 +1441,7 @@ export default ${interfaceName};`;
|
|
|
1412
1441
|
passed: result.codeQuality.overall >= 75,
|
|
1413
1442
|
score: result.codeQuality.overall,
|
|
1414
1443
|
threshold: 75,
|
|
1415
|
-
message: `Code quality score: ${result.codeQuality.overall.toFixed(1)}/100
|
|
1444
|
+
message: `Code quality score: ${result.codeQuality.overall.toFixed(1)}/100`,
|
|
1416
1445
|
};
|
|
1417
1446
|
validation.checks.push(codeQualityCheck);
|
|
1418
1447
|
|
|
@@ -1422,7 +1451,7 @@ export default ${interfaceName};`;
|
|
|
1422
1451
|
passed: result.performance.responseTime.average < 200,
|
|
1423
1452
|
score: 200 - result.performance.responseTime.average,
|
|
1424
1453
|
threshold: 200,
|
|
1425
|
-
message: `Average response time: ${result.performance.responseTime.average}ms
|
|
1454
|
+
message: `Average response time: ${result.performance.responseTime.average}ms`,
|
|
1426
1455
|
};
|
|
1427
1456
|
validation.checks.push(performanceCheck);
|
|
1428
1457
|
|
|
@@ -1432,7 +1461,7 @@ export default ${interfaceName};`;
|
|
|
1432
1461
|
passed: result.security.score >= 80,
|
|
1433
1462
|
score: result.security.score,
|
|
1434
1463
|
threshold: 80,
|
|
1435
|
-
message: `Security score: ${result.security.score}/100
|
|
1464
|
+
message: `Security score: ${result.security.score}/100`,
|
|
1436
1465
|
};
|
|
1437
1466
|
validation.checks.push(securityCheck);
|
|
1438
1467
|
|
|
@@ -1442,21 +1471,21 @@ export default ${interfaceName};`;
|
|
|
1442
1471
|
passed: result.documentation.components.length > 0,
|
|
1443
1472
|
score: result.documentation.components.length > 0 ? 100 : 0,
|
|
1444
1473
|
threshold: 1,
|
|
1445
|
-
message: `Documentation: ${result.documentation.components.length} components documented
|
|
1474
|
+
message: `Documentation: ${result.documentation.components.length} components documented`,
|
|
1446
1475
|
};
|
|
1447
1476
|
validation.checks.push(documentationCheck);
|
|
1448
1477
|
|
|
1449
1478
|
// Calculate overall score
|
|
1450
1479
|
validation.score = validation.checks.reduce((sum, check) => sum + (check.passed ? 20 : 0), 0);
|
|
1451
|
-
validation.passed = validation.checks.every(check => check.passed);
|
|
1480
|
+
validation.passed = validation.checks.every((check) => check.passed);
|
|
1452
1481
|
|
|
1453
1482
|
// Collect issues
|
|
1454
1483
|
validation.issues = validation.checks
|
|
1455
|
-
.filter(check => !check.passed)
|
|
1456
|
-
.map(check => ({
|
|
1484
|
+
.filter((check) => !check.passed)
|
|
1485
|
+
.map((check) => ({
|
|
1457
1486
|
category: check.name,
|
|
1458
1487
|
severity: 'warning',
|
|
1459
|
-
message: `${check.name} below threshold: ${check.score} < ${check.threshold}
|
|
1488
|
+
message: `${check.name} below threshold: ${check.score} < ${check.threshold}`,
|
|
1460
1489
|
}));
|
|
1461
1490
|
|
|
1462
1491
|
// Generate recommendations
|
|
@@ -1464,13 +1493,19 @@ export default ${interfaceName};`;
|
|
|
1464
1493
|
validation.recommendations.push('Increase test coverage by adding more unit tests');
|
|
1465
1494
|
}
|
|
1466
1495
|
if (!codeQualityCheck.passed) {
|
|
1467
|
-
validation.recommendations.push(
|
|
1496
|
+
validation.recommendations.push(
|
|
1497
|
+
'Improve code quality by addressing complexity and maintainability issues',
|
|
1498
|
+
);
|
|
1468
1499
|
}
|
|
1469
1500
|
if (!performanceCheck.passed) {
|
|
1470
|
-
validation.recommendations.push(
|
|
1501
|
+
validation.recommendations.push(
|
|
1502
|
+
'Optimize performance by implementing caching and database optimization',
|
|
1503
|
+
);
|
|
1471
1504
|
}
|
|
1472
1505
|
if (!securityCheck.passed) {
|
|
1473
|
-
validation.recommendations.push(
|
|
1506
|
+
validation.recommendations.push(
|
|
1507
|
+
'Address security vulnerabilities and implement security best practices',
|
|
1508
|
+
);
|
|
1474
1509
|
}
|
|
1475
1510
|
|
|
1476
1511
|
return validation;
|
|
@@ -1488,9 +1523,10 @@ export default ${interfaceName};`;
|
|
|
1488
1523
|
}
|
|
1489
1524
|
|
|
1490
1525
|
findRelevantComponent(test, architecture) {
|
|
1491
|
-
return architecture.components.find(
|
|
1492
|
-
|
|
1493
|
-
|
|
1526
|
+
return architecture.components.find(
|
|
1527
|
+
(comp) =>
|
|
1528
|
+
test.name.toLowerCase().includes(comp.name.toLowerCase()) ||
|
|
1529
|
+
test.description.toLowerCase().includes(comp.responsibility.toLowerCase()),
|
|
1494
1530
|
);
|
|
1495
1531
|
}
|
|
1496
1532
|
|
|
@@ -1498,7 +1534,7 @@ export default ${interfaceName};`;
|
|
|
1498
1534
|
return [
|
|
1499
1535
|
{ assertion: 'result is defined', passed: true },
|
|
1500
1536
|
{ assertion: 'result has expected structure', passed: true },
|
|
1501
|
-
{ assertion: 'result matches expected values', passed: true }
|
|
1537
|
+
{ assertion: 'result matches expected values', passed: true },
|
|
1502
1538
|
];
|
|
1503
1539
|
}
|
|
1504
1540
|
|
|
@@ -1533,11 +1569,13 @@ export default ${interfaceName};`;
|
|
|
1533
1569
|
|
|
1534
1570
|
### Summary
|
|
1535
1571
|
- **Total Cycles**: ${result.tddCycles.length}
|
|
1536
|
-
- **Successful**: ${result.tddCycles.filter(c => c.success).length}
|
|
1537
|
-
- **Failed**: ${result.tddCycles.filter(c => !c.success).length}
|
|
1572
|
+
- **Successful**: ${result.tddCycles.filter((c) => c.success).length}
|
|
1573
|
+
- **Failed**: ${result.tddCycles.filter((c) => !c.success).length}
|
|
1538
1574
|
- **Average Duration**: ${(result.tddCycles.reduce((sum, c) => sum + c.duration, 0) / result.tddCycles.length / 1000).toFixed(2)}s
|
|
1539
1575
|
|
|
1540
|
-
${result.tddCycles
|
|
1576
|
+
${result.tddCycles
|
|
1577
|
+
.map(
|
|
1578
|
+
(cycle, index) => `
|
|
1541
1579
|
### Cycle ${index + 1}: ${cycle.requirement}
|
|
1542
1580
|
**Status**: ${cycle.success ? '✅ Success' : '❌ Failed'}
|
|
1543
1581
|
**Duration**: ${(cycle.duration / 1000).toFixed(2)}s
|
|
@@ -1547,14 +1585,16 @@ ${result.tddCycles.map((cycle, index) => `
|
|
|
1547
1585
|
- All Tests Failing: ${cycle.redPhase ? '✅' : '❌'}
|
|
1548
1586
|
|
|
1549
1587
|
#### GREEN Phase
|
|
1550
|
-
- Tests Passing: ${cycle.greenPhase ? cycle.greenPhase.testResults.filter(t => t.passed).length : 0}
|
|
1588
|
+
- Tests Passing: ${cycle.greenPhase ? cycle.greenPhase.testResults.filter((t) => t.passed).length : 0}
|
|
1551
1589
|
- Implementation Complete: ${cycle.greenPhase ? '✅' : '❌'}
|
|
1552
1590
|
|
|
1553
1591
|
#### REFACTOR Phase
|
|
1554
1592
|
- Refactoring Techniques: ${cycle.refactorPhase ? cycle.refactorPhase.refactorings.length : 0}
|
|
1555
1593
|
- Tests Still Passing: ${cycle.refactorPhase ? '✅' : '❌'}
|
|
1556
1594
|
- Code Quality Improved: ${cycle.refactorPhase ? '✅' : '❌'}
|
|
1557
|
-
|
|
1595
|
+
`,
|
|
1596
|
+
)
|
|
1597
|
+
.join('\n')}
|
|
1558
1598
|
|
|
1559
1599
|
## Implementations
|
|
1560
1600
|
|
|
@@ -1563,7 +1603,9 @@ ${result.tddCycles.map((cycle, index) => `
|
|
|
1563
1603
|
- **Total Files**: ${result.implementations.reduce((sum, impl) => sum + impl.files.length, 0)}
|
|
1564
1604
|
- **Total Lines**: ${result.implementations.reduce((sum, impl) => sum + impl.files.reduce((fileSum, file) => fileSum + file.lines, 0), 0)}
|
|
1565
1605
|
|
|
1566
|
-
${result.implementations
|
|
1606
|
+
${result.implementations
|
|
1607
|
+
.map(
|
|
1608
|
+
(impl, index) => `
|
|
1567
1609
|
### ${index + 1}. ${impl.component}
|
|
1568
1610
|
**Type**: ${impl.type}
|
|
1569
1611
|
**Files**: ${impl.files.length}
|
|
@@ -1574,8 +1616,10 @@ ${result.implementations.map((impl, index) => `
|
|
|
1574
1616
|
**Complexity**: ${impl.complexity}
|
|
1575
1617
|
|
|
1576
1618
|
#### Files
|
|
1577
|
-
${impl.files.map(file => `- **${file.name}** (${file.type}): ${file.lines} lines`).join('\n')}
|
|
1578
|
-
|
|
1619
|
+
${impl.files.map((file) => `- **${file.name}** (${file.type}): ${file.lines} lines`).join('\n')}
|
|
1620
|
+
`,
|
|
1621
|
+
)
|
|
1622
|
+
.join('\n')}
|
|
1579
1623
|
|
|
1580
1624
|
## Test Results
|
|
1581
1625
|
|
|
@@ -1587,14 +1631,18 @@ ${impl.files.map(file => `- **${file.name}** (${file.type}): ${file.lines} lines
|
|
|
1587
1631
|
- **Duration**: ${(result.testResults.duration / 1000).toFixed(2)}s
|
|
1588
1632
|
|
|
1589
1633
|
### Test Suites
|
|
1590
|
-
${result.testResults.suites
|
|
1634
|
+
${result.testResults.suites
|
|
1635
|
+
.map(
|
|
1636
|
+
(suite, index) => `
|
|
1591
1637
|
#### ${index + 1}. ${suite.name}
|
|
1592
1638
|
- **Tests**: ${suite.tests}
|
|
1593
1639
|
- **Passed**: ${suite.passed}
|
|
1594
1640
|
- **Failed**: ${suite.failed}
|
|
1595
1641
|
- **Coverage**: ${suite.coverage.toFixed(1)}%
|
|
1596
1642
|
- **Duration**: ${(suite.duration / 1000).toFixed(2)}s
|
|
1597
|
-
|
|
1643
|
+
`,
|
|
1644
|
+
)
|
|
1645
|
+
.join('\n')}
|
|
1598
1646
|
|
|
1599
1647
|
## Code Quality
|
|
1600
1648
|
|
|
@@ -1616,11 +1664,19 @@ ${result.testResults.suites.map((suite, index) => `
|
|
|
1616
1664
|
- **Test Files**: ${result.codeQuality.metrics.testFiles}
|
|
1617
1665
|
|
|
1618
1666
|
### Quality Violations
|
|
1619
|
-
${
|
|
1667
|
+
${
|
|
1668
|
+
result.codeQuality.violations.length > 0
|
|
1669
|
+
? result.codeQuality.violations
|
|
1670
|
+
.map(
|
|
1671
|
+
(violation, index) => `
|
|
1620
1672
|
#### ${index + 1}. ${violation.type} (${violation.severity})
|
|
1621
1673
|
- **Message**: ${violation.message}
|
|
1622
1674
|
- **Location**: ${violation.file || violation.component || 'General'}
|
|
1623
|
-
|
|
1675
|
+
`,
|
|
1676
|
+
)
|
|
1677
|
+
.join('\n')
|
|
1678
|
+
: 'No quality violations found ✅'
|
|
1679
|
+
}
|
|
1624
1680
|
|
|
1625
1681
|
## Performance Analysis
|
|
1626
1682
|
|
|
@@ -1642,12 +1698,16 @@ ${result.codeQuality.violations.length > 0 ? result.codeQuality.violations.map((
|
|
|
1642
1698
|
- **Network I/O**: ${result.performance.resource.networkIO}%
|
|
1643
1699
|
|
|
1644
1700
|
### Bottlenecks
|
|
1645
|
-
${result.performance.bottlenecks
|
|
1701
|
+
${result.performance.bottlenecks
|
|
1702
|
+
.map(
|
|
1703
|
+
(bottleneck, index) => `
|
|
1646
1704
|
#### ${index + 1}. ${bottleneck.component}
|
|
1647
1705
|
- **Impact**: ${bottleneck.impact}
|
|
1648
1706
|
- **Description**: ${bottleneck.description}
|
|
1649
1707
|
- **Recommendation**: ${bottleneck.recommendation}
|
|
1650
|
-
|
|
1708
|
+
`,
|
|
1709
|
+
)
|
|
1710
|
+
.join('\n')}
|
|
1651
1711
|
|
|
1652
1712
|
### Performance Recommendations
|
|
1653
1713
|
${result.performance.recommendations.map((rec, index) => `${index + 1}. ${rec}`).join('\n')}
|
|
@@ -1662,25 +1722,37 @@ ${result.performance.recommendations.map((rec, index) => `${index + 1}. ${rec}`)
|
|
|
1662
1722
|
- **ISO 27001**: ${result.security.compliance.iso27001}
|
|
1663
1723
|
|
|
1664
1724
|
### Vulnerabilities
|
|
1665
|
-
${
|
|
1725
|
+
${
|
|
1726
|
+
result.security.vulnerabilities.length > 0
|
|
1727
|
+
? result.security.vulnerabilities
|
|
1728
|
+
.map(
|
|
1729
|
+
(vuln, index) => `
|
|
1666
1730
|
#### ${index + 1}. ${vuln.type} (${vuln.severity})
|
|
1667
1731
|
- **Description**: ${vuln.description}
|
|
1668
1732
|
- **Location**: ${vuln.location}
|
|
1669
1733
|
- **Remediation**: ${vuln.remediation}
|
|
1670
|
-
|
|
1734
|
+
`,
|
|
1735
|
+
)
|
|
1736
|
+
.join('\n')
|
|
1737
|
+
: 'No security vulnerabilities found ✅'
|
|
1738
|
+
}
|
|
1671
1739
|
|
|
1672
1740
|
### Security Recommendations
|
|
1673
1741
|
${result.security.recommendations.map((rec, index) => `${index + 1}. ${rec}`).join('\n')}
|
|
1674
1742
|
|
|
1675
1743
|
## Optimizations Applied
|
|
1676
1744
|
|
|
1677
|
-
${result.optimizations
|
|
1745
|
+
${result.optimizations
|
|
1746
|
+
.map(
|
|
1747
|
+
(opt, index) => `
|
|
1678
1748
|
### ${index + 1}. ${opt.type} Optimization
|
|
1679
1749
|
- **Description**: ${opt.description}
|
|
1680
1750
|
- **Impact**: ${opt.impact}
|
|
1681
1751
|
- **Effort**: ${opt.effort}
|
|
1682
1752
|
- **Implementation**: ${opt.implementation}
|
|
1683
|
-
|
|
1753
|
+
`,
|
|
1754
|
+
)
|
|
1755
|
+
.join('\n')}
|
|
1684
1756
|
|
|
1685
1757
|
## Documentation Generated
|
|
1686
1758
|
|
|
@@ -1700,11 +1772,15 @@ ${result.optimizations.map((opt, index) => `
|
|
|
1700
1772
|
## Refactoring Results
|
|
1701
1773
|
|
|
1702
1774
|
### Techniques Applied
|
|
1703
|
-
${result.refactoring.techniques
|
|
1775
|
+
${result.refactoring.techniques
|
|
1776
|
+
.map(
|
|
1777
|
+
(technique, index) => `
|
|
1704
1778
|
#### ${index + 1}. ${technique.name}
|
|
1705
1779
|
- **Description**: ${technique.description}
|
|
1706
1780
|
- **Impact**: ${technique.impact}
|
|
1707
|
-
|
|
1781
|
+
`,
|
|
1782
|
+
)
|
|
1783
|
+
.join('\n')}
|
|
1708
1784
|
|
|
1709
1785
|
### Improvements Achieved
|
|
1710
1786
|
${result.refactoring.improvements.map((improvement, index) => `${index + 1}. ${improvement}`).join('\n')}
|
|
@@ -1719,38 +1795,56 @@ ${result.refactoring.improvements.map((improvement, index) => `${index + 1}. ${i
|
|
|
1719
1795
|
### Validation Score: ${result.validation.score}/100
|
|
1720
1796
|
|
|
1721
1797
|
### Checks Performed
|
|
1722
|
-
${result.validation.checks
|
|
1798
|
+
${result.validation.checks
|
|
1799
|
+
.map(
|
|
1800
|
+
(check, index) => `
|
|
1723
1801
|
#### ${index + 1}. ${check.name}
|
|
1724
1802
|
- **Status**: ${check.passed ? '✅ Passed' : '❌ Failed'}
|
|
1725
1803
|
- **Score**: ${check.score}/${check.threshold}
|
|
1726
1804
|
- **Message**: ${check.message}
|
|
1727
|
-
|
|
1805
|
+
`,
|
|
1806
|
+
)
|
|
1807
|
+
.join('\n')}
|
|
1728
1808
|
|
|
1729
|
-
${
|
|
1809
|
+
${
|
|
1810
|
+
result.validation.issues.length > 0
|
|
1811
|
+
? `
|
|
1730
1812
|
### Issues Found
|
|
1731
|
-
${result.validation.issues
|
|
1813
|
+
${result.validation.issues
|
|
1814
|
+
.map(
|
|
1815
|
+
(issue, index) => `
|
|
1732
1816
|
#### ${index + 1}. ${issue.category} (${issue.severity})
|
|
1733
1817
|
${issue.message}
|
|
1734
|
-
|
|
1818
|
+
`,
|
|
1819
|
+
)
|
|
1820
|
+
.join('\n')}`
|
|
1821
|
+
: '### No Issues Found ✅'
|
|
1822
|
+
}
|
|
1735
1823
|
|
|
1736
|
-
${
|
|
1824
|
+
${
|
|
1825
|
+
result.validation.recommendations.length > 0
|
|
1826
|
+
? `
|
|
1737
1827
|
### Recommendations
|
|
1738
|
-
${result.validation.recommendations.map((rec, index) => `${index + 1}. ${rec}`).join('\n')}`
|
|
1828
|
+
${result.validation.recommendations.map((rec, index) => `${index + 1}. ${rec}`).join('\n')}`
|
|
1829
|
+
: ''
|
|
1830
|
+
}
|
|
1739
1831
|
|
|
1740
1832
|
## Summary
|
|
1741
1833
|
|
|
1742
1834
|
The refinement phase has been completed with TDD methodology, resulting in:
|
|
1743
1835
|
|
|
1744
|
-
- ✅ **${result.tddCycles.filter(c => c.success).length}/${result.tddCycles.length}** successful TDD cycles
|
|
1836
|
+
- ✅ **${result.tddCycles.filter((c) => c.success).length}/${result.tddCycles.length}** successful TDD cycles
|
|
1745
1837
|
- ✅ **${result.testResults.coverage.toFixed(1)}%** test coverage
|
|
1746
1838
|
- ✅ **${result.codeQuality.overall.toFixed(1)}/100** code quality score
|
|
1747
1839
|
- ✅ **${result.performance.responseTime.average}ms** average response time
|
|
1748
1840
|
- ✅ **${result.security.score}/100** security score
|
|
1749
1841
|
- ✅ **${result.validation.score}/100** final validation score
|
|
1750
1842
|
|
|
1751
|
-
${
|
|
1752
|
-
|
|
1753
|
-
|
|
1843
|
+
${
|
|
1844
|
+
result.validation.passed
|
|
1845
|
+
? '🎉 **All quality gates passed!** The implementation is ready for completion phase.'
|
|
1846
|
+
: '⚠️ **Some quality gates failed.** Please address the issues before proceeding to completion phase.'
|
|
1847
|
+
}
|
|
1754
1848
|
`;
|
|
1755
1849
|
|
|
1756
1850
|
// Save document
|
|
@@ -1759,4 +1853,4 @@ ${result.validation.passed ?
|
|
|
1759
1853
|
}
|
|
1760
1854
|
}
|
|
1761
1855
|
|
|
1762
|
-
export default SparcRefinement;
|
|
1856
|
+
export default SparcRefinement;
|