claude-flow 2.0.0-alpha.61 → 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/CHANGELOG.md +59 -1
- 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 +55 -64
- 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.js +49 -49
- package/dist/cli/commands/help-new.js.map +1 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +122 -125
- 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.map +1 -1
- package/dist/cli/help-formatter.js +8 -14
- package/dist/cli/help-formatter.js.map +1 -1
- 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 +195 -135
- 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.map +1 -1
- package/dist/cli/simple-commands/swarm.js +78 -67
- 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.map +1 -1
- package/dist/cli/validation-helper.js.map +1 -1
- 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 +13 -11
- 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 +82 -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 +57 -55
- package/src/cli/commands/help.ts +162 -159
- 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 +23 -33
- package/src/cli/help-formatter.ts +24 -34
- package/src/cli/help-text.js +69 -60
- 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 +460 -385
- 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 +598 -432
- 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 +16 -21
- package/src/cli/validation-helper.ts +21 -34
- 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 +79 -78
- 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 +662 -351
- 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 SparcArchitecture extends SparcPhase {
|
|
|
18
18
|
*/
|
|
19
19
|
async execute() {
|
|
20
20
|
console.log('🏗️ Starting Architecture Phase');
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
await this.initializePhase();
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
const result = {
|
|
25
25
|
systemDesign: null,
|
|
26
26
|
components: [],
|
|
@@ -33,51 +33,51 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
33
33
|
integrationPoints: [],
|
|
34
34
|
qualityAttributes: {},
|
|
35
35
|
architecturalDecisions: [],
|
|
36
|
-
riskAssessment: []
|
|
36
|
+
riskAssessment: [],
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
40
|
// Load previous phases
|
|
41
41
|
const specification = await this.retrieveFromMemory('specification_complete');
|
|
42
42
|
const pseudocode = await this.retrieveFromMemory('pseudocode_complete');
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
if (!specification || !pseudocode) {
|
|
45
45
|
throw new Error('Specification and Pseudocode phases must be completed first');
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// Design system architecture
|
|
49
49
|
result.systemDesign = await this.designSystemArchitecture(specification, pseudocode);
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
// Define components
|
|
52
52
|
result.components = await this.defineComponents(specification, pseudocode);
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
// Select design patterns
|
|
55
55
|
result.designPatterns = await this.selectDesignPatterns(specification, pseudocode);
|
|
56
|
-
|
|
56
|
+
|
|
57
57
|
// Design data model
|
|
58
58
|
result.dataModel = await this.designDataModel(specification);
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
// Design API structure
|
|
61
61
|
result.apiDesign = await this.designApiStructure(specification);
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
// Plan deployment architecture
|
|
64
64
|
result.deploymentArchitecture = await this.planDeploymentArchitecture(specification);
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
// Design security architecture
|
|
67
67
|
result.securityArchitecture = await this.designSecurityArchitecture(specification);
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
// Plan scalability
|
|
70
70
|
result.scalabilityPlan = await this.planScalability(specification);
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
// Identify integration points
|
|
73
73
|
result.integrationPoints = await this.identifyIntegrationPoints(specification);
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
// Define quality attributes
|
|
76
76
|
result.qualityAttributes = await this.defineQualityAttributes(specification);
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
// Document architectural decisions
|
|
79
79
|
result.architecturalDecisions = await this.documentArchitecturalDecisions(result);
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
// Assess risks
|
|
82
82
|
result.riskAssessment = await this.assessArchitecturalRisks(result);
|
|
83
83
|
|
|
@@ -89,7 +89,6 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
89
89
|
|
|
90
90
|
console.log('✅ Architecture phase completed');
|
|
91
91
|
return result;
|
|
92
|
-
|
|
93
92
|
} catch (error) {
|
|
94
93
|
console.error('❌ Architecture phase failed:', error.message);
|
|
95
94
|
throw error;
|
|
@@ -106,16 +105,17 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
106
105
|
components: [],
|
|
107
106
|
dataFlow: [],
|
|
108
107
|
controlFlow: [],
|
|
109
|
-
boundaries: []
|
|
108
|
+
boundaries: [],
|
|
110
109
|
};
|
|
111
110
|
|
|
112
111
|
// Determine architecture style based on requirements
|
|
113
112
|
const requirements = specification.requirements || [];
|
|
114
|
-
const hasApiRequirements = requirements.some(req => req.toLowerCase().includes('api'));
|
|
115
|
-
const hasUiRequirements = requirements.some(req => req.toLowerCase().includes('ui'));
|
|
116
|
-
const hasDataRequirements = requirements.some(req => req.toLowerCase().includes('data'));
|
|
117
|
-
const hasDistributedRequirements = requirements.some(
|
|
118
|
-
req
|
|
113
|
+
const hasApiRequirements = requirements.some((req) => req.toLowerCase().includes('api'));
|
|
114
|
+
const hasUiRequirements = requirements.some((req) => req.toLowerCase().includes('ui'));
|
|
115
|
+
const hasDataRequirements = requirements.some((req) => req.toLowerCase().includes('data'));
|
|
116
|
+
const hasDistributedRequirements = requirements.some(
|
|
117
|
+
(req) =>
|
|
118
|
+
req.toLowerCase().includes('distributed') || req.toLowerCase().includes('microservice'),
|
|
119
119
|
);
|
|
120
120
|
|
|
121
121
|
if (hasDistributedRequirements) {
|
|
@@ -124,7 +124,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
124
124
|
{ name: 'API Gateway', responsibility: 'Request routing and authentication' },
|
|
125
125
|
{ name: 'Service Layer', responsibility: 'Business logic microservices' },
|
|
126
126
|
{ name: 'Data Layer', responsibility: 'Database and storage services' },
|
|
127
|
-
{ name: 'Infrastructure Layer', responsibility: 'Monitoring and deployment' }
|
|
127
|
+
{ name: 'Infrastructure Layer', responsibility: 'Monitoring and deployment' },
|
|
128
128
|
];
|
|
129
129
|
} else if (hasApiRequirements && hasUiRequirements) {
|
|
130
130
|
architecture.style = 'mvc';
|
|
@@ -133,7 +133,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
133
133
|
{ name: 'Controller Layer', responsibility: 'Request handling and routing' },
|
|
134
134
|
{ name: 'Service Layer', responsibility: 'Business logic and processing' },
|
|
135
135
|
{ name: 'Data Access Layer', responsibility: 'Database operations' },
|
|
136
|
-
{ name: 'Infrastructure Layer', responsibility: 'Cross-cutting concerns' }
|
|
136
|
+
{ name: 'Infrastructure Layer', responsibility: 'Cross-cutting concerns' },
|
|
137
137
|
];
|
|
138
138
|
} else if (hasApiRequirements) {
|
|
139
139
|
architecture.style = 'layered';
|
|
@@ -141,7 +141,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
141
141
|
{ name: 'API Layer', responsibility: 'External interface and contracts' },
|
|
142
142
|
{ name: 'Business Layer', responsibility: 'Core business logic' },
|
|
143
143
|
{ name: 'Data Layer', responsibility: 'Data persistence and retrieval' },
|
|
144
|
-
{ name: 'Infrastructure Layer', responsibility: 'Logging, monitoring, security' }
|
|
144
|
+
{ name: 'Infrastructure Layer', responsibility: 'Logging, monitoring, security' },
|
|
145
145
|
];
|
|
146
146
|
} else {
|
|
147
147
|
architecture.style = 'modular';
|
|
@@ -149,16 +149,16 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
149
149
|
{ name: 'Interface Layer', responsibility: 'External interactions' },
|
|
150
150
|
{ name: 'Processing Layer', responsibility: 'Core processing logic' },
|
|
151
151
|
{ name: 'Storage Layer', responsibility: 'Data management' },
|
|
152
|
-
{ name: 'Utility Layer', responsibility: 'Common utilities and helpers' }
|
|
152
|
+
{ name: 'Utility Layer', responsibility: 'Common utilities and helpers' },
|
|
153
153
|
];
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
// Define data flow
|
|
157
157
|
architecture.dataFlow = this.defineDataFlow(architecture.layers);
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
// Define control flow
|
|
160
160
|
architecture.controlFlow = this.defineControlFlow(architecture.layers);
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
// Define boundaries
|
|
163
163
|
architecture.boundaries = this.defineBoundaries(architecture.layers);
|
|
164
164
|
|
|
@@ -170,23 +170,23 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
170
170
|
*/
|
|
171
171
|
defineDataFlow(layers) {
|
|
172
172
|
const dataFlow = [];
|
|
173
|
-
|
|
173
|
+
|
|
174
174
|
for (let i = 0; i < layers.length - 1; i++) {
|
|
175
175
|
dataFlow.push({
|
|
176
176
|
from: layers[i].name,
|
|
177
177
|
to: layers[i + 1].name,
|
|
178
178
|
direction: 'downstream',
|
|
179
|
-
dataType: 'processed data'
|
|
179
|
+
dataType: 'processed data',
|
|
180
180
|
});
|
|
181
|
-
|
|
181
|
+
|
|
182
182
|
dataFlow.push({
|
|
183
183
|
from: layers[i + 1].name,
|
|
184
184
|
to: layers[i].name,
|
|
185
185
|
direction: 'upstream',
|
|
186
|
-
dataType: 'results/responses'
|
|
186
|
+
dataType: 'results/responses',
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
return dataFlow;
|
|
191
191
|
}
|
|
192
192
|
|
|
@@ -199,7 +199,8 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
199
199
|
order: index + 1,
|
|
200
200
|
triggers: index === 0 ? ['external request'] : [`${layers[index - 1].name} completion`],
|
|
201
201
|
actions: ['process', 'validate', 'transform', 'forward'],
|
|
202
|
-
outcomes:
|
|
202
|
+
outcomes:
|
|
203
|
+
index === layers.length - 1 ? ['final response'] : [`trigger ${layers[index + 1].name}`],
|
|
203
204
|
}));
|
|
204
205
|
}
|
|
205
206
|
|
|
@@ -207,12 +208,12 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
207
208
|
* Define boundaries
|
|
208
209
|
*/
|
|
209
210
|
defineBoundaries(layers) {
|
|
210
|
-
return layers.map(layer => ({
|
|
211
|
+
return layers.map((layer) => ({
|
|
211
212
|
layer: layer.name,
|
|
212
213
|
type: 'logical',
|
|
213
214
|
encapsulation: 'interface-based',
|
|
214
215
|
dependencies: 'unidirectional',
|
|
215
|
-
contracts: 'well-defined APIs'
|
|
216
|
+
contracts: 'well-defined APIs',
|
|
216
217
|
}));
|
|
217
218
|
}
|
|
218
219
|
|
|
@@ -250,7 +251,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
250
251
|
*/
|
|
251
252
|
createComponentFromRequirement(requirement) {
|
|
252
253
|
const reqLower = requirement.toLowerCase();
|
|
253
|
-
|
|
254
|
+
|
|
254
255
|
if (reqLower.includes('api')) {
|
|
255
256
|
return {
|
|
256
257
|
name: 'APIController',
|
|
@@ -259,7 +260,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
259
260
|
interfaces: ['HTTP', 'REST'],
|
|
260
261
|
dependencies: ['AuthenticationService', 'ValidationService'],
|
|
261
262
|
patterns: ['Controller', 'Facade'],
|
|
262
|
-
complexity: 'medium'
|
|
263
|
+
complexity: 'medium',
|
|
263
264
|
};
|
|
264
265
|
} else if (reqLower.includes('authenticate')) {
|
|
265
266
|
return {
|
|
@@ -269,7 +270,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
269
270
|
interfaces: ['IAuthenticationService'],
|
|
270
271
|
dependencies: ['UserRepository', 'TokenManager'],
|
|
271
272
|
patterns: ['Service', 'Strategy'],
|
|
272
|
-
complexity: 'high'
|
|
273
|
+
complexity: 'high',
|
|
273
274
|
};
|
|
274
275
|
} else if (reqLower.includes('data')) {
|
|
275
276
|
return {
|
|
@@ -279,7 +280,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
279
280
|
interfaces: ['IRepository'],
|
|
280
281
|
dependencies: ['DatabaseConnection', 'DataMapper'],
|
|
281
282
|
patterns: ['Repository', 'Unit of Work'],
|
|
282
|
-
complexity: 'medium'
|
|
283
|
+
complexity: 'medium',
|
|
283
284
|
};
|
|
284
285
|
} else if (reqLower.includes('validate')) {
|
|
285
286
|
return {
|
|
@@ -289,7 +290,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
289
290
|
interfaces: ['IValidationService'],
|
|
290
291
|
dependencies: ['ValidationRules', 'ErrorHandler'],
|
|
291
292
|
patterns: ['Strategy', 'Chain of Responsibility'],
|
|
292
|
-
complexity: 'low'
|
|
293
|
+
complexity: 'low',
|
|
293
294
|
};
|
|
294
295
|
} else {
|
|
295
296
|
return {
|
|
@@ -299,7 +300,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
299
300
|
interfaces: ['IService'],
|
|
300
301
|
dependencies: ['CommonUtilities'],
|
|
301
302
|
patterns: ['Service'],
|
|
302
|
-
complexity: 'low'
|
|
303
|
+
complexity: 'low',
|
|
303
304
|
};
|
|
304
305
|
}
|
|
305
306
|
}
|
|
@@ -315,7 +316,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
315
316
|
interfaces: [`I${this.toPascalCase(func.function)}`],
|
|
316
317
|
dependencies: this.extractDependencies(func.steps),
|
|
317
318
|
patterns: this.inferPatterns(func.steps),
|
|
318
|
-
complexity: func.complexity ? func.complexity.level : 'medium'
|
|
319
|
+
complexity: func.complexity ? func.complexity.level : 'medium',
|
|
319
320
|
};
|
|
320
321
|
}
|
|
321
322
|
|
|
@@ -331,7 +332,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
331
332
|
interfaces: ['ILogger'],
|
|
332
333
|
dependencies: ['LoggingProvider'],
|
|
333
334
|
patterns: ['Singleton', 'Factory'],
|
|
334
|
-
complexity: 'low'
|
|
335
|
+
complexity: 'low',
|
|
335
336
|
},
|
|
336
337
|
{
|
|
337
338
|
name: 'ConfigurationManager',
|
|
@@ -340,7 +341,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
340
341
|
interfaces: ['IConfigurationManager'],
|
|
341
342
|
dependencies: ['EnvironmentProvider'],
|
|
342
343
|
patterns: ['Singleton'],
|
|
343
|
-
complexity: 'low'
|
|
344
|
+
complexity: 'low',
|
|
344
345
|
},
|
|
345
346
|
{
|
|
346
347
|
name: 'ErrorHandler',
|
|
@@ -349,7 +350,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
349
350
|
interfaces: ['IErrorHandler'],
|
|
350
351
|
dependencies: ['Logger'],
|
|
351
352
|
patterns: ['Strategy', 'Chain of Responsibility'],
|
|
352
|
-
complexity: 'medium'
|
|
353
|
+
complexity: 'medium',
|
|
353
354
|
},
|
|
354
355
|
{
|
|
355
356
|
name: 'CacheManager',
|
|
@@ -358,8 +359,8 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
358
359
|
interfaces: ['ICacheManager'],
|
|
359
360
|
dependencies: ['CacheProvider'],
|
|
360
361
|
patterns: ['Proxy', 'Decorator'],
|
|
361
|
-
complexity: 'medium'
|
|
362
|
-
}
|
|
362
|
+
complexity: 'medium',
|
|
363
|
+
},
|
|
363
364
|
];
|
|
364
365
|
}
|
|
365
366
|
|
|
@@ -368,10 +369,10 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
368
369
|
*/
|
|
369
370
|
mergeComponents(components) {
|
|
370
371
|
const componentMap = new Map();
|
|
371
|
-
|
|
372
|
+
|
|
372
373
|
for (const component of components) {
|
|
373
374
|
const key = component.name;
|
|
374
|
-
|
|
375
|
+
|
|
375
376
|
if (componentMap.has(key)) {
|
|
376
377
|
const existing = componentMap.get(key);
|
|
377
378
|
// Merge dependencies and interfaces
|
|
@@ -382,7 +383,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
382
383
|
componentMap.set(key, component);
|
|
383
384
|
}
|
|
384
385
|
}
|
|
385
|
-
|
|
386
|
+
|
|
386
387
|
return Array.from(componentMap.values());
|
|
387
388
|
}
|
|
388
389
|
|
|
@@ -390,8 +391,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
390
391
|
* Convert to PascalCase
|
|
391
392
|
*/
|
|
392
393
|
toPascalCase(str) {
|
|
393
|
-
return str
|
|
394
|
-
|
|
394
|
+
return str
|
|
395
|
+
.replace(/_([a-z])/g, (match, letter) => letter.toUpperCase())
|
|
396
|
+
.replace(/^([a-z])/, (match, letter) => letter.toUpperCase());
|
|
395
397
|
}
|
|
396
398
|
|
|
397
399
|
/**
|
|
@@ -399,7 +401,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
399
401
|
*/
|
|
400
402
|
extractDependencies(steps) {
|
|
401
403
|
const dependencies = [];
|
|
402
|
-
|
|
404
|
+
|
|
403
405
|
for (const step of steps) {
|
|
404
406
|
if (step.includes('database')) dependencies.push('DatabaseConnection');
|
|
405
407
|
if (step.includes('authenticate')) dependencies.push('AuthenticationService');
|
|
@@ -407,7 +409,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
407
409
|
if (step.includes('log')) dependencies.push('Logger');
|
|
408
410
|
if (step.includes('cache')) dependencies.push('CacheManager');
|
|
409
411
|
}
|
|
410
|
-
|
|
412
|
+
|
|
411
413
|
return [...new Set(dependencies)];
|
|
412
414
|
}
|
|
413
415
|
|
|
@@ -416,12 +418,12 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
416
418
|
*/
|
|
417
419
|
inferPatterns(steps) {
|
|
418
420
|
const patterns = [];
|
|
419
|
-
|
|
420
|
-
if (steps.some(step => step.includes('CALL'))) patterns.push('Command');
|
|
421
|
-
if (steps.some(step => step.includes('IF'))) patterns.push('Strategy');
|
|
422
|
-
if (steps.some(step => step.includes('VALIDATE'))) patterns.push('Chain of Responsibility');
|
|
423
|
-
if (steps.some(step => step.includes('RETURN'))) patterns.push('Factory');
|
|
424
|
-
|
|
421
|
+
|
|
422
|
+
if (steps.some((step) => step.includes('CALL'))) patterns.push('Command');
|
|
423
|
+
if (steps.some((step) => step.includes('IF'))) patterns.push('Strategy');
|
|
424
|
+
if (steps.some((step) => step.includes('VALIDATE'))) patterns.push('Chain of Responsibility');
|
|
425
|
+
if (steps.some((step) => step.includes('RETURN'))) patterns.push('Factory');
|
|
426
|
+
|
|
425
427
|
return patterns.length > 0 ? patterns : ['Service'];
|
|
426
428
|
}
|
|
427
429
|
|
|
@@ -431,40 +433,52 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
431
433
|
async selectDesignPatterns(specification, pseudocode) {
|
|
432
434
|
const patterns = [];
|
|
433
435
|
const requirements = specification.requirements || [];
|
|
434
|
-
|
|
436
|
+
|
|
435
437
|
// Creational patterns
|
|
436
|
-
if (
|
|
438
|
+
if (
|
|
439
|
+
requirements.some(
|
|
440
|
+
(req) => req.toLowerCase().includes('create') || req.toLowerCase().includes('instantiate'),
|
|
441
|
+
)
|
|
442
|
+
) {
|
|
437
443
|
patterns.push({
|
|
438
444
|
name: 'Factory Pattern',
|
|
439
445
|
type: 'creational',
|
|
440
446
|
purpose: 'Create objects without specifying exact classes',
|
|
441
447
|
applicability: 'Object creation with varying configurations',
|
|
442
448
|
implementation: 'Factory classes with creation methods',
|
|
443
|
-
benefits: ['Loose coupling', 'Easy extensibility', 'Centralized creation logic']
|
|
449
|
+
benefits: ['Loose coupling', 'Easy extensibility', 'Centralized creation logic'],
|
|
444
450
|
});
|
|
445
451
|
}
|
|
446
452
|
|
|
447
453
|
// Structural patterns
|
|
448
|
-
if (
|
|
454
|
+
if (
|
|
455
|
+
requirements.some(
|
|
456
|
+
(req) => req.toLowerCase().includes('interface') || req.toLowerCase().includes('adapt'),
|
|
457
|
+
)
|
|
458
|
+
) {
|
|
449
459
|
patterns.push({
|
|
450
460
|
name: 'Adapter Pattern',
|
|
451
461
|
type: 'structural',
|
|
452
462
|
purpose: 'Allow incompatible interfaces to work together',
|
|
453
463
|
applicability: 'Integration with external systems',
|
|
454
464
|
implementation: 'Wrapper classes implementing target interfaces',
|
|
455
|
-
benefits: ['Code reuse', 'Separation of concerns', 'Easy integration']
|
|
465
|
+
benefits: ['Code reuse', 'Separation of concerns', 'Easy integration'],
|
|
456
466
|
});
|
|
457
467
|
}
|
|
458
468
|
|
|
459
469
|
// Behavioral patterns
|
|
460
|
-
if (
|
|
470
|
+
if (
|
|
471
|
+
requirements.some(
|
|
472
|
+
(req) => req.toLowerCase().includes('strategy') || req.toLowerCase().includes('algorithm'),
|
|
473
|
+
)
|
|
474
|
+
) {
|
|
461
475
|
patterns.push({
|
|
462
476
|
name: 'Strategy Pattern',
|
|
463
477
|
type: 'behavioral',
|
|
464
478
|
purpose: 'Define family of algorithms and make them interchangeable',
|
|
465
479
|
applicability: 'Multiple ways to perform operations',
|
|
466
480
|
implementation: 'Strategy interfaces with concrete implementations',
|
|
467
|
-
benefits: ['Flexibility', 'Open/closed principle', 'Runtime selection']
|
|
481
|
+
benefits: ['Flexibility', 'Open/closed principle', 'Runtime selection'],
|
|
468
482
|
});
|
|
469
483
|
}
|
|
470
484
|
|
|
@@ -475,7 +489,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
475
489
|
purpose: 'Separate data access logic from business logic',
|
|
476
490
|
applicability: 'Data persistence operations',
|
|
477
491
|
implementation: 'Repository interfaces with concrete implementations',
|
|
478
|
-
benefits: ['Testability', 'Loose coupling', 'Centralized data access']
|
|
492
|
+
benefits: ['Testability', 'Loose coupling', 'Centralized data access'],
|
|
479
493
|
});
|
|
480
494
|
|
|
481
495
|
patterns.push({
|
|
@@ -484,7 +498,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
484
498
|
purpose: 'Manage dependencies between objects',
|
|
485
499
|
applicability: 'All components requiring external dependencies',
|
|
486
500
|
implementation: 'Constructor injection with DI container',
|
|
487
|
-
benefits: ['Testability', 'Loose coupling', 'Flexibility']
|
|
501
|
+
benefits: ['Testability', 'Loose coupling', 'Flexibility'],
|
|
488
502
|
});
|
|
489
503
|
|
|
490
504
|
patterns.push({
|
|
@@ -493,7 +507,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
493
507
|
purpose: 'Notify multiple objects about state changes',
|
|
494
508
|
applicability: 'Event-driven communication',
|
|
495
509
|
implementation: 'Subject-observer relationships with event notifications',
|
|
496
|
-
benefits: ['Loose coupling', 'Dynamic relationships', 'Broadcast communication']
|
|
510
|
+
benefits: ['Loose coupling', 'Dynamic relationships', 'Broadcast communication'],
|
|
497
511
|
});
|
|
498
512
|
|
|
499
513
|
return patterns;
|
|
@@ -508,13 +522,13 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
508
522
|
relationships: [],
|
|
509
523
|
constraints: [],
|
|
510
524
|
indexes: [],
|
|
511
|
-
views: []
|
|
525
|
+
views: [],
|
|
512
526
|
};
|
|
513
527
|
|
|
514
528
|
// Extract entities from requirements
|
|
515
529
|
const requirements = specification.requirements || [];
|
|
516
530
|
const entities = this.extractEntities(requirements);
|
|
517
|
-
|
|
531
|
+
|
|
518
532
|
for (const entityName of entities) {
|
|
519
533
|
const entity = {
|
|
520
534
|
name: entityName,
|
|
@@ -522,21 +536,21 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
522
536
|
primaryKey: 'id',
|
|
523
537
|
foreignKeys: [],
|
|
524
538
|
constraints: this.generateConstraints(entityName),
|
|
525
|
-
indexes: this.generateIndexes(entityName)
|
|
539
|
+
indexes: this.generateIndexes(entityName),
|
|
526
540
|
};
|
|
527
|
-
|
|
541
|
+
|
|
528
542
|
dataModel.entities.push(entity);
|
|
529
543
|
}
|
|
530
544
|
|
|
531
545
|
// Define relationships
|
|
532
546
|
dataModel.relationships = this.defineRelationships(dataModel.entities);
|
|
533
|
-
|
|
547
|
+
|
|
534
548
|
// Define global constraints
|
|
535
549
|
dataModel.constraints = this.defineGlobalConstraints();
|
|
536
|
-
|
|
550
|
+
|
|
537
551
|
// Define indexes
|
|
538
552
|
dataModel.indexes = this.defineGlobalIndexes(dataModel.entities);
|
|
539
|
-
|
|
553
|
+
|
|
540
554
|
// Define views
|
|
541
555
|
dataModel.views = this.defineViews(dataModel.entities);
|
|
542
556
|
|
|
@@ -548,28 +562,32 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
548
562
|
*/
|
|
549
563
|
extractEntities(requirements) {
|
|
550
564
|
const entities = new Set();
|
|
551
|
-
|
|
565
|
+
|
|
552
566
|
for (const requirement of requirements) {
|
|
553
567
|
const words = requirement.split(' ');
|
|
554
|
-
|
|
568
|
+
|
|
555
569
|
for (const word of words) {
|
|
556
570
|
// Look for nouns that could be entities
|
|
557
|
-
if (
|
|
558
|
-
|
|
571
|
+
if (
|
|
572
|
+
word.length > 3 &&
|
|
573
|
+
!['system', 'must', 'should', 'will', 'data', 'user', 'interface'].includes(
|
|
574
|
+
word.toLowerCase(),
|
|
575
|
+
)
|
|
576
|
+
) {
|
|
559
577
|
if (word[0] === word[0].toUpperCase()) {
|
|
560
578
|
entities.add(word);
|
|
561
579
|
}
|
|
562
580
|
}
|
|
563
581
|
}
|
|
564
582
|
}
|
|
565
|
-
|
|
583
|
+
|
|
566
584
|
// Add default entities if none found
|
|
567
585
|
if (entities.size === 0) {
|
|
568
586
|
entities.add('User');
|
|
569
587
|
entities.add('Session');
|
|
570
588
|
entities.add('Configuration');
|
|
571
589
|
}
|
|
572
|
-
|
|
590
|
+
|
|
573
591
|
return Array.from(entities);
|
|
574
592
|
}
|
|
575
593
|
|
|
@@ -581,19 +599,19 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
581
599
|
{ name: 'id', type: 'UUID', nullable: false, unique: true },
|
|
582
600
|
{ name: 'created_at', type: 'TIMESTAMP', nullable: false, default: 'CURRENT_TIMESTAMP' },
|
|
583
601
|
{ name: 'updated_at', type: 'TIMESTAMP', nullable: false, default: 'CURRENT_TIMESTAMP' },
|
|
584
|
-
{ name: 'version', type: 'INTEGER', nullable: false, default: '1' }
|
|
602
|
+
{ name: 'version', type: 'INTEGER', nullable: false, default: '1' },
|
|
585
603
|
];
|
|
586
604
|
|
|
587
605
|
const specificAttributes = [];
|
|
588
606
|
const entityLower = entityName.toLowerCase();
|
|
589
|
-
|
|
607
|
+
|
|
590
608
|
if (entityLower.includes('user')) {
|
|
591
609
|
specificAttributes.push(
|
|
592
610
|
{ name: 'username', type: 'VARCHAR(50)', nullable: false, unique: true },
|
|
593
611
|
{ name: 'email', type: 'VARCHAR(255)', nullable: false, unique: true },
|
|
594
612
|
{ name: 'password_hash', type: 'VARCHAR(255)', nullable: false },
|
|
595
613
|
{ name: 'is_active', type: 'BOOLEAN', nullable: false, default: 'true' },
|
|
596
|
-
{ name: 'last_login', type: 'TIMESTAMP', nullable: true }
|
|
614
|
+
{ name: 'last_login', type: 'TIMESTAMP', nullable: true },
|
|
597
615
|
);
|
|
598
616
|
} else if (entityLower.includes('session')) {
|
|
599
617
|
specificAttributes.push(
|
|
@@ -601,13 +619,13 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
601
619
|
{ name: 'token', type: 'VARCHAR(255)', nullable: false, unique: true },
|
|
602
620
|
{ name: 'expires_at', type: 'TIMESTAMP', nullable: false },
|
|
603
621
|
{ name: 'ip_address', type: 'INET', nullable: true },
|
|
604
|
-
{ name: 'user_agent', type: 'TEXT', nullable: true }
|
|
622
|
+
{ name: 'user_agent', type: 'TEXT', nullable: true },
|
|
605
623
|
);
|
|
606
624
|
} else {
|
|
607
625
|
specificAttributes.push(
|
|
608
626
|
{ name: 'name', type: 'VARCHAR(255)', nullable: false },
|
|
609
627
|
{ name: 'description', type: 'TEXT', nullable: true },
|
|
610
|
-
{ name: 'status', type: 'VARCHAR(50)', nullable: false, default: "'active'" }
|
|
628
|
+
{ name: 'status', type: 'VARCHAR(50)', nullable: false, default: "'active'" },
|
|
611
629
|
);
|
|
612
630
|
}
|
|
613
631
|
|
|
@@ -620,16 +638,28 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
620
638
|
generateConstraints(entityName) {
|
|
621
639
|
const constraints = [
|
|
622
640
|
{ name: `${entityName.toLowerCase()}_id_pk`, type: 'PRIMARY KEY', column: 'id' },
|
|
623
|
-
{
|
|
624
|
-
|
|
641
|
+
{
|
|
642
|
+
name: `${entityName.toLowerCase()}_version_positive`,
|
|
643
|
+
type: 'CHECK',
|
|
644
|
+
condition: 'version > 0',
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
name: `${entityName.toLowerCase()}_created_before_updated`,
|
|
648
|
+
type: 'CHECK',
|
|
649
|
+
condition: 'created_at <= updated_at',
|
|
650
|
+
},
|
|
625
651
|
];
|
|
626
652
|
|
|
627
653
|
const entityLower = entityName.toLowerCase();
|
|
628
|
-
|
|
654
|
+
|
|
629
655
|
if (entityLower.includes('user')) {
|
|
630
656
|
constraints.push(
|
|
631
|
-
{
|
|
632
|
-
|
|
657
|
+
{
|
|
658
|
+
name: 'user_email_format',
|
|
659
|
+
type: 'CHECK',
|
|
660
|
+
condition: "email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$'",
|
|
661
|
+
},
|
|
662
|
+
{ name: 'user_username_length', type: 'CHECK', condition: 'length(username) >= 3' },
|
|
633
663
|
);
|
|
634
664
|
}
|
|
635
665
|
|
|
@@ -641,17 +671,25 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
641
671
|
*/
|
|
642
672
|
generateIndexes(entityName) {
|
|
643
673
|
const indexes = [
|
|
644
|
-
{
|
|
645
|
-
|
|
674
|
+
{
|
|
675
|
+
name: `idx_${entityName.toLowerCase()}_created_at`,
|
|
676
|
+
type: 'BTREE',
|
|
677
|
+
columns: ['created_at'],
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: `idx_${entityName.toLowerCase()}_updated_at`,
|
|
681
|
+
type: 'BTREE',
|
|
682
|
+
columns: ['updated_at'],
|
|
683
|
+
},
|
|
646
684
|
];
|
|
647
685
|
|
|
648
686
|
const entityLower = entityName.toLowerCase();
|
|
649
|
-
|
|
687
|
+
|
|
650
688
|
if (entityLower.includes('user')) {
|
|
651
689
|
indexes.push(
|
|
652
690
|
{ name: 'idx_user_email', type: 'BTREE', columns: ['email'] },
|
|
653
691
|
{ name: 'idx_user_username', type: 'BTREE', columns: ['username'] },
|
|
654
|
-
{ name: 'idx_user_active', type: 'BTREE', columns: ['is_active'] }
|
|
692
|
+
{ name: 'idx_user_active', type: 'BTREE', columns: ['is_active'] },
|
|
655
693
|
);
|
|
656
694
|
}
|
|
657
695
|
|
|
@@ -663,11 +701,11 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
663
701
|
*/
|
|
664
702
|
defineRelationships(entities) {
|
|
665
703
|
const relationships = [];
|
|
666
|
-
|
|
704
|
+
|
|
667
705
|
// Look for entities that could have relationships
|
|
668
|
-
const userEntity = entities.find(e => e.name.toLowerCase().includes('user'));
|
|
669
|
-
const sessionEntity = entities.find(e => e.name.toLowerCase().includes('session'));
|
|
670
|
-
|
|
706
|
+
const userEntity = entities.find((e) => e.name.toLowerCase().includes('user'));
|
|
707
|
+
const sessionEntity = entities.find((e) => e.name.toLowerCase().includes('session'));
|
|
708
|
+
|
|
671
709
|
if (userEntity && sessionEntity) {
|
|
672
710
|
relationships.push({
|
|
673
711
|
name: 'user_sessions',
|
|
@@ -677,7 +715,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
677
715
|
parentKey: 'id',
|
|
678
716
|
childKey: 'user_id',
|
|
679
717
|
onDelete: 'CASCADE',
|
|
680
|
-
onUpdate: 'RESTRICT'
|
|
718
|
+
onUpdate: 'RESTRICT',
|
|
681
719
|
});
|
|
682
720
|
}
|
|
683
721
|
|
|
@@ -690,7 +728,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
690
728
|
defineGlobalConstraints() {
|
|
691
729
|
return [
|
|
692
730
|
{ name: 'no_future_created_at', type: 'CHECK', condition: 'created_at <= CURRENT_TIMESTAMP' },
|
|
693
|
-
{ name: 'no_future_updated_at', type: 'CHECK', condition: 'updated_at <= CURRENT_TIMESTAMP' }
|
|
731
|
+
{ name: 'no_future_updated_at', type: 'CHECK', condition: 'updated_at <= CURRENT_TIMESTAMP' },
|
|
694
732
|
];
|
|
695
733
|
}
|
|
696
734
|
|
|
@@ -699,14 +737,14 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
699
737
|
*/
|
|
700
738
|
defineGlobalIndexes(entities) {
|
|
701
739
|
const indexes = [];
|
|
702
|
-
|
|
740
|
+
|
|
703
741
|
// Add composite indexes for common query patterns
|
|
704
742
|
for (const entity of entities) {
|
|
705
743
|
indexes.push({
|
|
706
744
|
name: `idx_${entity.name.toLowerCase()}_status_created`,
|
|
707
745
|
type: 'BTREE',
|
|
708
746
|
table: entity.name,
|
|
709
|
-
columns: ['status', 'created_at']
|
|
747
|
+
columns: ['status', 'created_at'],
|
|
710
748
|
});
|
|
711
749
|
}
|
|
712
750
|
|
|
@@ -718,14 +756,14 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
718
756
|
*/
|
|
719
757
|
defineViews(entities) {
|
|
720
758
|
const views = [];
|
|
721
|
-
|
|
759
|
+
|
|
722
760
|
// Create a view for active entities
|
|
723
761
|
for (const entity of entities) {
|
|
724
|
-
if (entity.attributes.some(attr => attr.name === 'is_active' || attr.name === 'status')) {
|
|
762
|
+
if (entity.attributes.some((attr) => attr.name === 'is_active' || attr.name === 'status')) {
|
|
725
763
|
views.push({
|
|
726
764
|
name: `active_${entity.name.toLowerCase()}s`,
|
|
727
|
-
definition: `SELECT * FROM ${entity.name} WHERE ${entity.attributes.some(attr => attr.name === 'is_active') ? 'is_active = true' : "status = 'active'"}`,
|
|
728
|
-
purpose: `Show only active ${entity.name.toLowerCase()} records
|
|
765
|
+
definition: `SELECT * FROM ${entity.name} WHERE ${entity.attributes.some((attr) => attr.name === 'is_active') ? 'is_active = true' : "status = 'active'"}`,
|
|
766
|
+
purpose: `Show only active ${entity.name.toLowerCase()} records`,
|
|
729
767
|
});
|
|
730
768
|
}
|
|
731
769
|
}
|
|
@@ -745,12 +783,12 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
745
783
|
schemas: [],
|
|
746
784
|
errorHandling: {},
|
|
747
785
|
rateLimiting: {},
|
|
748
|
-
versioning: {}
|
|
786
|
+
versioning: {},
|
|
749
787
|
};
|
|
750
788
|
|
|
751
789
|
// Generate endpoints based on requirements
|
|
752
790
|
const requirements = specification.requirements || [];
|
|
753
|
-
|
|
791
|
+
|
|
754
792
|
for (const requirement of requirements) {
|
|
755
793
|
if (requirement.toLowerCase().includes('api')) {
|
|
756
794
|
const endpoints = this.generateEndpoints(requirement);
|
|
@@ -760,13 +798,13 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
760
798
|
|
|
761
799
|
// Generate schemas
|
|
762
800
|
apiDesign.schemas = this.generateApiSchemas(apiDesign.endpoints);
|
|
763
|
-
|
|
801
|
+
|
|
764
802
|
// Define error handling
|
|
765
803
|
apiDesign.errorHandling = this.defineApiErrorHandling();
|
|
766
|
-
|
|
804
|
+
|
|
767
805
|
// Define rate limiting
|
|
768
806
|
apiDesign.rateLimiting = this.defineApiRateLimiting();
|
|
769
|
-
|
|
807
|
+
|
|
770
808
|
// Define versioning strategy
|
|
771
809
|
apiDesign.versioning = this.defineApiVersioning();
|
|
772
810
|
|
|
@@ -778,7 +816,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
778
816
|
*/
|
|
779
817
|
generateEndpoints(requirement) {
|
|
780
818
|
const endpoints = [];
|
|
781
|
-
|
|
819
|
+
|
|
782
820
|
// Basic CRUD endpoints
|
|
783
821
|
endpoints.push(
|
|
784
822
|
{
|
|
@@ -788,26 +826,24 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
788
826
|
parameters: [
|
|
789
827
|
{ name: 'page', type: 'integer', description: 'Page number' },
|
|
790
828
|
{ name: 'limit', type: 'integer', description: 'Items per page' },
|
|
791
|
-
{ name: 'sort', type: 'string', description: 'Sort field' }
|
|
829
|
+
{ name: 'sort', type: 'string', description: 'Sort field' },
|
|
792
830
|
],
|
|
793
831
|
responses: {
|
|
794
832
|
200: { description: 'Success', schema: 'ResourceList' },
|
|
795
833
|
400: { description: 'Bad Request', schema: 'Error' },
|
|
796
|
-
401: { description: 'Unauthorized', schema: 'Error' }
|
|
797
|
-
}
|
|
834
|
+
401: { description: 'Unauthorized', schema: 'Error' },
|
|
835
|
+
},
|
|
798
836
|
},
|
|
799
837
|
{
|
|
800
838
|
path: '/resources/{id}',
|
|
801
839
|
method: 'GET',
|
|
802
840
|
summary: 'Get resource by ID',
|
|
803
|
-
parameters: [
|
|
804
|
-
{ name: 'id', type: 'string', description: 'Resource ID', required: true }
|
|
805
|
-
],
|
|
841
|
+
parameters: [{ name: 'id', type: 'string', description: 'Resource ID', required: true }],
|
|
806
842
|
responses: {
|
|
807
843
|
200: { description: 'Success', schema: 'Resource' },
|
|
808
844
|
404: { description: 'Not Found', schema: 'Error' },
|
|
809
|
-
401: { description: 'Unauthorized', schema: 'Error' }
|
|
810
|
-
}
|
|
845
|
+
401: { description: 'Unauthorized', schema: 'Error' },
|
|
846
|
+
},
|
|
811
847
|
},
|
|
812
848
|
{
|
|
813
849
|
path: '/resources',
|
|
@@ -817,37 +853,33 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
817
853
|
responses: {
|
|
818
854
|
201: { description: 'Created', schema: 'Resource' },
|
|
819
855
|
400: { description: 'Bad Request', schema: 'Error' },
|
|
820
|
-
401: { description: 'Unauthorized', schema: 'Error' }
|
|
821
|
-
}
|
|
856
|
+
401: { description: 'Unauthorized', schema: 'Error' },
|
|
857
|
+
},
|
|
822
858
|
},
|
|
823
859
|
{
|
|
824
860
|
path: '/resources/{id}',
|
|
825
861
|
method: 'PUT',
|
|
826
862
|
summary: 'Update resource',
|
|
827
|
-
parameters: [
|
|
828
|
-
{ name: 'id', type: 'string', description: 'Resource ID', required: true }
|
|
829
|
-
],
|
|
863
|
+
parameters: [{ name: 'id', type: 'string', description: 'Resource ID', required: true }],
|
|
830
864
|
requestBody: { schema: 'UpdateResourceRequest' },
|
|
831
865
|
responses: {
|
|
832
866
|
200: { description: 'Updated', schema: 'Resource' },
|
|
833
867
|
404: { description: 'Not Found', schema: 'Error' },
|
|
834
868
|
400: { description: 'Bad Request', schema: 'Error' },
|
|
835
|
-
401: { description: 'Unauthorized', schema: 'Error' }
|
|
836
|
-
}
|
|
869
|
+
401: { description: 'Unauthorized', schema: 'Error' },
|
|
870
|
+
},
|
|
837
871
|
},
|
|
838
872
|
{
|
|
839
873
|
path: '/resources/{id}',
|
|
840
874
|
method: 'DELETE',
|
|
841
875
|
summary: 'Delete resource',
|
|
842
|
-
parameters: [
|
|
843
|
-
{ name: 'id', type: 'string', description: 'Resource ID', required: true }
|
|
844
|
-
],
|
|
876
|
+
parameters: [{ name: 'id', type: 'string', description: 'Resource ID', required: true }],
|
|
845
877
|
responses: {
|
|
846
878
|
204: { description: 'Deleted' },
|
|
847
879
|
404: { description: 'Not Found', schema: 'Error' },
|
|
848
|
-
401: { description: 'Unauthorized', schema: 'Error' }
|
|
849
|
-
}
|
|
850
|
-
}
|
|
880
|
+
401: { description: 'Unauthorized', schema: 'Error' },
|
|
881
|
+
},
|
|
882
|
+
},
|
|
851
883
|
);
|
|
852
884
|
|
|
853
885
|
return endpoints;
|
|
@@ -858,7 +890,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
858
890
|
*/
|
|
859
891
|
generateApiSchemas(endpoints) {
|
|
860
892
|
const schemas = [];
|
|
861
|
-
|
|
893
|
+
|
|
862
894
|
// Basic resource schema
|
|
863
895
|
schemas.push({
|
|
864
896
|
name: 'Resource',
|
|
@@ -869,9 +901,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
869
901
|
description: { type: 'string' },
|
|
870
902
|
status: { type: 'string', enum: ['active', 'inactive'] },
|
|
871
903
|
created_at: { type: 'string', format: 'date-time' },
|
|
872
|
-
updated_at: { type: 'string', format: 'date-time' }
|
|
904
|
+
updated_at: { type: 'string', format: 'date-time' },
|
|
873
905
|
},
|
|
874
|
-
required: ['id', 'name', 'status']
|
|
906
|
+
required: ['id', 'name', 'status'],
|
|
875
907
|
});
|
|
876
908
|
|
|
877
909
|
// Resource list schema
|
|
@@ -879,17 +911,17 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
879
911
|
name: 'ResourceList',
|
|
880
912
|
type: 'object',
|
|
881
913
|
properties: {
|
|
882
|
-
data: { type: 'array', items: {
|
|
914
|
+
data: { type: 'array', items: { $ref: '#/schemas/Resource' } },
|
|
883
915
|
pagination: {
|
|
884
916
|
type: 'object',
|
|
885
917
|
properties: {
|
|
886
918
|
page: { type: 'integer' },
|
|
887
919
|
limit: { type: 'integer' },
|
|
888
920
|
total: { type: 'integer' },
|
|
889
|
-
pages: { type: 'integer' }
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
921
|
+
pages: { type: 'integer' },
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
},
|
|
893
925
|
});
|
|
894
926
|
|
|
895
927
|
// Error schema
|
|
@@ -900,9 +932,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
900
932
|
error: { type: 'string' },
|
|
901
933
|
message: { type: 'string' },
|
|
902
934
|
details: { type: 'array', items: { type: 'string' } },
|
|
903
|
-
timestamp: { type: 'string', format: 'date-time' }
|
|
935
|
+
timestamp: { type: 'string', format: 'date-time' },
|
|
904
936
|
},
|
|
905
|
-
required: ['error', 'message']
|
|
937
|
+
required: ['error', 'message'],
|
|
906
938
|
});
|
|
907
939
|
|
|
908
940
|
return schemas;
|
|
@@ -923,15 +955,15 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
923
955
|
422: 'Unprocessable Entity - Validation errors',
|
|
924
956
|
429: 'Too Many Requests - Rate limit exceeded',
|
|
925
957
|
500: 'Internal Server Error - Server error',
|
|
926
|
-
503: 'Service Unavailable - Service temporarily unavailable'
|
|
958
|
+
503: 'Service Unavailable - Service temporarily unavailable',
|
|
927
959
|
},
|
|
928
960
|
errorFormat: {
|
|
929
961
|
error: 'Error type',
|
|
930
962
|
message: 'Human-readable error message',
|
|
931
963
|
details: 'Array of specific error details',
|
|
932
|
-
timestamp: 'ISO 8601 timestamp'
|
|
964
|
+
timestamp: 'ISO 8601 timestamp',
|
|
933
965
|
},
|
|
934
|
-
logging: 'All errors logged with request ID and stack trace'
|
|
966
|
+
logging: 'All errors logged with request ID and stack trace',
|
|
935
967
|
};
|
|
936
968
|
}
|
|
937
969
|
|
|
@@ -944,14 +976,14 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
944
976
|
limits: {
|
|
945
977
|
authenticated: { requests: 1000, window: '1 hour' },
|
|
946
978
|
anonymous: { requests: 100, window: '1 hour' },
|
|
947
|
-
burst: { requests: 10, window: '1 minute' }
|
|
979
|
+
burst: { requests: 10, window: '1 minute' },
|
|
948
980
|
},
|
|
949
981
|
headers: {
|
|
950
982
|
'X-RateLimit-Limit': 'Request limit for current window',
|
|
951
983
|
'X-RateLimit-Remaining': 'Remaining requests in current window',
|
|
952
|
-
'X-RateLimit-Reset': 'Unix timestamp when limit resets'
|
|
984
|
+
'X-RateLimit-Reset': 'Unix timestamp when limit resets',
|
|
953
985
|
},
|
|
954
|
-
handling: 'Return 429 status with retry-after header'
|
|
986
|
+
handling: 'Return 429 status with retry-after header',
|
|
955
987
|
};
|
|
956
988
|
}
|
|
957
989
|
|
|
@@ -966,9 +998,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
966
998
|
development: 'Active development with breaking changes',
|
|
967
999
|
stable: 'Stable API with backward compatibility',
|
|
968
1000
|
deprecated: 'Deprecated with migration guide',
|
|
969
|
-
retired: 'No longer supported'
|
|
1001
|
+
retired: 'No longer supported',
|
|
970
1002
|
},
|
|
971
|
-
migration: 'Gradual migration with parallel support periods'
|
|
1003
|
+
migration: 'Gradual migration with parallel support periods',
|
|
972
1004
|
};
|
|
973
1005
|
}
|
|
974
1006
|
|
|
@@ -982,7 +1014,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
982
1014
|
infrastructure: {},
|
|
983
1015
|
monitoring: {},
|
|
984
1016
|
security: {},
|
|
985
|
-
scalability: {}
|
|
1017
|
+
scalability: {},
|
|
986
1018
|
};
|
|
987
1019
|
|
|
988
1020
|
// Define environments
|
|
@@ -992,22 +1024,22 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
992
1024
|
purpose: 'Development and testing',
|
|
993
1025
|
resources: 'Single node with shared resources',
|
|
994
1026
|
database: 'SQLite or embedded database',
|
|
995
|
-
monitoring: 'Basic logging'
|
|
1027
|
+
monitoring: 'Basic logging',
|
|
996
1028
|
},
|
|
997
1029
|
{
|
|
998
1030
|
name: 'staging',
|
|
999
1031
|
purpose: 'Pre-production testing',
|
|
1000
1032
|
resources: 'Production-like environment with reduced capacity',
|
|
1001
1033
|
database: 'Managed database service',
|
|
1002
|
-
monitoring: 'Full monitoring stack'
|
|
1034
|
+
monitoring: 'Full monitoring stack',
|
|
1003
1035
|
},
|
|
1004
1036
|
{
|
|
1005
1037
|
name: 'production',
|
|
1006
1038
|
purpose: 'Live application serving users',
|
|
1007
1039
|
resources: 'Multiple nodes with load balancing',
|
|
1008
1040
|
database: 'High-availability managed database',
|
|
1009
|
-
monitoring: 'Comprehensive monitoring and alerting'
|
|
1010
|
-
}
|
|
1041
|
+
monitoring: 'Comprehensive monitoring and alerting',
|
|
1042
|
+
},
|
|
1011
1043
|
];
|
|
1012
1044
|
|
|
1013
1045
|
// Define infrastructure
|
|
@@ -1016,7 +1048,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1016
1048
|
compute: 'Auto-scaling container instances',
|
|
1017
1049
|
storage: 'Persistent volumes with backup',
|
|
1018
1050
|
networking: 'Load balancer with SSL termination',
|
|
1019
|
-
dns: 'Managed DNS with health checks'
|
|
1051
|
+
dns: 'Managed DNS with health checks',
|
|
1020
1052
|
};
|
|
1021
1053
|
|
|
1022
1054
|
// Define monitoring
|
|
@@ -1025,7 +1057,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1025
1057
|
logging: 'Centralized logging with log aggregation',
|
|
1026
1058
|
tracing: 'Distributed tracing for request flow',
|
|
1027
1059
|
alerting: 'Multi-channel alerting for critical issues',
|
|
1028
|
-
dashboards: 'Real-time dashboards for system health'
|
|
1060
|
+
dashboards: 'Real-time dashboards for system health',
|
|
1029
1061
|
};
|
|
1030
1062
|
|
|
1031
1063
|
// Define security
|
|
@@ -1034,7 +1066,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1034
1066
|
network: 'Network policies and firewall rules',
|
|
1035
1067
|
access: 'Role-based access control',
|
|
1036
1068
|
scanning: 'Container and dependency vulnerability scanning',
|
|
1037
|
-
compliance: 'Security compliance monitoring'
|
|
1069
|
+
compliance: 'Security compliance monitoring',
|
|
1038
1070
|
};
|
|
1039
1071
|
|
|
1040
1072
|
// Define scalability
|
|
@@ -1043,7 +1075,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1043
1075
|
vertical: 'Resource limits and requests optimization',
|
|
1044
1076
|
database: 'Database scaling with read replicas',
|
|
1045
1077
|
caching: 'Multi-layer caching strategy',
|
|
1046
|
-
cdn: 'Content delivery network for static assets'
|
|
1078
|
+
cdn: 'Content delivery network for static assets',
|
|
1047
1079
|
};
|
|
1048
1080
|
|
|
1049
1081
|
return deployment;
|
|
@@ -1059,7 +1091,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1059
1091
|
dataProtection: {},
|
|
1060
1092
|
networkSecurity: {},
|
|
1061
1093
|
monitoring: {},
|
|
1062
|
-
compliance: {}
|
|
1094
|
+
compliance: {},
|
|
1063
1095
|
};
|
|
1064
1096
|
|
|
1065
1097
|
// Authentication design
|
|
@@ -1068,7 +1100,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1068
1100
|
providers: ['Local credentials', 'OAuth2/OpenID Connect'],
|
|
1069
1101
|
session: 'Stateless with secure token storage',
|
|
1070
1102
|
mfa: 'Multi-factor authentication for sensitive operations',
|
|
1071
|
-
passwordPolicy: 'Strong password requirements with complexity rules'
|
|
1103
|
+
passwordPolicy: 'Strong password requirements with complexity rules',
|
|
1072
1104
|
};
|
|
1073
1105
|
|
|
1074
1106
|
// Authorization design
|
|
@@ -1077,7 +1109,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1077
1109
|
permissions: 'Fine-grained permissions with resource-level access',
|
|
1078
1110
|
policies: 'Attribute-based access control for complex rules',
|
|
1079
1111
|
delegation: 'Secure delegation with time-limited tokens',
|
|
1080
|
-
auditing: 'Complete audit trail of access decisions'
|
|
1112
|
+
auditing: 'Complete audit trail of access decisions',
|
|
1081
1113
|
};
|
|
1082
1114
|
|
|
1083
1115
|
// Data protection design
|
|
@@ -1085,18 +1117,18 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1085
1117
|
encryption: {
|
|
1086
1118
|
atRest: 'AES-256 encryption for stored data',
|
|
1087
1119
|
inTransit: 'TLS 1.3 for all network communication',
|
|
1088
|
-
keys: 'Hardware security module or managed key service'
|
|
1120
|
+
keys: 'Hardware security module or managed key service',
|
|
1089
1121
|
},
|
|
1090
1122
|
privacy: {
|
|
1091
1123
|
pii: 'Personal information identification and protection',
|
|
1092
1124
|
anonymization: 'Data anonymization for analytics',
|
|
1093
|
-
retention: 'Data retention policies with automatic deletion'
|
|
1125
|
+
retention: 'Data retention policies with automatic deletion',
|
|
1094
1126
|
},
|
|
1095
1127
|
backup: {
|
|
1096
1128
|
encryption: 'Encrypted backups with separate key management',
|
|
1097
1129
|
testing: 'Regular backup restoration testing',
|
|
1098
|
-
offsite: 'Geographically distributed backup storage'
|
|
1099
|
-
}
|
|
1130
|
+
offsite: 'Geographically distributed backup storage',
|
|
1131
|
+
},
|
|
1100
1132
|
};
|
|
1101
1133
|
|
|
1102
1134
|
// Network security design
|
|
@@ -1105,7 +1137,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1105
1137
|
segmentation: 'Network segmentation with micro-segmentation',
|
|
1106
1138
|
monitoring: 'Network traffic monitoring and analysis',
|
|
1107
1139
|
vpn: 'VPN access for administrative operations',
|
|
1108
|
-
certificates: 'Automated certificate management and renewal'
|
|
1140
|
+
certificates: 'Automated certificate management and renewal',
|
|
1109
1141
|
};
|
|
1110
1142
|
|
|
1111
1143
|
// Security monitoring design
|
|
@@ -1114,7 +1146,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1114
1146
|
ids: 'Intrusion detection and prevention systems',
|
|
1115
1147
|
behavior: 'User and entity behavior analytics',
|
|
1116
1148
|
threat: 'Threat intelligence integration',
|
|
1117
|
-
incident: 'Automated incident response workflows'
|
|
1149
|
+
incident: 'Automated incident response workflows',
|
|
1118
1150
|
};
|
|
1119
1151
|
|
|
1120
1152
|
// Compliance design
|
|
@@ -1123,7 +1155,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1123
1155
|
auditing: 'Regular security audits and penetration testing',
|
|
1124
1156
|
documentation: 'Security policies and procedures documentation',
|
|
1125
1157
|
training: 'Security awareness training for all personnel',
|
|
1126
|
-
reporting: 'Compliance reporting and evidence collection'
|
|
1158
|
+
reporting: 'Compliance reporting and evidence collection',
|
|
1127
1159
|
};
|
|
1128
1160
|
|
|
1129
1161
|
return security;
|
|
@@ -1138,7 +1170,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1138
1170
|
verticalScaling: {},
|
|
1139
1171
|
dataScaling: {},
|
|
1140
1172
|
performanceOptimization: {},
|
|
1141
|
-
monitoring: {}
|
|
1173
|
+
monitoring: {},
|
|
1142
1174
|
};
|
|
1143
1175
|
|
|
1144
1176
|
// Horizontal scaling plan
|
|
@@ -1147,7 +1179,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1147
1179
|
triggers: ['CPU utilization > 70%', 'Memory utilization > 80%', 'Request queue length > 10'],
|
|
1148
1180
|
limits: { minimum: 2, maximum: 20, scaleUpRate: 2, scaleDownRate: 1 },
|
|
1149
1181
|
loadBalancing: 'Round-robin with health checks',
|
|
1150
|
-
sessionAffinity: 'Stateless design with external session storage'
|
|
1182
|
+
sessionAffinity: 'Stateless design with external session storage',
|
|
1151
1183
|
};
|
|
1152
1184
|
|
|
1153
1185
|
// Vertical scaling plan
|
|
@@ -1156,7 +1188,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1156
1188
|
monitoring: 'Continuous resource utilization monitoring',
|
|
1157
1189
|
recommendations: 'Automated resource recommendation engine',
|
|
1158
1190
|
limits: 'Resource limits to prevent resource exhaustion',
|
|
1159
|
-
optimization: 'Container resource optimization'
|
|
1191
|
+
optimization: 'Container resource optimization',
|
|
1160
1192
|
};
|
|
1161
1193
|
|
|
1162
1194
|
// Data scaling plan
|
|
@@ -1165,14 +1197,14 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1165
1197
|
readReplicas: 'Read replicas for read-heavy workloads',
|
|
1166
1198
|
sharding: 'Database sharding for large datasets',
|
|
1167
1199
|
caching: 'Multi-layer caching with Redis/Memcached',
|
|
1168
|
-
indexing: 'Optimized indexing strategies'
|
|
1200
|
+
indexing: 'Optimized indexing strategies',
|
|
1169
1201
|
},
|
|
1170
1202
|
storage: {
|
|
1171
1203
|
tiering: 'Storage tiering based on access patterns',
|
|
1172
1204
|
compression: 'Data compression for storage efficiency',
|
|
1173
1205
|
archiving: 'Automatic archiving of old data',
|
|
1174
|
-
partitioning: 'Data partitioning for improved performance'
|
|
1175
|
-
}
|
|
1206
|
+
partitioning: 'Data partitioning for improved performance',
|
|
1207
|
+
},
|
|
1176
1208
|
};
|
|
1177
1209
|
|
|
1178
1210
|
// Performance optimization plan
|
|
@@ -1181,14 +1213,14 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1181
1213
|
application: 'In-memory application caching',
|
|
1182
1214
|
database: 'Database query result caching',
|
|
1183
1215
|
cdn: 'Content delivery network for static assets',
|
|
1184
|
-
browser: 'Browser caching with appropriate headers'
|
|
1216
|
+
browser: 'Browser caching with appropriate headers',
|
|
1185
1217
|
},
|
|
1186
1218
|
optimization: {
|
|
1187
1219
|
queries: 'Database query optimization',
|
|
1188
1220
|
algorithms: 'Algorithm complexity optimization',
|
|
1189
1221
|
resources: 'Resource usage optimization',
|
|
1190
|
-
networking: 'Network latency optimization'
|
|
1191
|
-
}
|
|
1222
|
+
networking: 'Network latency optimization',
|
|
1223
|
+
},
|
|
1192
1224
|
};
|
|
1193
1225
|
|
|
1194
1226
|
// Monitoring plan
|
|
@@ -1198,11 +1230,11 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1198
1230
|
'Throughput and requests per second',
|
|
1199
1231
|
'Error rates and success rates',
|
|
1200
1232
|
'Resource utilization (CPU, memory, disk)',
|
|
1201
|
-
'Database performance metrics'
|
|
1233
|
+
'Database performance metrics',
|
|
1202
1234
|
],
|
|
1203
1235
|
alerting: 'Proactive alerting for performance degradation',
|
|
1204
1236
|
capacity: 'Capacity planning based on growth projections',
|
|
1205
|
-
testing: 'Regular performance testing and load testing'
|
|
1237
|
+
testing: 'Regular performance testing and load testing',
|
|
1206
1238
|
};
|
|
1207
1239
|
|
|
1208
1240
|
return scalability;
|
|
@@ -1218,7 +1250,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1218
1250
|
// Analyze requirements for integration needs
|
|
1219
1251
|
for (const requirement of requirements) {
|
|
1220
1252
|
const reqLower = requirement.toLowerCase();
|
|
1221
|
-
|
|
1253
|
+
|
|
1222
1254
|
if (reqLower.includes('external') || reqLower.includes('third-party')) {
|
|
1223
1255
|
integrations.push({
|
|
1224
1256
|
name: 'External API Integration',
|
|
@@ -1228,10 +1260,10 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1228
1260
|
authentication: 'API Key or OAuth2',
|
|
1229
1261
|
dataFormat: 'JSON',
|
|
1230
1262
|
errorHandling: 'Retry with exponential backoff',
|
|
1231
|
-
monitoring: 'API health checks and response time monitoring'
|
|
1263
|
+
monitoring: 'API health checks and response time monitoring',
|
|
1232
1264
|
});
|
|
1233
1265
|
}
|
|
1234
|
-
|
|
1266
|
+
|
|
1235
1267
|
if (reqLower.includes('database') || reqLower.includes('data')) {
|
|
1236
1268
|
integrations.push({
|
|
1237
1269
|
name: 'Database Integration',
|
|
@@ -1241,10 +1273,10 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1241
1273
|
authentication: 'Connection string with credentials',
|
|
1242
1274
|
dataFormat: 'SQL or NoSQL',
|
|
1243
1275
|
errorHandling: 'Connection pooling and retry logic',
|
|
1244
|
-
monitoring: 'Database performance and connection monitoring'
|
|
1276
|
+
monitoring: 'Database performance and connection monitoring',
|
|
1245
1277
|
});
|
|
1246
1278
|
}
|
|
1247
|
-
|
|
1279
|
+
|
|
1248
1280
|
if (reqLower.includes('message') || reqLower.includes('event')) {
|
|
1249
1281
|
integrations.push({
|
|
1250
1282
|
name: 'Message Queue Integration',
|
|
@@ -1254,7 +1286,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1254
1286
|
authentication: 'Queue-specific authentication',
|
|
1255
1287
|
dataFormat: 'JSON or Binary',
|
|
1256
1288
|
errorHandling: 'Dead letter queues and retry policies',
|
|
1257
|
-
monitoring: 'Queue depth and processing time monitoring'
|
|
1289
|
+
monitoring: 'Queue depth and processing time monitoring',
|
|
1258
1290
|
});
|
|
1259
1291
|
}
|
|
1260
1292
|
}
|
|
@@ -1268,7 +1300,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1268
1300
|
authentication: 'API Key',
|
|
1269
1301
|
dataFormat: 'Structured logs (JSON)',
|
|
1270
1302
|
errorHandling: 'Local buffering with batch sending',
|
|
1271
|
-
monitoring: 'Log ingestion and processing monitoring'
|
|
1303
|
+
monitoring: 'Log ingestion and processing monitoring',
|
|
1272
1304
|
});
|
|
1273
1305
|
|
|
1274
1306
|
return integrations;
|
|
@@ -1283,32 +1315,32 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1283
1315
|
responseTime: 'API responses under 200ms for 95th percentile',
|
|
1284
1316
|
throughput: 'Handle 1000+ requests per second',
|
|
1285
1317
|
scalability: 'Scale horizontally to handle load increases',
|
|
1286
|
-
efficiency: 'Optimize resource usage and minimize waste'
|
|
1318
|
+
efficiency: 'Optimize resource usage and minimize waste',
|
|
1287
1319
|
},
|
|
1288
1320
|
reliability: {
|
|
1289
1321
|
availability: '99.9% uptime with planned maintenance windows',
|
|
1290
1322
|
faultTolerance: 'Graceful degradation when components fail',
|
|
1291
1323
|
recoverability: 'Automatic recovery from transient failures',
|
|
1292
|
-
durability: 'Data persistence with backup and recovery'
|
|
1324
|
+
durability: 'Data persistence with backup and recovery',
|
|
1293
1325
|
},
|
|
1294
1326
|
security: {
|
|
1295
1327
|
confidentiality: 'Protect sensitive data with encryption',
|
|
1296
1328
|
integrity: 'Ensure data accuracy and prevent tampering',
|
|
1297
1329
|
authentication: 'Verify user identity before access',
|
|
1298
|
-
authorization: 'Control access based on user permissions'
|
|
1330
|
+
authorization: 'Control access based on user permissions',
|
|
1299
1331
|
},
|
|
1300
1332
|
usability: {
|
|
1301
1333
|
learnability: 'Intuitive interfaces requiring minimal training',
|
|
1302
1334
|
efficiency: 'Allow experienced users to work efficiently',
|
|
1303
1335
|
memorability: 'Easy to remember after periods of non-use',
|
|
1304
|
-
errors: 'Minimize user errors and provide clear error messages'
|
|
1336
|
+
errors: 'Minimize user errors and provide clear error messages',
|
|
1305
1337
|
},
|
|
1306
1338
|
maintainability: {
|
|
1307
1339
|
modifiability: 'Easy to modify and extend functionality',
|
|
1308
1340
|
testability: 'Comprehensive test coverage and automated testing',
|
|
1309
1341
|
reusability: 'Modular design with reusable components',
|
|
1310
|
-
analyzability: 'Clear code structure and documentation'
|
|
1311
|
-
}
|
|
1342
|
+
analyzability: 'Clear code structure and documentation',
|
|
1343
|
+
},
|
|
1312
1344
|
};
|
|
1313
1345
|
}
|
|
1314
1346
|
|
|
@@ -1317,7 +1349,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1317
1349
|
*/
|
|
1318
1350
|
async documentArchitecturalDecisions(result) {
|
|
1319
1351
|
const decisions = [];
|
|
1320
|
-
|
|
1352
|
+
|
|
1321
1353
|
// Architecture style decision
|
|
1322
1354
|
decisions.push({
|
|
1323
1355
|
id: 'AD-001',
|
|
@@ -1326,11 +1358,15 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1326
1358
|
context: 'Need to choose appropriate architectural style for the system',
|
|
1327
1359
|
decision: `Implement ${result.systemDesign.style} architecture with ${result.systemDesign.layers.length} layers`,
|
|
1328
1360
|
consequences: {
|
|
1329
|
-
positive: [
|
|
1330
|
-
|
|
1361
|
+
positive: [
|
|
1362
|
+
'Clear separation of concerns',
|
|
1363
|
+
'Maintainable code structure',
|
|
1364
|
+
'Scalable design',
|
|
1365
|
+
],
|
|
1366
|
+
negative: ['Potential performance overhead', 'Added complexity for simple operations'],
|
|
1331
1367
|
},
|
|
1332
1368
|
alternatives: ['Monolithic', 'Microservices', 'Event-driven'],
|
|
1333
|
-
date: new Date().toISOString()
|
|
1369
|
+
date: new Date().toISOString(),
|
|
1334
1370
|
});
|
|
1335
1371
|
|
|
1336
1372
|
// Design patterns decision
|
|
@@ -1341,11 +1377,15 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1341
1377
|
context: 'Need to ensure consistent and well-understood design patterns',
|
|
1342
1378
|
decision: `Implement ${result.designPatterns.length} design patterns including Repository, Factory, and Strategy patterns`,
|
|
1343
1379
|
consequences: {
|
|
1344
|
-
positive: [
|
|
1345
|
-
|
|
1380
|
+
positive: [
|
|
1381
|
+
'Improved code maintainability',
|
|
1382
|
+
'Better testability',
|
|
1383
|
+
'Consistent design approach',
|
|
1384
|
+
],
|
|
1385
|
+
negative: ['Learning curve for developers', 'Potential over-engineering'],
|
|
1346
1386
|
},
|
|
1347
1387
|
alternatives: ['Ad-hoc design', 'Framework-specific patterns'],
|
|
1348
|
-
date: new Date().toISOString()
|
|
1388
|
+
date: new Date().toISOString(),
|
|
1349
1389
|
});
|
|
1350
1390
|
|
|
1351
1391
|
// Data model decision
|
|
@@ -1357,10 +1397,10 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1357
1397
|
decision: `Use relational database with ${result.dataModel.entities.length} entities and normalized schema`,
|
|
1358
1398
|
consequences: {
|
|
1359
1399
|
positive: ['ACID compliance', 'Strong consistency', 'Mature ecosystem'],
|
|
1360
|
-
negative: ['Potential scalability limitations', 'Schema migration complexity']
|
|
1400
|
+
negative: ['Potential scalability limitations', 'Schema migration complexity'],
|
|
1361
1401
|
},
|
|
1362
1402
|
alternatives: ['NoSQL database', 'Document database', 'Graph database'],
|
|
1363
|
-
date: new Date().toISOString()
|
|
1403
|
+
date: new Date().toISOString(),
|
|
1364
1404
|
});
|
|
1365
1405
|
|
|
1366
1406
|
return decisions;
|
|
@@ -1371,7 +1411,7 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1371
1411
|
*/
|
|
1372
1412
|
async assessArchitecturalRisks(result) {
|
|
1373
1413
|
const risks = [];
|
|
1374
|
-
|
|
1414
|
+
|
|
1375
1415
|
// Complexity risk
|
|
1376
1416
|
risks.push({
|
|
1377
1417
|
id: 'AR-001',
|
|
@@ -1384,9 +1424,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1384
1424
|
'Implement comprehensive documentation',
|
|
1385
1425
|
'Provide developer training',
|
|
1386
1426
|
'Establish coding standards',
|
|
1387
|
-
'Regular code reviews'
|
|
1427
|
+
'Regular code reviews',
|
|
1388
1428
|
],
|
|
1389
|
-
monitoring: 'Code complexity metrics and maintainability index'
|
|
1429
|
+
monitoring: 'Code complexity metrics and maintainability index',
|
|
1390
1430
|
});
|
|
1391
1431
|
|
|
1392
1432
|
// Performance risk
|
|
@@ -1401,9 +1441,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1401
1441
|
'Performance testing and profiling',
|
|
1402
1442
|
'Caching strategies',
|
|
1403
1443
|
'Database optimization',
|
|
1404
|
-
'Load balancing'
|
|
1444
|
+
'Load balancing',
|
|
1405
1445
|
],
|
|
1406
|
-
monitoring: 'Response time and throughput monitoring'
|
|
1446
|
+
monitoring: 'Response time and throughput monitoring',
|
|
1407
1447
|
});
|
|
1408
1448
|
|
|
1409
1449
|
// Security risk
|
|
@@ -1418,9 +1458,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1418
1458
|
'Security architecture review',
|
|
1419
1459
|
'Regular security testing',
|
|
1420
1460
|
'Input validation and sanitization',
|
|
1421
|
-
'Secure communication protocols'
|
|
1461
|
+
'Secure communication protocols',
|
|
1422
1462
|
],
|
|
1423
|
-
monitoring: 'Security event monitoring and alerting'
|
|
1463
|
+
monitoring: 'Security event monitoring and alerting',
|
|
1424
1464
|
});
|
|
1425
1465
|
|
|
1426
1466
|
// Scalability risk
|
|
@@ -1435,9 +1475,9 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1435
1475
|
'Database optimization',
|
|
1436
1476
|
'Read replicas and caching',
|
|
1437
1477
|
'Connection pooling',
|
|
1438
|
-
'Horizontal scaling strategies'
|
|
1478
|
+
'Horizontal scaling strategies',
|
|
1439
1479
|
],
|
|
1440
|
-
monitoring: 'Database performance and connection monitoring'
|
|
1480
|
+
monitoring: 'Database performance and connection monitoring',
|
|
1441
1481
|
});
|
|
1442
1482
|
|
|
1443
1483
|
return risks;
|
|
@@ -1455,26 +1495,36 @@ export class SparcArchitecture extends SparcPhase {
|
|
|
1455
1495
|
**Style**: ${result.systemDesign.style}
|
|
1456
1496
|
**Layers**: ${result.systemDesign.layers.length}
|
|
1457
1497
|
|
|
1458
|
-
${result.systemDesign.layers
|
|
1498
|
+
${result.systemDesign.layers
|
|
1499
|
+
.map(
|
|
1500
|
+
(layer, index) => `
|
|
1459
1501
|
#### ${index + 1}. ${layer.name}
|
|
1460
1502
|
**Responsibility**: ${layer.responsibility}
|
|
1461
|
-
|
|
1503
|
+
`,
|
|
1504
|
+
)
|
|
1505
|
+
.join('\n')}
|
|
1462
1506
|
|
|
1463
1507
|
### Data Flow
|
|
1464
|
-
${result.systemDesign.dataFlow.map(flow => `- ${flow.from} → ${flow.to} (${flow.direction}): ${flow.dataType}`).join('\n')}
|
|
1508
|
+
${result.systemDesign.dataFlow.map((flow) => `- ${flow.from} → ${flow.to} (${flow.direction}): ${flow.dataType}`).join('\n')}
|
|
1465
1509
|
|
|
1466
1510
|
### Control Flow
|
|
1467
|
-
${result.systemDesign.controlFlow
|
|
1511
|
+
${result.systemDesign.controlFlow
|
|
1512
|
+
.map(
|
|
1513
|
+
(flow) => `
|
|
1468
1514
|
#### ${flow.layer}
|
|
1469
1515
|
- **Order**: ${flow.order}
|
|
1470
1516
|
- **Triggers**: ${flow.triggers.join(', ')}
|
|
1471
1517
|
- **Actions**: ${flow.actions.join(', ')}
|
|
1472
1518
|
- **Outcomes**: ${flow.outcomes.join(', ')}
|
|
1473
|
-
|
|
1519
|
+
`,
|
|
1520
|
+
)
|
|
1521
|
+
.join('\n')}
|
|
1474
1522
|
|
|
1475
1523
|
## Components
|
|
1476
1524
|
|
|
1477
|
-
${result.components
|
|
1525
|
+
${result.components
|
|
1526
|
+
.map(
|
|
1527
|
+
(component, index) => `
|
|
1478
1528
|
### ${index + 1}. ${component.name}
|
|
1479
1529
|
**Type**: ${component.type}
|
|
1480
1530
|
**Responsibility**: ${component.responsibility}
|
|
@@ -1482,44 +1532,58 @@ ${result.components.map((component, index) => `
|
|
|
1482
1532
|
**Dependencies**: ${component.dependencies.join(', ')}
|
|
1483
1533
|
**Patterns**: ${component.patterns.join(', ')}
|
|
1484
1534
|
**Complexity**: ${component.complexity}
|
|
1485
|
-
|
|
1535
|
+
`,
|
|
1536
|
+
)
|
|
1537
|
+
.join('\n')}
|
|
1486
1538
|
|
|
1487
1539
|
## Design Patterns
|
|
1488
1540
|
|
|
1489
|
-
${result.designPatterns
|
|
1541
|
+
${result.designPatterns
|
|
1542
|
+
.map(
|
|
1543
|
+
(pattern, index) => `
|
|
1490
1544
|
### ${index + 1}. ${pattern.name}
|
|
1491
1545
|
**Type**: ${pattern.type}
|
|
1492
1546
|
**Purpose**: ${pattern.purpose}
|
|
1493
1547
|
**Applicability**: ${pattern.applicability}
|
|
1494
1548
|
**Implementation**: ${pattern.implementation}
|
|
1495
1549
|
**Benefits**: ${pattern.benefits.join(', ')}
|
|
1496
|
-
|
|
1550
|
+
`,
|
|
1551
|
+
)
|
|
1552
|
+
.join('\n')}
|
|
1497
1553
|
|
|
1498
1554
|
## Data Model
|
|
1499
1555
|
|
|
1500
1556
|
### Entities
|
|
1501
|
-
${result.dataModel.entities
|
|
1557
|
+
${result.dataModel.entities
|
|
1558
|
+
.map(
|
|
1559
|
+
(entity, index) => `
|
|
1502
1560
|
#### ${index + 1}. ${entity.name}
|
|
1503
1561
|
**Primary Key**: ${entity.primaryKey}
|
|
1504
1562
|
**Attributes**:
|
|
1505
|
-
${entity.attributes.map(attr => `- ${attr.name}: ${attr.type}${attr.nullable ? '' : ' NOT NULL'}${attr.unique ? ' UNIQUE' : ''}${attr.default ? ` DEFAULT ${attr.default}` : ''}`).join('\n')}
|
|
1563
|
+
${entity.attributes.map((attr) => `- ${attr.name}: ${attr.type}${attr.nullable ? '' : ' NOT NULL'}${attr.unique ? ' UNIQUE' : ''}${attr.default ? ` DEFAULT ${attr.default}` : ''}`).join('\n')}
|
|
1506
1564
|
|
|
1507
1565
|
**Constraints**:
|
|
1508
|
-
${entity.constraints.map(constraint => `- ${constraint.name}: ${constraint.type}${constraint.condition ? ` (${constraint.condition})` : ''}`).join('\n')}
|
|
1566
|
+
${entity.constraints.map((constraint) => `- ${constraint.name}: ${constraint.type}${constraint.condition ? ` (${constraint.condition})` : ''}`).join('\n')}
|
|
1509
1567
|
|
|
1510
1568
|
**Indexes**:
|
|
1511
|
-
${entity.indexes.map(index => `- ${index.name}: ${index.type} (${index.columns.join(', ')})`).join('\n')}
|
|
1512
|
-
|
|
1569
|
+
${entity.indexes.map((index) => `- ${index.name}: ${index.type} (${index.columns.join(', ')})`).join('\n')}
|
|
1570
|
+
`,
|
|
1571
|
+
)
|
|
1572
|
+
.join('\n')}
|
|
1513
1573
|
|
|
1514
1574
|
### Relationships
|
|
1515
|
-
${result.dataModel.relationships
|
|
1575
|
+
${result.dataModel.relationships
|
|
1576
|
+
.map(
|
|
1577
|
+
(rel, index) => `
|
|
1516
1578
|
#### ${index + 1}. ${rel.name}
|
|
1517
1579
|
**Type**: ${rel.type}
|
|
1518
1580
|
**Parent**: ${rel.parent} (${rel.parentKey})
|
|
1519
1581
|
**Child**: ${rel.child} (${rel.childKey})
|
|
1520
1582
|
**On Delete**: ${rel.onDelete}
|
|
1521
1583
|
**On Update**: ${rel.onUpdate}
|
|
1522
|
-
|
|
1584
|
+
`,
|
|
1585
|
+
)
|
|
1586
|
+
.join('\n')}
|
|
1523
1587
|
|
|
1524
1588
|
## API Design
|
|
1525
1589
|
|
|
@@ -1529,33 +1593,52 @@ ${result.dataModel.relationships.map((rel, index) => `
|
|
|
1529
1593
|
**Authentication**: ${result.apiDesign.authentication}
|
|
1530
1594
|
|
|
1531
1595
|
### Endpoints
|
|
1532
|
-
${result.apiDesign.endpoints
|
|
1596
|
+
${result.apiDesign.endpoints
|
|
1597
|
+
.map(
|
|
1598
|
+
(endpoint, index) => `
|
|
1533
1599
|
#### ${index + 1}. ${endpoint.method} ${endpoint.path}
|
|
1534
1600
|
**Summary**: ${endpoint.summary}
|
|
1535
|
-
**Parameters**: ${endpoint.parameters ? endpoint.parameters.map(p => `${p.name} (${p.type})`).join(', ') : 'None'}
|
|
1601
|
+
**Parameters**: ${endpoint.parameters ? endpoint.parameters.map((p) => `${p.name} (${p.type})`).join(', ') : 'None'}
|
|
1536
1602
|
**Request Body**: ${endpoint.requestBody ? endpoint.requestBody.schema : 'None'}
|
|
1537
|
-
**Responses**: ${Object.entries(endpoint.responses)
|
|
1538
|
-
|
|
1603
|
+
**Responses**: ${Object.entries(endpoint.responses)
|
|
1604
|
+
.map(([code, resp]) => `${code}: ${resp.description}`)
|
|
1605
|
+
.join(', ')}
|
|
1606
|
+
`,
|
|
1607
|
+
)
|
|
1608
|
+
.join('\n')}
|
|
1539
1609
|
|
|
1540
1610
|
### Schemas
|
|
1541
|
-
${result.apiDesign.schemas
|
|
1611
|
+
${result.apiDesign.schemas
|
|
1612
|
+
.map(
|
|
1613
|
+
(schema, index) => `
|
|
1542
1614
|
#### ${index + 1}. ${schema.name}
|
|
1543
1615
|
**Type**: ${schema.type}
|
|
1544
1616
|
**Properties**:
|
|
1545
|
-
${Object.entries(schema.properties)
|
|
1617
|
+
${Object.entries(schema.properties)
|
|
1618
|
+
.map(
|
|
1619
|
+
([name, prop]) =>
|
|
1620
|
+
`- ${name}: ${prop.type}${prop.format ? ` (${prop.format})` : ''}${prop.enum ? ` [${prop.enum.join(', ')}]` : ''}`,
|
|
1621
|
+
)
|
|
1622
|
+
.join('\n')}
|
|
1546
1623
|
**Required**: ${schema.required ? schema.required.join(', ') : 'None'}
|
|
1547
|
-
|
|
1624
|
+
`,
|
|
1625
|
+
)
|
|
1626
|
+
.join('\n')}
|
|
1548
1627
|
|
|
1549
1628
|
## Deployment Architecture
|
|
1550
1629
|
|
|
1551
1630
|
### Environments
|
|
1552
|
-
${result.deploymentArchitecture.environments
|
|
1631
|
+
${result.deploymentArchitecture.environments
|
|
1632
|
+
.map(
|
|
1633
|
+
(env, index) => `
|
|
1553
1634
|
#### ${index + 1}. ${env.name}
|
|
1554
1635
|
**Purpose**: ${env.purpose}
|
|
1555
1636
|
**Resources**: ${env.resources}
|
|
1556
1637
|
**Database**: ${env.database}
|
|
1557
1638
|
**Monitoring**: ${env.monitoring}
|
|
1558
|
-
|
|
1639
|
+
`,
|
|
1640
|
+
)
|
|
1641
|
+
.join('\n')}
|
|
1559
1642
|
|
|
1560
1643
|
### Infrastructure
|
|
1561
1644
|
**Platform**: ${result.deploymentArchitecture.infrastructure.platform}
|
|
@@ -1596,14 +1679,22 @@ ${result.deploymentArchitecture.environments.map((env, index) => `
|
|
|
1596
1679
|
|
|
1597
1680
|
## Quality Attributes
|
|
1598
1681
|
|
|
1599
|
-
${Object.entries(result.qualityAttributes)
|
|
1682
|
+
${Object.entries(result.qualityAttributes)
|
|
1683
|
+
.map(
|
|
1684
|
+
([category, attributes]) => `
|
|
1600
1685
|
### ${category.charAt(0).toUpperCase() + category.slice(1)}
|
|
1601
|
-
${Object.entries(attributes)
|
|
1602
|
-
|
|
1686
|
+
${Object.entries(attributes)
|
|
1687
|
+
.map(([attr, desc]) => `- **${attr}**: ${desc}`)
|
|
1688
|
+
.join('\n')}
|
|
1689
|
+
`,
|
|
1690
|
+
)
|
|
1691
|
+
.join('\n')}
|
|
1603
1692
|
|
|
1604
1693
|
## Architectural Decisions
|
|
1605
1694
|
|
|
1606
|
-
${result.architecturalDecisions
|
|
1695
|
+
${result.architecturalDecisions
|
|
1696
|
+
.map(
|
|
1697
|
+
(decision, index) => `
|
|
1607
1698
|
### ${decision.id}: ${decision.title}
|
|
1608
1699
|
**Status**: ${decision.status}
|
|
1609
1700
|
**Context**: ${decision.context}
|
|
@@ -1612,11 +1703,15 @@ ${result.architecturalDecisions.map((decision, index) => `
|
|
|
1612
1703
|
**Negative Consequences**: ${decision.consequences.negative.join(', ')}
|
|
1613
1704
|
**Alternatives Considered**: ${decision.alternatives.join(', ')}
|
|
1614
1705
|
**Date**: ${decision.date}
|
|
1615
|
-
|
|
1706
|
+
`,
|
|
1707
|
+
)
|
|
1708
|
+
.join('\n')}
|
|
1616
1709
|
|
|
1617
1710
|
## Risk Assessment
|
|
1618
1711
|
|
|
1619
|
-
${result.riskAssessment
|
|
1712
|
+
${result.riskAssessment
|
|
1713
|
+
.map(
|
|
1714
|
+
(risk, index) => `
|
|
1620
1715
|
### ${risk.id}: ${risk.category}
|
|
1621
1716
|
**Description**: ${risk.description}
|
|
1622
1717
|
**Probability**: ${risk.probability}
|
|
@@ -1624,11 +1719,15 @@ ${result.riskAssessment.map((risk, index) => `
|
|
|
1624
1719
|
**Risk Level**: ${risk.riskLevel}
|
|
1625
1720
|
**Mitigation**: ${risk.mitigation.join(', ')}
|
|
1626
1721
|
**Monitoring**: ${risk.monitoring}
|
|
1627
|
-
|
|
1722
|
+
`,
|
|
1723
|
+
)
|
|
1724
|
+
.join('\n')}
|
|
1628
1725
|
|
|
1629
1726
|
## Integration Points
|
|
1630
1727
|
|
|
1631
|
-
${result.integrationPoints
|
|
1728
|
+
${result.integrationPoints
|
|
1729
|
+
.map(
|
|
1730
|
+
(integration, index) => `
|
|
1632
1731
|
### ${index + 1}. ${integration.name}
|
|
1633
1732
|
**Type**: ${integration.type}
|
|
1634
1733
|
**Purpose**: ${integration.purpose}
|
|
@@ -1637,7 +1736,9 @@ ${result.integrationPoints.map((integration, index) => `
|
|
|
1637
1736
|
**Data Format**: ${integration.dataFormat}
|
|
1638
1737
|
**Error Handling**: ${integration.errorHandling}
|
|
1639
1738
|
**Monitoring**: ${integration.monitoring}
|
|
1640
|
-
|
|
1739
|
+
`,
|
|
1740
|
+
)
|
|
1741
|
+
.join('\n')}
|
|
1641
1742
|
`;
|
|
1642
1743
|
|
|
1643
1744
|
// Save document
|
|
@@ -1646,4 +1747,4 @@ ${result.integrationPoints.map((integration, index) => `
|
|
|
1646
1747
|
}
|
|
1647
1748
|
}
|
|
1648
1749
|
|
|
1649
|
-
export default SparcArchitecture;
|
|
1750
|
+
export default SparcArchitecture;
|