claude-flow 2.0.0-alpha.60 → 2.0.0-alpha.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/sparc/analyzer.md +24 -77
- package/.claude/commands/sparc/architect.md +25 -76
- package/.claude/commands/sparc/batch-executor.md +28 -78
- package/.claude/commands/sparc/coder.md +28 -79
- package/.claude/commands/sparc/debugger.md +26 -76
- package/.claude/commands/sparc/designer.md +25 -75
- package/.claude/commands/sparc/documenter.md +26 -75
- package/.claude/commands/sparc/innovator.md +26 -76
- package/.claude/commands/sparc/memory-manager.md +28 -77
- package/.claude/commands/sparc/optimizer.md +26 -76
- package/.claude/commands/sparc/orchestrator.md +23 -74
- package/.claude/commands/sparc/researcher.md +26 -77
- package/.claude/commands/sparc/reviewer.md +26 -76
- package/.claude/commands/sparc/sparc-modes.md +38 -358
- package/.claude/commands/sparc/swarm-coordinator.md +28 -77
- package/.claude/commands/sparc/tdd.md +28 -78
- package/.claude/commands/sparc/tester.md +26 -76
- package/.claude/commands/sparc/workflow-manager.md +28 -77
- package/.claude/commands/swarm/analysis.md +14 -17
- package/.claude/commands/swarm/development.md +14 -16
- package/.claude/commands/swarm/examples.md +20 -53
- package/.claude/commands/swarm/maintenance.md +14 -17
- package/.claude/commands/swarm/optimization.md +15 -17
- package/.claude/commands/swarm/research.md +14 -17
- package/.claude/commands/swarm/testing.md +15 -17
- package/.claude/config.json +32 -11
- package/CHANGELOG.md +113 -0
- package/bin/claude-flow +1 -1
- package/dist/adapters/cliffy-node.d.ts.map +1 -1
- package/dist/adapters/cliffy-node.js +13 -7
- package/dist/adapters/cliffy-node.js.map +1 -1
- package/dist/agents/agent-manager.d.ts.map +1 -1
- package/dist/agents/agent-manager.js +77 -65
- package/dist/agents/agent-manager.js.map +1 -1
- package/dist/agents/agent-registry.d.ts.map +1 -1
- package/dist/agents/agent-registry.js +38 -30
- package/dist/agents/agent-registry.js.map +1 -1
- package/dist/api/claude-client.d.ts.map +1 -1
- package/dist/api/claude-client.js +22 -16
- package/dist/api/claude-client.js.map +1 -1
- package/dist/cli/agents/analyst.d.ts.map +1 -1
- package/dist/cli/agents/analyst.js +94 -114
- package/dist/cli/agents/analyst.js.map +1 -1
- package/dist/cli/agents/architect.d.ts.map +1 -1
- package/dist/cli/agents/architect.js +100 -114
- package/dist/cli/agents/architect.js.map +1 -1
- package/dist/cli/agents/base-agent.d.ts.map +1 -1
- package/dist/cli/agents/base-agent.js +27 -27
- package/dist/cli/agents/base-agent.js.map +1 -1
- package/dist/cli/agents/capabilities.d.ts.map +1 -1
- package/dist/cli/agents/capabilities.js +49 -51
- package/dist/cli/agents/capabilities.js.map +1 -1
- package/dist/cli/agents/coder.d.ts.map +1 -1
- package/dist/cli/agents/coder.js +92 -98
- package/dist/cli/agents/coder.js.map +1 -1
- package/dist/cli/agents/coordinator.d.ts.map +1 -1
- package/dist/cli/agents/coordinator.js +59 -64
- package/dist/cli/agents/coordinator.js.map +1 -1
- package/dist/cli/agents/hive-agents.d.ts.map +1 -1
- package/dist/cli/agents/hive-agents.js +22 -24
- package/dist/cli/agents/hive-agents.js.map +1 -1
- package/dist/cli/agents/index.d.ts.map +1 -1
- package/dist/cli/agents/index.js +17 -17
- package/dist/cli/agents/index.js.map +1 -1
- package/dist/cli/agents/researcher.d.ts.map +1 -1
- package/dist/cli/agents/researcher.js +41 -61
- package/dist/cli/agents/researcher.js.map +1 -1
- package/dist/cli/agents/tester.d.ts.map +1 -1
- package/dist/cli/agents/tester.js +78 -90
- package/dist/cli/agents/tester.js.map +1 -1
- package/dist/cli/cli-core.d.ts +4 -1
- package/dist/cli/cli-core.d.ts.map +1 -1
- package/dist/cli/cli-core.js +40 -39
- package/dist/cli/cli-core.js.map +1 -1
- package/dist/cli/command-registry.d.ts.map +1 -1
- package/dist/cli/command-registry.js +99 -74
- package/dist/cli/command-registry.js.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.d.ts.map +1 -1
- package/dist/cli/commands/advanced-memory-commands.js +49 -40
- package/dist/cli/commands/advanced-memory-commands.js.map +1 -1
- package/dist/cli/commands/agent-simple.d.ts +3 -0
- package/dist/cli/commands/agent-simple.d.ts.map +1 -1
- package/dist/cli/commands/agent-simple.js +30 -27
- package/dist/cli/commands/agent-simple.js.map +1 -1
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +53 -40
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/claude-api.js +4 -4
- package/dist/cli/commands/claude-api.js.map +1 -1
- package/dist/cli/commands/claude.d.ts.map +1 -1
- package/dist/cli/commands/claude.js +2 -2
- package/dist/cli/commands/claude.js.map +1 -1
- package/dist/cli/commands/config-integration.d.ts +7 -1
- package/dist/cli/commands/config-integration.d.ts.map +1 -1
- package/dist/cli/commands/config-integration.js +18 -9
- package/dist/cli/commands/config-integration.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +2 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/enterprise.d.ts.map +1 -1
- package/dist/cli/commands/enterprise.js +115 -95
- package/dist/cli/commands/enterprise.js.map +1 -1
- package/dist/cli/commands/help-new.d.ts +7 -0
- package/dist/cli/commands/help-new.d.ts.map +1 -0
- package/dist/cli/commands/help-new.js +236 -0
- package/dist/cli/commands/help-new.js.map +1 -0
- package/dist/cli/commands/help.d.ts +2 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +283 -133
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts +1 -1
- package/dist/cli/commands/hive-mind/index.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/index.js +1 -1
- package/dist/cli/commands/hive-mind/index.js.map +1 -1
- package/dist/cli/commands/hive-mind/init.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/init.js.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/optimize-memory.js +35 -26
- package/dist/cli/commands/hive-mind/optimize-memory.js.map +1 -1
- package/dist/cli/commands/hive-mind/pause.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/pause.js +8 -6
- package/dist/cli/commands/hive-mind/pause.js.map +1 -1
- package/dist/cli/commands/hive-mind/ps.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/ps.js +17 -12
- package/dist/cli/commands/hive-mind/ps.js.map +1 -1
- package/dist/cli/commands/hive-mind/resume.js +12 -10
- package/dist/cli/commands/hive-mind/resume.js.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/spawn.js +20 -11
- package/dist/cli/commands/hive-mind/spawn.js.map +1 -1
- package/dist/cli/commands/hive-mind/status.js +17 -22
- package/dist/cli/commands/hive-mind/status.js.map +1 -1
- package/dist/cli/commands/hive-mind/stop.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/stop.js +23 -15
- package/dist/cli/commands/hive-mind/stop.js.map +1 -1
- package/dist/cli/commands/hive-mind/task.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/task.js +25 -19
- package/dist/cli/commands/hive-mind/task.js.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.d.ts.map +1 -1
- package/dist/cli/commands/hive-mind/wizard.js +86 -68
- package/dist/cli/commands/hive-mind/wizard.js.map +1 -1
- package/dist/cli/commands/hive.js +73 -38
- package/dist/cli/commands/hive.js.map +1 -1
- package/dist/cli/commands/hook-validator.d.ts.map +1 -1
- package/dist/cli/commands/hook-validator.js +4 -2
- package/dist/cli/commands/hook-validator.js.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +8 -8
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +850 -784
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +8 -16
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/memory.d.ts.map +1 -1
- package/dist/cli/commands/memory.js +8 -8
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +3 -3
- package/dist/cli/commands/migrate.js.map +1 -1
- package/dist/cli/commands/monitor.d.ts.map +1 -1
- package/dist/cli/commands/monitor.js +50 -34
- package/dist/cli/commands/monitor.js.map +1 -1
- package/dist/cli/commands/ruv-swarm.d.ts +7 -1
- package/dist/cli/commands/ruv-swarm.d.ts.map +1 -1
- package/dist/cli/commands/ruv-swarm.js +6 -6
- package/dist/cli/commands/ruv-swarm.js.map +1 -1
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +22 -17
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/sparc.d.ts +1 -1
- package/dist/cli/commands/sparc.d.ts.map +1 -1
- package/dist/cli/commands/sparc.js +146 -126
- package/dist/cli/commands/sparc.js.map +1 -1
- package/dist/cli/commands/start/event-emitter.js +1 -1
- package/dist/cli/commands/start/event-emitter.js.map +1 -1
- package/dist/cli/commands/start/process-manager.d.ts.map +1 -1
- package/dist/cli/commands/start/process-manager.js +20 -18
- package/dist/cli/commands/start/process-manager.js.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.d.ts +4 -0
- package/dist/cli/commands/start/process-ui-simple.d.ts.map +1 -1
- package/dist/cli/commands/start/process-ui-simple.js +2 -2
- package/dist/cli/commands/start/process-ui-simple.js.map +1 -1
- package/dist/cli/commands/start/start-command.d.ts.map +1 -1
- package/dist/cli/commands/start/start-command.js +27 -15
- package/dist/cli/commands/start/start-command.js.map +1 -1
- package/dist/cli/commands/start/system-monitor.d.ts +3 -0
- package/dist/cli/commands/start/system-monitor.d.ts.map +1 -1
- package/dist/cli/commands/start/system-monitor.js +16 -18
- package/dist/cli/commands/start/system-monitor.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +28 -33
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/swarm-spawn.d.ts.map +1 -1
- package/dist/cli/commands/swarm-spawn.js +1 -1
- package/dist/cli/commands/swarm-spawn.js.map +1 -1
- package/dist/cli/commands/swarm.d.ts +4 -1
- package/dist/cli/commands/swarm.d.ts.map +1 -1
- package/dist/cli/commands/swarm.js +23 -18
- package/dist/cli/commands/swarm.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts.map +1 -1
- package/dist/cli/commands/workflow.js +49 -45
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/completion.d.ts +3 -0
- package/dist/cli/completion.d.ts.map +1 -1
- package/dist/cli/completion.js +15 -5
- package/dist/cli/completion.js.map +1 -1
- package/dist/cli/formatter.d.ts +3 -0
- package/dist/cli/formatter.d.ts.map +1 -1
- package/dist/cli/formatter.js +3 -3
- package/dist/cli/formatter.js.map +1 -1
- package/dist/cli/help-formatter.d.ts +49 -0
- package/dist/cli/help-formatter.d.ts.map +1 -0
- package/dist/cli/help-formatter.js +108 -0
- package/dist/cli/help-formatter.js.map +1 -0
- package/dist/cli/index-remote.d.ts +4 -0
- package/dist/cli/index-remote.d.ts.map +1 -1
- package/dist/cli/index-remote.js +1 -1
- package/dist/cli/index-remote.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +32 -34
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/batch-tools.d.ts.map +1 -1
- package/dist/cli/init/batch-tools.js.map +1 -1
- package/dist/cli/init/claude-config.d.ts.map +1 -1
- package/dist/cli/init/claude-config.js +111 -106
- package/dist/cli/init/claude-config.js.map +1 -1
- package/dist/cli/init/directory-structure.d.ts.map +1 -1
- package/dist/cli/init/directory-structure.js +3 -3
- package/dist/cli/init/directory-structure.js.map +1 -1
- package/dist/cli/init/index.d.ts.map +1 -1
- package/dist/cli/init/index.js +1 -1
- package/dist/cli/init/index.js.map +1 -1
- package/dist/cli/init/sparc-environment.d.ts.map +1 -1
- package/dist/cli/init/sparc-environment.js +69 -69
- package/dist/cli/init/sparc-environment.js.map +1 -1
- package/dist/cli/init/swarm-commands.d.ts.map +1 -1
- package/dist/cli/init/swarm-commands.js +1 -1
- package/dist/cli/init/swarm-commands.js.map +1 -1
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/node-compat.d.ts.map +1 -1
- package/dist/cli/node-compat.js +24 -18
- package/dist/cli/node-compat.js.map +1 -1
- package/dist/cli/node-repl.d.ts +4 -0
- package/dist/cli/node-repl.d.ts.map +1 -1
- package/dist/cli/node-repl.js +24 -30
- package/dist/cli/node-repl.js.map +1 -1
- package/dist/cli/repl.d.ts.map +1 -1
- package/dist/cli/repl.js +81 -70
- package/dist/cli/repl.js.map +1 -1
- package/dist/cli/runtime-detector.d.ts.map +1 -1
- package/dist/cli/runtime-detector.js +11 -7
- package/dist/cli/runtime-detector.js.map +1 -1
- package/dist/cli/simple-cli.d.ts +4 -0
- package/dist/cli/simple-cli.d.ts.map +1 -1
- package/dist/cli/simple-cli.js +109 -95
- package/dist/cli/simple-cli.js.map +1 -1
- package/dist/cli/simple-commands/analysis.d.ts.map +1 -1
- package/dist/cli/simple-commands/analysis.js +18 -11
- package/dist/cli/simple-commands/analysis.js.map +1 -1
- package/dist/cli/simple-commands/automation.js +32 -17
- package/dist/cli/simple-commands/automation.js.map +1 -1
- package/dist/cli/simple-commands/batch-manager.js +44 -39
- package/dist/cli/simple-commands/batch-manager.js.map +1 -1
- package/dist/cli/simple-commands/config.d.ts.map +1 -1
- package/dist/cli/simple-commands/config.js +22 -21
- package/dist/cli/simple-commands/config.js.map +1 -1
- package/dist/cli/simple-commands/coordination.d.ts.map +1 -1
- package/dist/cli/simple-commands/coordination.js +12 -12
- package/dist/cli/simple-commands/coordination.js.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.d.ts.map +1 -1
- package/dist/cli/simple-commands/fix-hook-variables.js +36 -30
- package/dist/cli/simple-commands/fix-hook-variables.js.map +1 -1
- package/dist/cli/simple-commands/github.d.ts.map +1 -1
- package/dist/cli/simple-commands/github.js +15 -15
- package/dist/cli/simple-commands/github.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js +12 -10
- package/dist/cli/simple-commands/hive-mind/auto-save-middleware.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/communication.js +42 -45
- package/dist/cli/simple-commands/hive-mind/communication.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/core.js +97 -89
- package/dist/cli/simple-commands/hive-mind/core.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js +114 -59
- package/dist/cli/simple-commands/hive-mind/db-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js +182 -103
- package/dist/cli/simple-commands/hive-mind/mcp-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/memory.js +105 -75
- package/dist/cli/simple-commands/hive-mind/memory.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js +45 -43
- package/dist/cli/simple-commands/hive-mind/performance-optimizer.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind/queen.js +101 -88
- package/dist/cli/simple-commands/hive-mind/queen.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind/session-manager.js +75 -53
- package/dist/cli/simple-commands/hive-mind/session-manager.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind-optimize.js +18 -18
- package/dist/cli/simple-commands/hive-mind-optimize.js.map +1 -1
- package/dist/cli/simple-commands/hive-mind.d.ts.map +1 -1
- package/dist/cli/simple-commands/hive-mind.js +207 -144
- package/dist/cli/simple-commands/hive-mind.js.map +1 -1
- package/dist/cli/simple-commands/hook-safety.d.ts.map +1 -1
- package/dist/cli/simple-commands/hook-safety.js +19 -19
- package/dist/cli/simple-commands/hook-safety.js.map +1 -1
- package/dist/cli/simple-commands/hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/hooks.js +85 -71
- package/dist/cli/simple-commands/hooks.js.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/batch-init.js +62 -55
- package/dist/cli/simple-commands/init/batch-init.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +2 -2
- package/dist/cli/simple-commands/init/claude-commands/optimized-slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +58 -50
- package/dist/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/slash-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js +34 -28
- package/dist/cli/simple-commands/init/claude-commands/sparc-commands.js.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/executable-wrapper.js +7 -4
- package/dist/cli/simple-commands/init/executable-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/gitignore-updater.js +10 -9
- package/dist/cli/simple-commands/init/gitignore-updater.js.map +1 -1
- package/dist/cli/simple-commands/init/help.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/help.js.map +1 -1
- package/dist/cli/simple-commands/init/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/index.js +159 -103
- package/dist/cli/simple-commands/init/index.js.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/performance-monitor.js +17 -18
- package/dist/cli/simple-commands/init/performance-monitor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/backup-manager.js +19 -25
- package/dist/cli/simple-commands/init/rollback/backup-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/index.js +18 -15
- package/dist/cli/simple-commands/init/rollback/index.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js +49 -68
- package/dist/cli/simple-commands/init/rollback/recovery-manager.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js +16 -24
- package/dist/cli/simple-commands/init/rollback/rollback-executor.js.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/rollback/state-tracker.js +25 -25
- package/dist/cli/simple-commands/init/rollback/state-tracker.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js +57 -57
- package/dist/cli/simple-commands/init/sparc/roomodes-config.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc/workflows.js +21 -21
- package/dist/cli/simple-commands/init/sparc/workflows.js.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js +1 -1
- package/dist/cli/simple-commands/init/sparc-structure.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js +69 -78
- package/dist/cli/simple-commands/init/templates/enhanced-templates.js.map +1 -1
- package/dist/cli/simple-commands/init/templates/sparc-modes.js +2 -2
- package/dist/cli/simple-commands/init/validation/config-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/config-validator.js +12 -16
- package/dist/cli/simple-commands/init/validation/config-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/health-checker.js +39 -41
- package/dist/cli/simple-commands/init/validation/health-checker.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/index.js +8 -8
- package/dist/cli/simple-commands/init/validation/index.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/mode-validator.js +12 -12
- package/dist/cli/simple-commands/init/validation/mode-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/post-init-validator.js +13 -13
- package/dist/cli/simple-commands/init/validation/post-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.d.ts.map +1 -1
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js +19 -24
- package/dist/cli/simple-commands/init/validation/pre-init-validator.js.map +1 -1
- package/dist/cli/simple-commands/mcp.js +2 -2
- package/dist/cli/simple-commands/mcp.js.map +1 -1
- package/dist/cli/simple-commands/memory.js +4 -4
- package/dist/cli/simple-commands/memory.js.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.d.ts.map +1 -1
- package/dist/cli/simple-commands/migrate-hooks.js +3 -3
- package/dist/cli/simple-commands/migrate-hooks.js.map +1 -1
- package/dist/cli/simple-commands/monitor.d.ts.map +1 -1
- package/dist/cli/simple-commands/monitor.js +34 -26
- package/dist/cli/simple-commands/monitor.js.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.d.ts.map +1 -1
- package/dist/cli/simple-commands/process-ui-enhanced.js +53 -39
- package/dist/cli/simple-commands/process-ui-enhanced.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/index.js +11 -11
- package/dist/cli/simple-commands/sparc-modes/index.js.map +1 -1
- package/dist/cli/simple-commands/sparc-modes/swarm.js +50 -50
- package/dist/cli/simple-commands/sparc.d.ts.map +1 -1
- package/dist/cli/simple-commands/sparc.js +21 -11
- package/dist/cli/simple-commands/sparc.js.map +1 -1
- package/dist/cli/simple-commands/start-ui.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-ui.js +5 -3
- package/dist/cli/simple-commands/start-ui.js.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.d.ts.map +1 -1
- package/dist/cli/simple-commands/start-wrapper.js +1 -1
- package/dist/cli/simple-commands/start-wrapper.js.map +1 -1
- package/dist/cli/simple-commands/status.js +14 -14
- package/dist/cli/simple-commands/status.js.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-executor.js +19 -19
- package/dist/cli/simple-commands/swarm-executor.js.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-metrics-integration.js +30 -21
- package/dist/cli/simple-commands/swarm-metrics-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm-webui-integration.js +30 -18
- package/dist/cli/simple-commands/swarm-webui-integration.js.map +1 -1
- package/dist/cli/simple-commands/swarm.d.ts +1 -1
- package/dist/cli/simple-commands/swarm.d.ts.map +1 -1
- package/dist/cli/simple-commands/swarm.js +81 -76
- package/dist/cli/simple-commands/swarm.js.map +1 -1
- package/dist/cli/simple-commands/training.d.ts.map +1 -1
- package/dist/cli/simple-commands/training.js +7 -7
- package/dist/cli/simple-commands/training.js.map +1 -1
- package/dist/cli/simple-commands/web-server.d.ts.map +1 -1
- package/dist/cli/simple-commands/web-server.js +68 -66
- package/dist/cli/simple-commands/web-server.js.map +1 -1
- package/dist/cli/simple-mcp.d.ts.map +1 -1
- package/dist/cli/simple-mcp.js +2 -4
- package/dist/cli/simple-mcp.js.map +1 -1
- package/dist/cli/simple-orchestrator.d.ts +3 -0
- package/dist/cli/simple-orchestrator.d.ts.map +1 -1
- package/dist/cli/simple-orchestrator.js +36 -35
- package/dist/cli/simple-orchestrator.js.map +1 -1
- package/dist/cli/ui/compatible-ui.d.ts +4 -0
- package/dist/cli/ui/compatible-ui.d.ts.map +1 -1
- package/dist/cli/ui/compatible-ui.js +9 -8
- package/dist/cli/ui/compatible-ui.js.map +1 -1
- package/dist/cli/ui/fallback-handler.d.ts.map +1 -1
- package/dist/cli/ui/fallback-handler.js +4 -4
- package/dist/cli/ui/fallback-handler.js.map +1 -1
- package/dist/cli/ui/index.d.ts +2 -2
- package/dist/cli/ui/index.d.ts.map +1 -1
- package/dist/cli/ui/index.js +3 -3
- package/dist/cli/ui/index.js.map +1 -1
- package/dist/cli/utils/environment-detector.d.ts.map +1 -1
- package/dist/cli/utils/environment-detector.js +13 -11
- package/dist/cli/utils/environment-detector.js.map +1 -1
- package/dist/cli/utils/interactive-detector.d.ts.map +1 -1
- package/dist/cli/utils/interactive-detector.js +1 -1
- package/dist/cli/utils/interactive-detector.js.map +1 -1
- package/dist/cli/utils/prompt-defaults.d.ts.map +1 -1
- package/dist/cli/utils/prompt-defaults.js +6 -7
- package/dist/cli/utils/prompt-defaults.js.map +1 -1
- package/dist/cli/utils/safe-interactive.d.ts.map +1 -1
- package/dist/cli/utils/safe-interactive.js +7 -6
- package/dist/cli/utils/safe-interactive.js.map +1 -1
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +58 -50
- package/dist/cli/utils.js.map +1 -1
- package/dist/cli/validation-helper.d.ts +27 -0
- package/dist/cli/validation-helper.d.ts.map +1 -0
- package/dist/cli/validation-helper.js +72 -0
- package/dist/cli/validation-helper.js.map +1 -0
- package/dist/communication/message-bus.d.ts.map +1 -1
- package/dist/communication/message-bus.js +80 -74
- package/dist/communication/message-bus.js.map +1 -1
- package/dist/config/config-manager.d.ts +3 -0
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +23 -6
- package/dist/config/config-manager.js.map +1 -1
- package/dist/config/ruv-swarm-config.d.ts +6 -0
- package/dist/config/ruv-swarm-config.d.ts.map +1 -1
- package/dist/config/ruv-swarm-config.js +37 -22
- package/dist/config/ruv-swarm-config.js.map +1 -1
- package/dist/config/ruv-swarm-integration.d.ts.map +1 -1
- package/dist/config/ruv-swarm-integration.js +21 -21
- package/dist/config/ruv-swarm-integration.js.map +1 -1
- package/dist/constants/agent-types.d.ts +4 -4
- package/dist/constants/agent-types.d.ts.map +1 -1
- package/dist/constants/agent-types.js +4 -4
- package/dist/constants/agent-types.js.map +1 -1
- package/dist/coordination/advanced-scheduler.d.ts.map +1 -1
- package/dist/coordination/advanced-scheduler.js +6 -10
- package/dist/coordination/advanced-scheduler.js.map +1 -1
- package/dist/coordination/advanced-task-executor.d.ts.map +1 -1
- package/dist/coordination/advanced-task-executor.js +33 -33
- package/dist/coordination/advanced-task-executor.js.map +1 -1
- package/dist/coordination/background-executor.d.ts.map +1 -1
- package/dist/coordination/background-executor.js +17 -16
- package/dist/coordination/background-executor.js.map +1 -1
- package/dist/coordination/circuit-breaker.d.ts.map +1 -1
- package/dist/coordination/circuit-breaker.js +3 -0
- package/dist/coordination/circuit-breaker.js.map +1 -1
- package/dist/coordination/conflict-resolution.d.ts.map +1 -1
- package/dist/coordination/conflict-resolution.js +10 -8
- package/dist/coordination/conflict-resolution.js.map +1 -1
- package/dist/coordination/dependency-graph.d.ts.map +1 -1
- package/dist/coordination/dependency-graph.js +4 -3
- package/dist/coordination/dependency-graph.js.map +1 -1
- package/dist/coordination/hive-orchestrator.d.ts.map +1 -1
- package/dist/coordination/hive-orchestrator.js +29 -25
- package/dist/coordination/hive-orchestrator.js.map +1 -1
- package/dist/coordination/hive-protocol.d.ts.map +1 -1
- package/dist/coordination/hive-protocol.js +22 -23
- package/dist/coordination/hive-protocol.js.map +1 -1
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/index.d.ts.map +1 -1
- package/dist/coordination/index.js +1 -1
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/load-balancer.d.ts.map +1 -1
- package/dist/coordination/load-balancer.js +55 -56
- package/dist/coordination/load-balancer.js.map +1 -1
- package/dist/coordination/manager.d.ts.map +1 -1
- package/dist/coordination/manager.js +2 -8
- package/dist/coordination/manager.js.map +1 -1
- package/dist/coordination/messaging.d.ts.map +1 -1
- package/dist/coordination/messaging.js +4 -4
- package/dist/coordination/messaging.js.map +1 -1
- package/dist/coordination/metrics.d.ts.map +1 -1
- package/dist/coordination/metrics.js +11 -9
- package/dist/coordination/metrics.js.map +1 -1
- package/dist/coordination/resources.d.ts.map +1 -1
- package/dist/coordination/resources.js +10 -6
- package/dist/coordination/resources.js.map +1 -1
- package/dist/coordination/scheduler.d.ts.map +1 -1
- package/dist/coordination/scheduler.js +4 -4
- package/dist/coordination/scheduler.js.map +1 -1
- package/dist/coordination/swarm-coordinator.d.ts.map +1 -1
- package/dist/coordination/swarm-coordinator.js +32 -34
- package/dist/coordination/swarm-coordinator.js.map +1 -1
- package/dist/coordination/swarm-monitor.d.ts.map +1 -1
- package/dist/coordination/swarm-monitor.js +17 -17
- package/dist/coordination/swarm-monitor.js.map +1 -1
- package/dist/coordination/work-stealing.d.ts.map +1 -1
- package/dist/coordination/work-stealing.js +3 -0
- package/dist/coordination/work-stealing.js.map +1 -1
- package/dist/core/config.d.ts +4 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -31
- package/dist/core/config.js.map +1 -1
- package/dist/core/event-bus.d.ts +3 -0
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/json-persistence.d.ts +3 -0
- package/dist/core/json-persistence.d.ts.map +1 -1
- package/dist/core/json-persistence.js +19 -23
- package/dist/core/json-persistence.js.map +1 -1
- package/dist/core/logger.d.ts +3 -0
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -6
- package/dist/core/logger.js.map +1 -1
- package/dist/core/orchestrator-fixed.d.ts.map +1 -1
- package/dist/core/orchestrator-fixed.js +4 -1
- package/dist/core/orchestrator-fixed.js.map +1 -1
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +66 -33
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/persistence.d.ts +3 -0
- package/dist/core/persistence.d.ts.map +1 -1
- package/dist/core/persistence.js +25 -19
- package/dist/core/persistence.js.map +1 -1
- package/dist/enterprise/analytics-manager.d.ts.map +1 -1
- package/dist/enterprise/analytics-manager.js +141 -134
- package/dist/enterprise/analytics-manager.js.map +1 -1
- package/dist/enterprise/audit-manager.d.ts.map +1 -1
- package/dist/enterprise/audit-manager.js +144 -122
- package/dist/enterprise/audit-manager.js.map +1 -1
- package/dist/enterprise/cloud-manager.d.ts.map +1 -1
- package/dist/enterprise/cloud-manager.js +104 -99
- package/dist/enterprise/cloud-manager.js.map +1 -1
- package/dist/enterprise/deployment-manager.d.ts.map +1 -1
- package/dist/enterprise/deployment-manager.js +104 -97
- package/dist/enterprise/deployment-manager.js.map +1 -1
- package/dist/enterprise/index.d.ts +6 -6
- package/dist/enterprise/index.d.ts.map +1 -1
- package/dist/enterprise/project-manager.d.ts.map +1 -1
- package/dist/enterprise/project-manager.js +74 -66
- package/dist/enterprise/project-manager.js.map +1 -1
- package/dist/enterprise/security-manager.d.ts.map +1 -1
- package/dist/enterprise/security-manager.js +137 -129
- package/dist/enterprise/security-manager.js.map +1 -1
- package/dist/hive-mind/core/Agent.d.ts.map +1 -1
- package/dist/hive-mind/core/Agent.js +36 -36
- package/dist/hive-mind/core/Agent.js.map +1 -1
- package/dist/hive-mind/core/Communication.d.ts.map +1 -1
- package/dist/hive-mind/core/Communication.js +17 -17
- package/dist/hive-mind/core/Communication.js.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.d.ts.map +1 -1
- package/dist/hive-mind/core/DatabaseManager.js +104 -58
- package/dist/hive-mind/core/DatabaseManager.js.map +1 -1
- package/dist/hive-mind/core/HiveMind.d.ts.map +1 -1
- package/dist/hive-mind/core/HiveMind.js +35 -35
- package/dist/hive-mind/core/HiveMind.js.map +1 -1
- package/dist/hive-mind/core/Memory.d.ts.map +1 -1
- package/dist/hive-mind/core/Memory.js +78 -71
- package/dist/hive-mind/core/Memory.js.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.d.ts.map +1 -1
- package/dist/hive-mind/core/MemoryMonitor.js +38 -38
- package/dist/hive-mind/core/MemoryMonitor.js.map +1 -1
- package/dist/hive-mind/core/Queen.d.ts.map +1 -1
- package/dist/hive-mind/core/Queen.js +110 -47
- package/dist/hive-mind/core/Queen.js.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.d.ts.map +1 -1
- package/dist/hive-mind/integration/ConsensusEngine.js +25 -23
- package/dist/hive-mind/integration/ConsensusEngine.js.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.d.ts.map +1 -1
- package/dist/hive-mind/integration/MCPToolWrapper.js.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.d.ts.map +1 -1
- package/dist/hive-mind/integration/SwarmOrchestrator.js +60 -58
- package/dist/hive-mind/integration/SwarmOrchestrator.js.map +1 -1
- package/dist/hive-mind/types.d.ts.map +1 -1
- package/dist/integration/mock-components.d.ts.map +1 -1
- package/dist/integration/mock-components.js +21 -21
- package/dist/integration/mock-components.js.map +1 -1
- package/dist/integration/system-integration.d.ts.map +1 -1
- package/dist/integration/system-integration.js +29 -12
- package/dist/integration/system-integration.js.map +1 -1
- package/dist/mcp/auth.d.ts +1 -1
- package/dist/mcp/auth.d.ts.map +1 -1
- package/dist/mcp/auth.js +8 -1
- package/dist/mcp/auth.js.map +1 -1
- package/dist/mcp/claude-code-wrapper.d.ts.map +1 -1
- package/dist/mcp/claude-code-wrapper.js +169 -68
- package/dist/mcp/claude-code-wrapper.js.map +1 -1
- package/dist/mcp/claude-flow-tools.d.ts.map +1 -1
- package/dist/mcp/claude-flow-tools.js +42 -3
- package/dist/mcp/claude-flow-tools.js.map +1 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/integrate-wrapper.d.ts.map +1 -1
- package/dist/mcp/integrate-wrapper.js +5 -7
- package/dist/mcp/integrate-wrapper.js.map +1 -1
- package/dist/mcp/lifecycle-manager.d.ts.map +1 -1
- package/dist/mcp/lifecycle-manager.js +8 -7
- package/dist/mcp/lifecycle-manager.js.map +1 -1
- package/dist/mcp/load-balancer.d.ts.map +1 -1
- package/dist/mcp/load-balancer.js +5 -1
- package/dist/mcp/load-balancer.js.map +1 -1
- package/dist/mcp/orchestration-integration.d.ts.map +1 -1
- package/dist/mcp/orchestration-integration.js +22 -9
- package/dist/mcp/orchestration-integration.js.map +1 -1
- package/dist/mcp/performance-monitor.d.ts.map +1 -1
- package/dist/mcp/performance-monitor.js +22 -19
- package/dist/mcp/performance-monitor.js.map +1 -1
- package/dist/mcp/protocol-manager.d.ts.map +1 -1
- package/dist/mcp/protocol-manager.js +8 -19
- package/dist/mcp/protocol-manager.js.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-health-monitor.js +5 -5
- package/dist/mcp/recovery/connection-health-monitor.js.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.d.ts +4 -0
- package/dist/mcp/recovery/connection-state-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/connection-state-manager.js +13 -13
- package/dist/mcp/recovery/connection-state-manager.js.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.d.ts.map +1 -1
- package/dist/mcp/recovery/fallback-coordinator.js +5 -5
- package/dist/mcp/recovery/fallback-coordinator.js.map +1 -1
- package/dist/mcp/recovery/index.d.ts +4 -4
- package/dist/mcp/recovery/index.d.ts.map +1 -1
- package/dist/mcp/recovery/index.js +4 -4
- package/dist/mcp/recovery/index.js.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/reconnection-manager.js +1 -1
- package/dist/mcp/recovery/reconnection-manager.js.map +1 -1
- package/dist/mcp/recovery/recovery-manager.d.ts.map +1 -1
- package/dist/mcp/recovery/recovery-manager.js +2 -4
- package/dist/mcp/recovery/recovery-manager.js.map +1 -1
- package/dist/mcp/router.d.ts.map +1 -1
- package/dist/mcp/router.js +3 -0
- package/dist/mcp/router.js.map +1 -1
- package/dist/mcp/ruv-swarm-tools.d.ts.map +1 -1
- package/dist/mcp/ruv-swarm-tools.js +132 -102
- package/dist/mcp/ruv-swarm-tools.js.map +1 -1
- package/dist/mcp/server-with-wrapper.d.ts +3 -0
- package/dist/mcp/server-with-wrapper.d.ts.map +1 -1
- package/dist/mcp/server-with-wrapper.js +2 -3
- package/dist/mcp/server-with-wrapper.js.map +1 -1
- package/dist/mcp/server-wrapper-mode.d.ts +5 -0
- package/dist/mcp/server-wrapper-mode.d.ts.map +1 -1
- package/dist/mcp/server-wrapper-mode.js +2 -3
- package/dist/mcp/server-wrapper-mode.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/session-manager.d.ts.map +1 -1
- package/dist/mcp/session-manager.js +4 -3
- package/dist/mcp/session-manager.js.map +1 -1
- package/dist/mcp/sparc-modes.d.ts.map +1 -1
- package/dist/mcp/sparc-modes.js +15 -15
- package/dist/mcp/sparc-modes.js.map +1 -1
- package/dist/mcp/swarm-tools.d.ts.map +1 -1
- package/dist/mcp/swarm-tools.js +100 -80
- package/dist/mcp/swarm-tools.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +28 -12
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transports/base.d.ts.map +1 -1
- package/dist/mcp/transports/base.js +3 -0
- package/dist/mcp/transports/base.js.map +1 -1
- package/dist/mcp/transports/http.d.ts +3 -0
- package/dist/mcp/transports/http.d.ts.map +1 -1
- package/dist/mcp/transports/http.js +3 -3
- package/dist/mcp/transports/http.js.map +1 -1
- package/dist/mcp/transports/stdio.d.ts +3 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -1
- package/dist/mcp/transports/stdio.js +3 -0
- package/dist/mcp/transports/stdio.js.map +1 -1
- package/dist/memory/advanced-memory-manager.d.ts.map +1 -1
- package/dist/memory/advanced-memory-manager.js +109 -100
- package/dist/memory/advanced-memory-manager.js.map +1 -1
- package/dist/memory/backends/base.d.ts.map +1 -1
- package/dist/memory/backends/base.js +3 -0
- package/dist/memory/backends/base.js.map +1 -1
- package/dist/memory/backends/markdown.d.ts +3 -0
- package/dist/memory/backends/markdown.d.ts.map +1 -1
- package/dist/memory/backends/markdown.js +8 -8
- package/dist/memory/backends/markdown.js.map +1 -1
- package/dist/memory/backends/sqlite.d.ts +3 -0
- package/dist/memory/backends/sqlite.d.ts.map +1 -1
- package/dist/memory/backends/sqlite.js +6 -2
- package/dist/memory/backends/sqlite.js.map +1 -1
- package/dist/memory/cache.d.ts.map +1 -1
- package/dist/memory/cache.js +5 -3
- package/dist/memory/cache.js.map +1 -1
- package/dist/memory/distributed-memory.d.ts.map +1 -1
- package/dist/memory/distributed-memory.js +27 -28
- package/dist/memory/distributed-memory.js.map +1 -1
- package/dist/memory/fallback-store.d.ts.map +1 -1
- package/dist/memory/fallback-store.js.map +1 -1
- package/dist/memory/in-memory-store.d.ts.map +1 -1
- package/dist/memory/in-memory-store.js +8 -8
- package/dist/memory/in-memory-store.js.map +1 -1
- package/dist/memory/indexer.d.ts.map +1 -1
- package/dist/memory/indexer.js +4 -1
- package/dist/memory/indexer.js.map +1 -1
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +17 -20
- package/dist/memory/manager.js.map +1 -1
- package/dist/memory/sqlite-store.js +12 -8
- package/dist/memory/sqlite-store.js.map +1 -1
- package/dist/memory/swarm-memory.d.ts.map +1 -1
- package/dist/memory/swarm-memory.js +37 -44
- package/dist/memory/swarm-memory.js.map +1 -1
- package/dist/migration/index.d.ts +4 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -8
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/logger.d.ts.map +1 -1
- package/dist/migration/logger.js +5 -5
- package/dist/migration/logger.js.map +1 -1
- package/dist/migration/migration-analyzer.d.ts +3 -0
- package/dist/migration/migration-analyzer.d.ts.map +1 -1
- package/dist/migration/migration-analyzer.js +25 -20
- package/dist/migration/migration-analyzer.js.map +1 -1
- package/dist/migration/migration-runner.d.ts.map +1 -1
- package/dist/migration/migration-runner.js +35 -29
- package/dist/migration/migration-runner.js.map +1 -1
- package/dist/migration/migration-validator.d.ts +3 -0
- package/dist/migration/migration-validator.d.ts.map +1 -1
- package/dist/migration/migration-validator.js +22 -26
- package/dist/migration/migration-validator.js.map +1 -1
- package/dist/migration/progress-reporter.d.ts +3 -0
- package/dist/migration/progress-reporter.d.ts.map +1 -1
- package/dist/migration/progress-reporter.js +8 -8
- package/dist/migration/progress-reporter.js.map +1 -1
- package/dist/migration/rollback-manager.d.ts +3 -0
- package/dist/migration/rollback-manager.d.ts.map +1 -1
- package/dist/migration/rollback-manager.js +29 -26
- package/dist/migration/rollback-manager.js.map +1 -1
- package/dist/monitoring/diagnostics.d.ts.map +1 -1
- package/dist/monitoring/diagnostics.js +49 -37
- package/dist/monitoring/diagnostics.js.map +1 -1
- package/dist/monitoring/health-check.d.ts.map +1 -1
- package/dist/monitoring/health-check.js +24 -25
- package/dist/monitoring/health-check.js.map +1 -1
- package/dist/monitoring/real-time-monitor.d.ts.map +1 -1
- package/dist/monitoring/real-time-monitor.js +71 -58
- package/dist/monitoring/real-time-monitor.js.map +1 -1
- package/dist/resources/resource-manager.d.ts.map +1 -1
- package/dist/resources/resource-manager.js +96 -83
- package/dist/resources/resource-manager.js.map +1 -1
- package/dist/swarm/claude-flow-executor.d.ts.map +1 -1
- package/dist/swarm/claude-flow-executor.js +37 -31
- package/dist/swarm/claude-flow-executor.js.map +1 -1
- package/dist/swarm/coordinator.d.ts.map +1 -1
- package/dist/swarm/coordinator.js +330 -280
- package/dist/swarm/coordinator.js.map +1 -1
- package/dist/swarm/direct-executor.d.ts.map +1 -1
- package/dist/swarm/direct-executor.js +44 -37
- package/dist/swarm/direct-executor.js.map +1 -1
- package/dist/swarm/executor-v2.d.ts.map +1 -1
- package/dist/swarm/executor-v2.js +28 -27
- package/dist/swarm/executor-v2.js.map +1 -1
- package/dist/swarm/executor.d.ts +3 -0
- package/dist/swarm/executor.d.ts.map +1 -1
- package/dist/swarm/executor.js +58 -52
- package/dist/swarm/executor.js.map +1 -1
- package/dist/swarm/index.d.ts.map +1 -1
- package/dist/swarm/index.js +2 -2
- package/dist/swarm/index.js.map +1 -1
- package/dist/swarm/json-output-aggregator.d.ts.map +1 -1
- package/dist/swarm/json-output-aggregator.js +20 -19
- package/dist/swarm/json-output-aggregator.js.map +1 -1
- package/dist/swarm/memory.d.ts.map +1 -1
- package/dist/swarm/memory.js +67 -67
- package/dist/swarm/memory.js.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.d.ts +4 -0
- package/dist/swarm/optimizations/async-file-manager.d.ts.map +1 -1
- package/dist/swarm/optimizations/async-file-manager.js +19 -23
- package/dist/swarm/optimizations/async-file-manager.js.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.d.ts.map +1 -1
- package/dist/swarm/optimizations/circular-buffer.js +2 -4
- package/dist/swarm/optimizations/circular-buffer.js.map +1 -1
- package/dist/swarm/optimizations/connection-pool.d.ts.map +1 -1
- package/dist/swarm/optimizations/connection-pool.js +12 -13
- package/dist/swarm/optimizations/connection-pool.js.map +1 -1
- package/dist/swarm/optimizations/index.js +2 -2
- package/dist/swarm/optimizations/optimized-executor.d.ts.map +1 -1
- package/dist/swarm/optimizations/optimized-executor.js +23 -29
- package/dist/swarm/optimizations/optimized-executor.js.map +1 -1
- package/dist/swarm/optimizations/ttl-map.d.ts.map +1 -1
- package/dist/swarm/optimizations/ttl-map.js +4 -4
- package/dist/swarm/optimizations/ttl-map.js.map +1 -1
- package/dist/swarm/prompt-cli.d.ts.map +1 -1
- package/dist/swarm/prompt-cli.js +18 -13
- package/dist/swarm/prompt-cli.js.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.d.ts.map +1 -1
- package/dist/swarm/prompt-copier-enhanced.js +12 -12
- package/dist/swarm/prompt-copier-enhanced.js.map +1 -1
- package/dist/swarm/prompt-copier.d.ts.map +1 -1
- package/dist/swarm/prompt-copier.js +15 -18
- package/dist/swarm/prompt-copier.js.map +1 -1
- package/dist/swarm/prompt-manager.d.ts.map +1 -1
- package/dist/swarm/prompt-manager.js +27 -21
- package/dist/swarm/prompt-manager.js.map +1 -1
- package/dist/swarm/prompt-utils.d.ts.map +1 -1
- package/dist/swarm/prompt-utils.js +34 -32
- package/dist/swarm/prompt-utils.js.map +1 -1
- package/dist/swarm/sparc-executor.d.ts.map +1 -1
- package/dist/swarm/sparc-executor.js +189 -123
- package/dist/swarm/sparc-executor.js.map +1 -1
- package/dist/swarm/strategies/auto.d.ts.map +1 -1
- package/dist/swarm/strategies/auto.js +105 -86
- package/dist/swarm/strategies/auto.js.map +1 -1
- package/dist/swarm/strategies/base.d.ts.map +1 -1
- package/dist/swarm/strategies/base.js +14 -11
- package/dist/swarm/strategies/base.js.map +1 -1
- package/dist/swarm/strategies/research.d.ts.map +1 -1
- package/dist/swarm/strategies/research.js +76 -71
- package/dist/swarm/strategies/research.js.map +1 -1
- package/dist/swarm/types.d.ts.map +1 -1
- package/dist/swarm/types.js +3 -0
- package/dist/swarm/types.js.map +1 -1
- package/dist/swarm/workers/copy-worker.js +4 -4
- package/dist/swarm/workers/copy-worker.js.map +1 -1
- package/dist/task/commands.d.ts.map +1 -1
- package/dist/task/commands.js +11 -7
- package/dist/task/commands.js.map +1 -1
- package/dist/task/coordination.d.ts.map +1 -1
- package/dist/task/coordination.js +75 -70
- package/dist/task/coordination.js.map +1 -1
- package/dist/task/engine.d.ts.map +1 -1
- package/dist/task/engine.js +34 -32
- package/dist/task/engine.js.map +1 -1
- package/dist/task/index.d.ts +3 -3
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/index.js +11 -11
- package/dist/task/index.js.map +1 -1
- package/dist/terminal/adapters/native.d.ts.map +1 -1
- package/dist/terminal/adapters/native.js +6 -6
- package/dist/terminal/adapters/native.js.map +1 -1
- package/dist/terminal/adapters/vscode.d.ts +3 -0
- package/dist/terminal/adapters/vscode.d.ts.map +1 -1
- package/dist/terminal/adapters/vscode.js +6 -4
- package/dist/terminal/adapters/vscode.js.map +1 -1
- package/dist/terminal/manager.d.ts.map +1 -1
- package/dist/terminal/manager.js +6 -8
- package/dist/terminal/manager.js.map +1 -1
- package/dist/terminal/pool.d.ts.map +1 -1
- package/dist/terminal/pool.js +3 -0
- package/dist/terminal/pool.js.map +1 -1
- package/dist/terminal/session.d.ts.map +1 -1
- package/dist/terminal/session.js +6 -2
- package/dist/terminal/session.js.map +1 -1
- package/dist/ui/hive-dashboard.d.ts.map +1 -1
- package/dist/ui/hive-dashboard.js +52 -33
- package/dist/ui/hive-dashboard.js.map +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/helpers.d.ts +3 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +5 -8
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/npx-isolated-cache.js +3 -3
- package/dist/utils/npx-isolated-cache.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +8 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/type-guards.d.ts +1 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/dist/utils/type-guards.js +11 -10
- package/dist/utils/type-guards.js.map +1 -1
- package/package.json +7 -6
- package/src/adapters/cliffy-node.ts +27 -22
- package/src/agents/agent-manager.ts +145 -121
- package/src/agents/agent-registry.ts +77 -70
- package/src/api/claude-client.ts +59 -38
- package/src/api/routes/analysis.js +750 -735
- package/src/cli/__tests__/command-registry.test.js +42 -32
- package/src/cli/__tests__/simple-cli.test.js +42 -37
- package/src/cli/__tests__/utils.test.js +9 -9
- package/src/cli/agents/README.md +30 -4
- package/src/cli/agents/analyst.ts +161 -163
- package/src/cli/agents/architect.ts +126 -131
- package/src/cli/agents/base-agent.ts +48 -47
- package/src/cli/agents/capabilities.ts +87 -85
- package/src/cli/agents/coder.ts +127 -120
- package/src/cli/agents/coordinator.ts +72 -72
- package/src/cli/agents/hive-agents.ts +96 -70
- package/src/cli/agents/index.ts +70 -55
- package/src/cli/agents/researcher.ts +63 -74
- package/src/cli/agents/tester.ts +91 -98
- package/src/cli/cli-core.ts +56 -47
- package/src/cli/command-registry.js +125 -83
- package/src/cli/commands/advanced-memory-commands.ts +210 -142
- package/src/cli/commands/agent-simple.ts +146 -114
- package/src/cli/commands/agent.ts +119 -95
- package/src/cli/commands/claude-api.ts +19 -15
- package/src/cli/commands/claude.ts +96 -88
- package/src/cli/commands/config-integration.ts +120 -101
- package/src/cli/commands/config.ts +10 -8
- package/src/cli/commands/enterprise.ts +323 -187
- package/src/cli/commands/help-new.ts +246 -0
- package/src/cli/commands/help.ts +326 -183
- package/src/cli/commands/hive-mind/index.ts +3 -3
- package/src/cli/commands/hive-mind/init.ts +19 -12
- package/src/cli/commands/hive-mind/optimize-memory.ts +83 -53
- package/src/cli/commands/hive-mind/pause.ts +27 -25
- package/src/cli/commands/hive-mind/ps.ts +43 -37
- package/src/cli/commands/hive-mind/resume.ts +26 -26
- package/src/cli/commands/hive-mind/spawn.ts +37 -29
- package/src/cli/commands/hive-mind/status.ts +51 -51
- package/src/cli/commands/hive-mind/stop.ts +56 -51
- package/src/cli/commands/hive-mind/task.ts +65 -54
- package/src/cli/commands/hive-mind/wizard.ts +181 -167
- package/src/cli/commands/hive.ts +136 -96
- package/src/cli/commands/hook-types.ts +2 -2
- package/src/cli/commands/hook-validator.ts +8 -4
- package/src/cli/commands/hook.ts +44 -42
- package/src/cli/commands/index.ts +1162 -1031
- package/src/cli/commands/mcp.ts +105 -94
- package/src/cli/commands/memory.ts +24 -21
- package/src/cli/commands/migrate.ts +24 -24
- package/src/cli/commands/monitor.ts +123 -93
- package/src/cli/commands/ruv-swarm.ts +131 -122
- package/src/cli/commands/session.ts +60 -45
- package/src/cli/commands/sparc.ts +170 -139
- package/src/cli/commands/start/event-emitter.ts +2 -2
- package/src/cli/commands/start/index.ts +1 -1
- package/src/cli/commands/start/process-manager.ts +30 -47
- package/src/cli/commands/start/process-ui-simple.ts +60 -49
- package/src/cli/commands/start/process-ui.ts +1 -1
- package/src/cli/commands/start/start-command.ts +104 -75
- package/src/cli/commands/start/system-monitor.ts +35 -41
- package/src/cli/commands/start/types.ts +3 -3
- package/src/cli/commands/start.ts +1 -1
- package/src/cli/commands/status.ts +67 -67
- package/src/cli/commands/swarm-spawn.ts +21 -12
- package/src/cli/commands/swarm.ts +221 -150
- package/src/cli/commands/task.ts +55 -55
- package/src/cli/commands/workflow.ts +174 -157
- package/src/cli/completion.ts +34 -19
- package/src/cli/create-enhanced-task.js +49 -17
- package/src/cli/formatter.ts +38 -37
- package/src/cli/help-formatter.js +145 -0
- package/src/cli/help-formatter.ts +173 -0
- package/src/cli/help-text.js +273 -6
- package/src/cli/index-remote.ts +12 -9
- package/src/cli/index.ts +77 -67
- package/src/cli/init/batch-tools.ts +4 -5
- package/src/cli/init/claude-config.ts +125 -118
- package/src/cli/init/directory-structure.ts +10 -11
- package/src/cli/init/index.ts +13 -13
- package/src/cli/init/sparc-environment.ts +90 -74
- package/src/cli/init/swarm-commands.ts +5 -6
- package/src/cli/init/utils.ts +1 -1
- package/src/cli/main.ts +9 -10
- package/src/cli/node-compat.js +26 -19
- package/src/cli/node-repl.ts +104 -87
- package/src/cli/repl.ts +190 -158
- package/src/cli/runtime-detector.js +24 -19
- package/src/cli/simple-cli.js +479 -394
- package/src/cli/simple-cli.ts +426 -366
- package/src/cli/simple-commands/__tests__/agent.test.js +49 -55
- package/src/cli/simple-commands/__tests__/memory.test.js +4 -401
- package/src/cli/simple-commands/__tests__/swarm.test.js +49 -55
- package/src/cli/simple-commands/__tests__/task.test.js +4 -478
- package/src/cli/simple-commands/agent.js +27 -27
- package/src/cli/simple-commands/analysis.js +179 -161
- package/src/cli/simple-commands/automation.js +226 -205
- package/src/cli/simple-commands/batch-manager.js +98 -88
- package/src/cli/simple-commands/config.js +65 -60
- package/src/cli/simple-commands/coordination.js +197 -185
- package/src/cli/simple-commands/enhanced-ui-views.js +142 -115
- package/src/cli/simple-commands/enhanced-webui-complete.js +267 -167
- package/src/cli/simple-commands/fix-hook-variables.js +73 -67
- package/src/cli/simple-commands/github/gh-coordinator.js +63 -53
- package/src/cli/simple-commands/github/github-api.js +45 -47
- package/src/cli/simple-commands/github.js +33 -34
- package/src/cli/simple-commands/hive-mind/auto-save-middleware.js +44 -40
- package/src/cli/simple-commands/hive-mind/communication.js +198 -185
- package/src/cli/simple-commands/hive-mind/core.js +289 -304
- package/src/cli/simple-commands/hive-mind/db-optimizer.js +278 -168
- package/src/cli/simple-commands/hive-mind/mcp-wrapper.js +352 -258
- package/src/cli/simple-commands/hive-mind/memory.js +356 -287
- package/src/cli/simple-commands/hive-mind/performance-optimizer.js +88 -79
- package/src/cli/simple-commands/hive-mind/performance-test.js +61 -49
- package/src/cli/simple-commands/hive-mind/queen.js +223 -213
- package/src/cli/simple-commands/hive-mind/session-manager.js +217 -157
- package/src/cli/simple-commands/hive-mind-optimize.js +69 -65
- package/src/cli/simple-commands/hive-mind-wizard.js +213 -211
- package/src/cli/simple-commands/hive-mind.js +602 -435
- package/src/cli/simple-commands/hive.js +12 -12
- package/src/cli/simple-commands/hook-safety.js +114 -111
- package/src/cli/simple-commands/hooks.js +1077 -1017
- package/src/cli/simple-commands/init/README.md +8 -1
- package/src/cli/simple-commands/init/VALIDATION_ROLLBACK.md +27 -1
- package/src/cli/simple-commands/init/batch-init.js +105 -100
- package/src/cli/simple-commands/init/claude-commands/claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-claude-flow-commands.js +6 -6
- package/src/cli/simple-commands/init/claude-commands/optimized-slash-commands.js +20 -18
- package/src/cli/simple-commands/init/claude-commands/optimized-sparc-commands.js +85 -71
- package/src/cli/simple-commands/init/claude-commands/slash-commands.js +6 -7
- package/src/cli/simple-commands/init/claude-commands/sparc-commands.js +42 -33
- package/src/cli/simple-commands/init/executable-wrapper.js +13 -10
- package/src/cli/simple-commands/init/gitignore-updater.js +22 -22
- package/src/cli/simple-commands/init/help.js +4 -2
- package/src/cli/simple-commands/init/index.js +405 -303
- package/src/cli/simple-commands/init/performance-monitor.js +71 -64
- package/src/cli/simple-commands/init/rollback/backup-manager.js +44 -64
- package/src/cli/simple-commands/init/rollback/index.js +31 -39
- package/src/cli/simple-commands/init/rollback/recovery-manager.js +71 -101
- package/src/cli/simple-commands/init/rollback/rollback-executor.js +34 -53
- package/src/cli/simple-commands/init/rollback/state-tracker.js +38 -49
- package/src/cli/simple-commands/init/sparc/roo-readme.js +1 -1
- package/src/cli/simple-commands/init/sparc/roomodes-config.js +99 -77
- package/src/cli/simple-commands/init/sparc/workflows.js +37 -33
- package/src/cli/simple-commands/init/sparc-structure.js +9 -10
- package/src/cli/simple-commands/init/templates/CLAUDE.md +94 -26
- package/src/cli/simple-commands/init/templates/claude-flow-universal +9 -7
- package/src/cli/simple-commands/init/templates/claude-md.js +1 -1
- package/src/cli/simple-commands/init/templates/commands/analysis/bottleneck-detect.md +15 -3
- package/src/cli/simple-commands/init/templates/commands/automation/auto-agent.md +12 -2
- package/src/cli/simple-commands/init/templates/commands/coordination/swarm-init.md +10 -1
- package/src/cli/simple-commands/init/templates/commands/github/github-swarm.md +18 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/notification.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/post-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-command.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-edit.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-search.md +13 -6
- package/src/cli/simple-commands/init/templates/commands/hooks/pre-task.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-end.md +12 -1
- package/src/cli/simple-commands/init/templates/commands/hooks/session-restore.md +13 -5
- package/src/cli/simple-commands/init/templates/commands/hooks/session-start.md +12 -1
- package/src/cli/simple-commands/init/templates/coordination-md.js +1 -1
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +116 -113
- package/src/cli/simple-commands/init/templates/memory-bank-md.js +1 -1
- package/src/cli/simple-commands/init/templates/readme-files.js +1 -1
- package/src/cli/simple-commands/init/templates/safe-hook-patterns.js +176 -127
- package/src/cli/simple-commands/init/templates/settings.json +2 -5
- package/src/cli/simple-commands/init/templates/sparc-modes.js +3 -3
- package/src/cli/simple-commands/init/validation/config-validator.js +17 -28
- package/src/cli/simple-commands/init/validation/health-checker.js +54 -62
- package/src/cli/simple-commands/init/validation/index.js +18 -23
- package/src/cli/simple-commands/init/validation/mode-validator.js +22 -32
- package/src/cli/simple-commands/init/validation/post-init-validator.js +25 -26
- package/src/cli/simple-commands/init/validation/pre-init-validator.js +32 -36
- package/src/cli/simple-commands/init/validation/test-runner.js +55 -63
- package/src/cli/simple-commands/init.js +1 -1
- package/src/cli/simple-commands/mcp-integration-layer.js +179 -110
- package/src/cli/simple-commands/mcp.js +55 -48
- package/src/cli/simple-commands/memory.js +62 -56
- package/src/cli/simple-commands/migrate-hooks.js +9 -10
- package/src/cli/simple-commands/monitor.js +87 -67
- package/src/cli/simple-commands/process-ui-enhanced.js +207 -155
- package/src/cli/simple-commands/process-ui.js +65 -56
- package/src/cli/simple-commands/realtime-update-system.js +136 -129
- package/src/cli/simple-commands/sparc/architecture.js +352 -251
- package/src/cli/simple-commands/sparc/commands.js +122 -94
- package/src/cli/simple-commands/sparc/completion.js +274 -199
- package/src/cli/simple-commands/sparc/coordinator.js +217 -169
- package/src/cli/simple-commands/sparc/index.js +40 -36
- package/src/cli/simple-commands/sparc/phase-base.js +72 -58
- package/src/cli/simple-commands/sparc/pseudocode.js +275 -159
- package/src/cli/simple-commands/sparc/refinement.js +306 -212
- package/src/cli/simple-commands/sparc/specification.js +164 -94
- package/src/cli/simple-commands/sparc-modes/architect.js +1 -1
- package/src/cli/simple-commands/sparc-modes/ask.js +1 -1
- package/src/cli/simple-commands/sparc-modes/code.js +1 -1
- package/src/cli/simple-commands/sparc-modes/debug.js +1 -1
- package/src/cli/simple-commands/sparc-modes/devops.js +1 -1
- package/src/cli/simple-commands/sparc-modes/docs-writer.js +1 -1
- package/src/cli/simple-commands/sparc-modes/generic.js +1 -1
- package/src/cli/simple-commands/sparc-modes/index.js +15 -15
- package/src/cli/simple-commands/sparc-modes/integration.js +1 -1
- package/src/cli/simple-commands/sparc-modes/mcp.js +1 -1
- package/src/cli/simple-commands/sparc-modes/monitoring.js +1 -1
- package/src/cli/simple-commands/sparc-modes/optimization.js +1 -1
- package/src/cli/simple-commands/sparc-modes/security-review.js +1 -1
- package/src/cli/simple-commands/sparc-modes/sparc-orchestrator.js +1 -1
- package/src/cli/simple-commands/sparc-modes/spec-pseudocode.js +1 -1
- package/src/cli/simple-commands/sparc-modes/supabase-admin.js +1 -1
- package/src/cli/simple-commands/sparc-modes/swarm.js +52 -52
- package/src/cli/simple-commands/sparc-modes/tdd.js +1 -1
- package/src/cli/simple-commands/sparc-modes/tutorial.js +1 -1
- package/src/cli/simple-commands/sparc.js +87 -69
- package/src/cli/simple-commands/start-ui.js +21 -20
- package/src/cli/simple-commands/start-wrapper.js +29 -31
- package/src/cli/simple-commands/start.js +1 -1
- package/src/cli/simple-commands/status.js +53 -47
- package/src/cli/simple-commands/swarm-executor.js +47 -57
- package/src/cli/simple-commands/swarm-metrics-integration.js +119 -79
- package/src/cli/simple-commands/swarm-ui.js +120 -118
- package/src/cli/simple-commands/swarm-webui-integration.js +48 -27
- package/src/cli/simple-commands/swarm.js +216 -181
- package/src/cli/simple-commands/task.js +29 -29
- package/src/cli/simple-commands/timestamp-fix.js +28 -25
- package/src/cli/simple-commands/tool-execution-framework.js +115 -118
- package/src/cli/simple-commands/training.js +219 -194
- package/src/cli/simple-commands/web-server.js +118 -117
- package/src/cli/simple-commands/webui-validator.js +4 -3
- package/src/cli/simple-mcp.ts +14 -17
- package/src/cli/simple-orchestrator.ts +113 -101
- package/src/cli/swarm-standalone.js +20 -21
- package/src/cli/ui/compatible-ui.ts +55 -44
- package/src/cli/ui/fallback-handler.ts +19 -16
- package/src/cli/ui/index.ts +14 -15
- package/src/cli/utils/environment-detector.ts +75 -67
- package/src/cli/utils/interactive-detector.js +17 -11
- package/src/cli/utils/prompt-defaults.ts +32 -28
- package/src/cli/utils/safe-interactive.js +21 -20
- package/src/cli/utils.js +127 -110
- package/src/cli/validation-helper.js +113 -0
- package/src/cli/validation-helper.ts +128 -0
- package/src/communication/message-bus.ts +137 -124
- package/src/config/config-manager.ts +62 -30
- package/src/config/ruv-swarm-config.ts +105 -86
- package/src/config/ruv-swarm-integration.ts +38 -38
- package/src/constants/agent-types.ts +9 -8
- package/src/coordination/README.md +54 -31
- package/src/coordination/advanced-scheduler.ts +23 -26
- package/src/coordination/advanced-task-executor.ts +74 -68
- package/src/coordination/background-executor.ts +33 -30
- package/src/coordination/circuit-breaker.ts +26 -27
- package/src/coordination/conflict-resolution.ts +18 -27
- package/src/coordination/dependency-graph.ts +15 -18
- package/src/coordination/hive-orchestrator.ts +111 -81
- package/src/coordination/hive-protocol.ts +68 -77
- package/src/coordination/index.ts +3 -7
- package/src/coordination/load-balancer.ts +115 -105
- package/src/coordination/manager.ts +38 -51
- package/src/coordination/messaging.ts +19 -29
- package/src/coordination/metrics.ts +57 -60
- package/src/coordination/resources.ts +32 -37
- package/src/coordination/scheduler.ts +29 -30
- package/src/coordination/swarm-coordinator.ts +81 -70
- package/src/coordination/swarm-monitor.ts +90 -69
- package/src/coordination/work-stealing.ts +6 -13
- package/src/core/config.ts +148 -143
- package/src/core/event-bus.ts +5 -6
- package/src/core/json-persistence.ts +27 -34
- package/src/core/logger.ts +13 -16
- package/src/core/orchestrator-fixed.ts +33 -32
- package/src/core/orchestrator.ts +166 -159
- package/src/core/persistence.ts +47 -36
- package/src/enterprise/analytics-manager.ts +242 -233
- package/src/enterprise/audit-manager.ts +238 -184
- package/src/enterprise/cloud-manager.ts +167 -151
- package/src/enterprise/deployment-manager.ts +223 -180
- package/src/enterprise/index.ts +7 -7
- package/src/enterprise/project-manager.ts +151 -133
- package/src/enterprise/security-manager.ts +278 -223
- package/src/hive-mind/core/Agent.ts +112 -109
- package/src/hive-mind/core/Communication.ts +67 -69
- package/src/hive-mind/core/DatabaseManager.ts +299 -166
- package/src/hive-mind/core/HiveMind.ts +100 -96
- package/src/hive-mind/core/Memory.ts +304 -295
- package/src/hive-mind/core/MemoryMonitor.ts +46 -47
- package/src/hive-mind/core/Queen.ts +187 -114
- package/src/hive-mind/index.ts +2 -2
- package/src/hive-mind/integration/ConsensusEngine.ts +88 -92
- package/src/hive-mind/integration/MCPToolWrapper.ts +20 -72
- package/src/hive-mind/integration/SwarmOrchestrator.ts +173 -165
- package/src/hive-mind/types.ts +24 -12
- package/src/integration/mock-components.ts +42 -30
- package/src/integration/system-integration.ts +93 -69
- package/src/integration/types.ts +7 -7
- package/src/mcp/README.md +23 -4
- package/src/mcp/auth.ts +25 -18
- package/src/mcp/claude-code-wrapper.ts +257 -150
- package/src/mcp/claude-flow-tools.ts +52 -13
- package/src/mcp/client.ts +15 -13
- package/src/mcp/index.ts +22 -27
- package/src/mcp/integrate-wrapper.ts +18 -18
- package/src/mcp/lifecycle-manager.ts +30 -27
- package/src/mcp/load-balancer.ts +10 -11
- package/src/mcp/mcp-server.js +755 -370
- package/src/mcp/orchestration-integration.ts +32 -17
- package/src/mcp/performance-monitor.ts +65 -51
- package/src/mcp/protocol-manager.ts +36 -52
- package/src/mcp/recovery/connection-health-monitor.ts +40 -35
- package/src/mcp/recovery/connection-state-manager.ts +52 -50
- package/src/mcp/recovery/fallback-coordinator.ts +24 -24
- package/src/mcp/recovery/index.ts +23 -4
- package/src/mcp/recovery/reconnection-manager.ts +14 -15
- package/src/mcp/recovery/recovery-manager.ts +52 -68
- package/src/mcp/router.ts +1 -2
- package/src/mcp/ruv-swarm-tools.ts +167 -138
- package/src/mcp/ruv-swarm-wrapper.js +31 -23
- package/src/mcp/server-with-wrapper.ts +4 -5
- package/src/mcp/server-wrapper-mode.ts +5 -6
- package/src/mcp/server.ts +45 -40
- package/src/mcp/session-manager.ts +8 -11
- package/src/mcp/sparc-modes.ts +29 -28
- package/src/mcp/swarm-tools.ts +131 -114
- package/src/mcp/tests/mcp-integration.test.ts +49 -55
- package/src/mcp/tools.ts +53 -38
- package/src/mcp/transports/base.ts +4 -5
- package/src/mcp/transports/http.ts +45 -42
- package/src/mcp/transports/stdio.ts +9 -12
- package/src/memory/README.md +37 -27
- package/src/memory/advanced-memory-manager.ts +336 -279
- package/src/memory/backends/base.ts +4 -5
- package/src/memory/backends/markdown.ts +16 -22
- package/src/memory/backends/sqlite.ts +19 -15
- package/src/memory/cache.ts +18 -18
- package/src/memory/distributed-memory.ts +84 -92
- package/src/memory/enhanced-examples.js +68 -59
- package/src/memory/enhanced-memory.js +99 -80
- package/src/memory/fallback-store.js +16 -7
- package/src/memory/in-memory-store.js +31 -27
- package/src/memory/index.js +4 -4
- package/src/memory/indexer.ts +6 -10
- package/src/memory/manager.ts +45 -59
- package/src/memory/migration.js +107 -90
- package/src/memory/shared-memory.js +155 -157
- package/src/memory/sqlite-store.js +76 -59
- package/src/memory/swarm-memory.js +138 -131
- package/src/memory/swarm-memory.ts +74 -75
- package/src/memory/test-example.js +28 -30
- package/src/migration/README.md +25 -9
- package/src/migration/index.ts +13 -14
- package/src/migration/logger.ts +9 -7
- package/src/migration/migration-analyzer.ts +66 -52
- package/src/migration/migration-manifest.json +2 -6
- package/src/migration/migration-runner.ts +86 -63
- package/src/migration/migration-validator.ts +93 -68
- package/src/migration/package.json +1 -1
- package/src/migration/progress-reporter.ts +25 -21
- package/src/migration/rollback-manager.ts +79 -63
- package/src/migration/tests/migration-system.test.ts +4 -491
- package/src/migration/tsconfig.json +3 -10
- package/src/migration/types.ts +1 -1
- package/src/monitoring/diagnostics.ts +123 -97
- package/src/monitoring/health-check.ts +45 -51
- package/src/monitoring/real-time-monitor.ts +105 -92
- package/src/resources/resource-manager.ts +205 -159
- package/src/swarm/__tests__/integration.test.ts +59 -65
- package/src/swarm/__tests__/prompt-copier.test.ts +27 -27
- package/src/swarm/claude-flow-executor.ts +50 -49
- package/src/swarm/coordinator.ts +727 -635
- package/src/swarm/direct-executor.ts +80 -86
- package/src/swarm/executor-v2.ts +81 -66
- package/src/swarm/executor.ts +124 -124
- package/src/swarm/index.ts +7 -8
- package/src/swarm/json-output-aggregator.ts +56 -40
- package/src/swarm/memory.ts +152 -147
- package/src/swarm/optimizations/README.md +20 -12
- package/src/swarm/optimizations/__tests__/optimization.test.ts +84 -87
- package/src/swarm/optimizations/async-file-manager.ts +70 -80
- package/src/swarm/optimizations/circular-buffer.ts +37 -37
- package/src/swarm/optimizations/connection-pool.ts +64 -64
- package/src/swarm/optimizations/index.ts +4 -4
- package/src/swarm/optimizations/migration-guide.md +27 -16
- package/src/swarm/optimizations/optimized-executor.ts +104 -114
- package/src/swarm/optimizations/ttl-map.ts +66 -63
- package/src/swarm/prompt-cli.ts +48 -42
- package/src/swarm/prompt-copier-enhanced.ts +54 -55
- package/src/swarm/prompt-copier.ts +59 -65
- package/src/swarm/prompt-copying-README.md +49 -33
- package/src/swarm/prompt-manager.ts +69 -63
- package/src/swarm/prompt-utils.ts +71 -66
- package/src/swarm/sparc-executor.ts +298 -225
- package/src/swarm/strategies/auto.ts +367 -252
- package/src/swarm/strategies/base.ts +24 -20
- package/src/swarm/strategies/research.ts +144 -124
- package/src/swarm/types.ts +340 -309
- package/src/swarm/workers/copy-worker.ts +12 -13
- package/src/task/README.md +99 -70
- package/src/task/commands.ts +16 -8
- package/src/task/coordination.ts +209 -162
- package/src/task/engine.ts +81 -65
- package/src/task/index.ts +28 -31
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_BEST_PRACTICES.md +479 -481
- package/src/templates/claude-optimized/.claude/BATCHTOOLS_GUIDE.md +210 -188
- package/src/templates/claude-optimized/.claude/MIGRATION_GUIDE.md +151 -105
- package/src/templates/claude-optimized/.claude/PERFORMANCE_BENCHMARKS.md +102 -87
- package/src/templates/claude-optimized/.claude/commands/claude-flow-help.md +18 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-memory.md +17 -1
- package/src/templates/claude-optimized/.claude/commands/claude-flow-swarm.md +21 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/architect.md +11 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/ask.md +16 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/code.md +26 -7
- package/src/templates/claude-optimized/.claude/commands/sparc/debug.md +14 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/devops.md +23 -10
- package/src/templates/claude-optimized/.claude/commands/sparc/docs-writer.md +8 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/integration.md +43 -27
- package/src/templates/claude-optimized/.claude/commands/sparc/mcp.md +15 -1
- package/src/templates/claude-optimized/.claude/commands/sparc/post-deployment-monitoring-mode.md +45 -30
- package/src/templates/claude-optimized/.claude/commands/sparc/refinement-optimization-mode.md +23 -13
- package/src/templates/claude-optimized/.claude/commands/sparc/security-review.md +31 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/sparc.md +54 -47
- package/src/templates/claude-optimized/.claude/commands/sparc/spec-pseudocode.md +27 -17
- package/src/templates/claude-optimized/.claude/commands/sparc/supabase-admin.md +18 -4
- package/src/templates/claude-optimized/.claude/commands/sparc/tdd.md +23 -9
- package/src/templates/claude-optimized/.claude/commands/sparc/tutorial.md +22 -16
- package/src/templates/claude-optimized/.claude/commands/sparc.md +20 -1
- package/src/templates/claude-optimized/README.md +10 -1
- package/src/templates/claude-optimized/SUMMARY.md +23 -1
- package/src/templates/claude-optimized/deploy-to-project.js +22 -10
- package/src/templates/claude-optimized/install-template.js +14 -10
- package/src/templates/claude-optimized/manifest.json +1 -1
- package/src/templates/claude-optimized/package.json +1 -1
- package/src/templates/claude-optimized/template-manager.js +8 -8
- package/src/templates/claude-optimized/validate-template.js +33 -23
- package/src/terminal/adapters/base.ts +1 -1
- package/src/terminal/adapters/native.ts +47 -47
- package/src/terminal/adapters/vscode.ts +21 -28
- package/src/terminal/manager.ts +27 -22
- package/src/terminal/pool.ts +24 -27
- package/src/terminal/session.ts +18 -18
- package/src/terminal/vscode-bridge.ts +21 -21
- package/src/tests/validation-consistency.test.ts +4 -4
- package/src/types/cliffy.d.ts +11 -14
- package/src/types/global.d.ts +1 -2
- package/src/types/index.ts +2 -2
- package/src/types/mcp.d.ts +11 -17
- package/src/types/vscode.d.ts +18 -5
- package/src/ui/console/README-analysis-tools.md +52 -2
- package/src/ui/console/README.md +33 -1
- package/src/ui/console/WORKFLOW_DESIGNER_README.md +81 -22
- package/src/ui/console/analysis-tools.html +282 -261
- package/src/ui/console/analytics.html +329 -326
- package/src/ui/console/index.html +221 -209
- package/src/ui/console/js/analysis-tools.js +815 -754
- package/src/ui/console/js/command-handler.js +226 -196
- package/src/ui/console/js/console.js +117 -119
- package/src/ui/console/js/daa-tools.js +797 -787
- package/src/ui/console/js/memory-interface.js +676 -638
- package/src/ui/console/js/memory-test.js +49 -46
- package/src/ui/console/js/memory-tools.js +181 -159
- package/src/ui/console/js/settings.js +124 -103
- package/src/ui/console/js/terminal-emulator.js +147 -130
- package/src/ui/console/js/websocket-client.js +71 -71
- package/src/ui/console/js/workflow-designer.js +1126 -1110
- package/src/ui/console/neural-networks-demo.md +45 -16
- package/src/ui/console/styles/analysis-tools.css +571 -561
- package/src/ui/console/styles/console.css +16 -12
- package/src/ui/console/styles/daa-tools.css +322 -319
- package/src/ui/console/styles/responsive.css +71 -70
- package/src/ui/console/styles/settings.css +12 -12
- package/src/ui/console/styles/workflow-designer.css +628 -584
- package/src/ui/console/test-neural-networks.js +59 -54
- package/src/ui/console/test-neural.html +194 -196
- package/src/ui/console/workflow-designer-demo.html +433 -424
- package/src/ui/hive-dashboard.ts +74 -52
- package/src/ui/web-ui/EnhancedProcessUI.js +570 -424
- package/src/ui/web-ui/EnhancedWebUI.js +65 -65
- package/src/ui/web-ui/README.md +16 -16
- package/src/ui/web-ui/components/ComponentLibrary.js +173 -124
- package/src/ui/web-ui/core/EventBus.js +27 -25
- package/src/ui/web-ui/core/MCPIntegrationLayer.js +294 -108
- package/src/ui/web-ui/core/StateManager.js +43 -46
- package/src/ui/web-ui/core/UIManager.js +120 -70
- package/src/ui/web-ui/core/ViewManager.js +16 -19
- package/src/ui/web-ui/index.js +101 -48
- package/src/ui/web-ui/neural-panel-test.js +109 -108
- package/src/ui/web-ui/test-github-view.js +11 -12
- package/src/ui/web-ui/test-neural-panel.html +219 -205
- package/src/ui/web-ui/views/DAAView.js +88 -85
- package/src/ui/web-ui/views/GitHubIntegrationTest.js +42 -42
- package/src/ui/web-ui/views/GitHubIntegrationView.js +59 -53
- package/src/ui/web-ui/views/NeuralNetworkView.js +20 -21
- package/src/ui/web-ui/views/WorkflowAutomationView.js +31 -32
- package/src/utils/error-handler.js +1 -1
- package/src/utils/error-handler.ts +9 -5
- package/src/utils/errors.ts +20 -18
- package/src/utils/formatters.ts +6 -6
- package/src/utils/helpers.ts +53 -55
- package/src/utils/npx-isolated-cache.js +16 -16
- package/src/utils/paths.ts +9 -6
- package/src/utils/timezone-utils.js +16 -16
- package/src/utils/type-guards.ts +37 -26
- package/src/utils/types.ts +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hive Mind Database Optimizer
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Safe, backward-compatible database optimization for existing deployments
|
|
5
5
|
* Adds indexes, performance improvements, and new features without breaking changes
|
|
6
6
|
*/
|
|
@@ -17,89 +17,88 @@ import ora from 'ora';
|
|
|
17
17
|
*/
|
|
18
18
|
export async function optimizeHiveMindDatabase(dbPath, options = {}) {
|
|
19
19
|
const spinner = ora('Optimizing Hive Mind database...').start();
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
try {
|
|
22
22
|
// Open database with write-ahead logging for better performance
|
|
23
|
-
const db = new Database(dbPath, {
|
|
24
|
-
verbose: options.verbose ? console.log : null
|
|
23
|
+
const db = new Database(dbPath, {
|
|
24
|
+
verbose: options.verbose ? console.log : null,
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
// Enable WAL mode for better concurrency
|
|
28
28
|
db.pragma('journal_mode = WAL');
|
|
29
29
|
db.pragma('synchronous = NORMAL');
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
// Get current schema version
|
|
32
32
|
const schemaVersion = getSchemaVersion(db);
|
|
33
33
|
spinner.text = `Current schema version: ${schemaVersion}`;
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
// Apply optimizations based on version
|
|
36
36
|
let optimizationsApplied = [];
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
// Version 1.0 -> 1.1: Add basic indexes
|
|
39
39
|
if (schemaVersion < 1.1) {
|
|
40
40
|
spinner.text = 'Applying performance indexes...';
|
|
41
41
|
applyBasicIndexes(db);
|
|
42
42
|
optimizationsApplied.push('Basic performance indexes');
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
// Version 1.1 -> 1.2: Add advanced indexes and analyze
|
|
46
46
|
if (schemaVersion < 1.2) {
|
|
47
47
|
spinner.text = 'Applying advanced indexes...';
|
|
48
48
|
applyAdvancedIndexes(db);
|
|
49
49
|
optimizationsApplied.push('Advanced query optimization');
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
// Version 1.2 -> 1.3: Add performance tracking tables
|
|
53
53
|
if (schemaVersion < 1.3) {
|
|
54
54
|
spinner.text = 'Adding performance tracking...';
|
|
55
55
|
addPerformanceTracking(db);
|
|
56
56
|
optimizationsApplied.push('Performance monitoring tables');
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
// Version 1.3 -> 1.4: Add memory optimization
|
|
60
60
|
if (schemaVersion < 1.4) {
|
|
61
61
|
spinner.text = 'Optimizing memory management...';
|
|
62
62
|
addMemoryOptimization(db);
|
|
63
63
|
optimizationsApplied.push('Memory optimization features');
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
// Version 1.4 -> 1.5: Add behavioral tracking
|
|
67
67
|
if (schemaVersion < 1.5) {
|
|
68
68
|
spinner.text = 'Adding behavioral analysis...';
|
|
69
69
|
addBehavioralTracking(db);
|
|
70
70
|
optimizationsApplied.push('Behavioral pattern tracking');
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
// Run ANALYZE to update query planner statistics
|
|
74
74
|
spinner.text = 'Updating query statistics...';
|
|
75
75
|
db.exec('ANALYZE');
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
// Vacuum if requested (requires exclusive access)
|
|
78
78
|
if (options.vacuum) {
|
|
79
79
|
spinner.text = 'Vacuuming database...';
|
|
80
80
|
db.exec('VACUUM');
|
|
81
81
|
optimizationsApplied.push('Database vacuumed');
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
// Update schema version
|
|
85
85
|
updateSchemaVersion(db, 1.5);
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
// Close database
|
|
88
88
|
db.close();
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
spinner.succeed('Database optimization complete!');
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
if (optimizationsApplied.length > 0) {
|
|
93
93
|
console.log('\n' + chalk.green('✓') + ' Optimizations applied:');
|
|
94
|
-
optimizationsApplied.forEach(opt => {
|
|
94
|
+
optimizationsApplied.forEach((opt) => {
|
|
95
95
|
console.log(' - ' + opt);
|
|
96
96
|
});
|
|
97
97
|
} else {
|
|
98
98
|
console.log('\n' + chalk.yellow('ℹ') + ' Database already optimized');
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
return { success: true, optimizations: optimizationsApplied };
|
|
102
|
-
|
|
103
102
|
} catch (error) {
|
|
104
103
|
spinner.fail('Database optimization failed');
|
|
105
104
|
console.error(chalk.red('Error:'), error.message);
|
|
@@ -113,11 +112,15 @@ export async function optimizeHiveMindDatabase(dbPath, options = {}) {
|
|
|
113
112
|
function getSchemaVersion(db) {
|
|
114
113
|
try {
|
|
115
114
|
// Check if schema_version table exists
|
|
116
|
-
const tableExists = db
|
|
115
|
+
const tableExists = db
|
|
116
|
+
.prepare(
|
|
117
|
+
`
|
|
117
118
|
SELECT name FROM sqlite_master
|
|
118
119
|
WHERE type='table' AND name='schema_version'
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
`,
|
|
121
|
+
)
|
|
122
|
+
.get();
|
|
123
|
+
|
|
121
124
|
if (!tableExists) {
|
|
122
125
|
// Create schema version table
|
|
123
126
|
db.exec(`
|
|
@@ -127,24 +130,29 @@ function getSchemaVersion(db) {
|
|
|
127
130
|
description TEXT
|
|
128
131
|
)
|
|
129
132
|
`);
|
|
130
|
-
|
|
133
|
+
|
|
131
134
|
// Insert initial version
|
|
132
|
-
db.prepare(
|
|
135
|
+
db.prepare(
|
|
136
|
+
`
|
|
133
137
|
INSERT INTO schema_version (version, description)
|
|
134
138
|
VALUES (1.0, 'Initial schema')
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
`,
|
|
140
|
+
).run();
|
|
141
|
+
|
|
137
142
|
return 1.0;
|
|
138
143
|
}
|
|
139
|
-
|
|
144
|
+
|
|
140
145
|
// Get latest version
|
|
141
|
-
const result = db
|
|
146
|
+
const result = db
|
|
147
|
+
.prepare(
|
|
148
|
+
`
|
|
142
149
|
SELECT version FROM schema_version
|
|
143
150
|
ORDER BY version DESC LIMIT 1
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
`,
|
|
152
|
+
)
|
|
153
|
+
.get();
|
|
154
|
+
|
|
146
155
|
return result ? result.version : 1.0;
|
|
147
|
-
|
|
148
156
|
} catch (error) {
|
|
149
157
|
// If any error, assume version 1.0
|
|
150
158
|
return 1.0;
|
|
@@ -155,10 +163,12 @@ function getSchemaVersion(db) {
|
|
|
155
163
|
* Update schema version
|
|
156
164
|
*/
|
|
157
165
|
function updateSchemaVersion(db, version, description = '') {
|
|
158
|
-
db.prepare(
|
|
166
|
+
db.prepare(
|
|
167
|
+
`
|
|
159
168
|
INSERT OR REPLACE INTO schema_version (version, description)
|
|
160
169
|
VALUES (?, ?)
|
|
161
|
-
|
|
170
|
+
`,
|
|
171
|
+
).run(version, description || `Updated to version ${version}`);
|
|
162
172
|
}
|
|
163
173
|
|
|
164
174
|
/**
|
|
@@ -167,58 +177,63 @@ function updateSchemaVersion(db, version, description = '') {
|
|
|
167
177
|
function applyBasicIndexes(db) {
|
|
168
178
|
// First ensure all required columns exist
|
|
169
179
|
ensureRequiredColumns(db);
|
|
170
|
-
|
|
180
|
+
|
|
171
181
|
// Check which tables exist before creating indexes
|
|
172
|
-
const tables = db
|
|
182
|
+
const tables = db
|
|
183
|
+
.prepare(
|
|
184
|
+
`
|
|
173
185
|
SELECT name FROM sqlite_master
|
|
174
186
|
WHERE type='table' AND name NOT LIKE 'sqlite_%'
|
|
175
|
-
|
|
176
|
-
|
|
187
|
+
`,
|
|
188
|
+
)
|
|
189
|
+
.all()
|
|
190
|
+
.map((row) => row.name);
|
|
191
|
+
|
|
177
192
|
const tableSet = new Set(tables);
|
|
178
|
-
|
|
193
|
+
|
|
179
194
|
const indexes = [];
|
|
180
|
-
|
|
195
|
+
|
|
181
196
|
// Only create indexes for tables that exist
|
|
182
197
|
if (tableSet.has('swarms')) {
|
|
183
198
|
indexes.push(
|
|
184
199
|
'CREATE INDEX IF NOT EXISTS idx_swarms_status ON swarms(status)',
|
|
185
|
-
'CREATE INDEX IF NOT EXISTS idx_swarms_created ON swarms(created_at)'
|
|
200
|
+
'CREATE INDEX IF NOT EXISTS idx_swarms_created ON swarms(created_at)',
|
|
186
201
|
);
|
|
187
202
|
}
|
|
188
|
-
|
|
203
|
+
|
|
189
204
|
if (tableSet.has('agents')) {
|
|
190
205
|
indexes.push(
|
|
191
206
|
'CREATE INDEX IF NOT EXISTS idx_agents_swarm ON agents(swarm_id)',
|
|
192
207
|
'CREATE INDEX IF NOT EXISTS idx_agents_type ON agents(type)',
|
|
193
|
-
'CREATE INDEX IF NOT EXISTS idx_agents_status ON agents(status)'
|
|
208
|
+
'CREATE INDEX IF NOT EXISTS idx_agents_status ON agents(status)',
|
|
194
209
|
);
|
|
195
210
|
}
|
|
196
|
-
|
|
211
|
+
|
|
197
212
|
if (tableSet.has('tasks')) {
|
|
198
213
|
indexes.push(
|
|
199
214
|
'CREATE INDEX IF NOT EXISTS idx_tasks_swarm ON tasks(swarm_id)',
|
|
200
215
|
'CREATE INDEX IF NOT EXISTS idx_tasks_agent ON tasks(agent_id)',
|
|
201
216
|
'CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status)',
|
|
202
|
-
'CREATE INDEX IF NOT EXISTS idx_tasks_priority ON tasks(priority DESC)'
|
|
217
|
+
'CREATE INDEX IF NOT EXISTS idx_tasks_priority ON tasks(priority DESC)',
|
|
203
218
|
);
|
|
204
219
|
}
|
|
205
|
-
|
|
220
|
+
|
|
206
221
|
if (tableSet.has('collective_memory')) {
|
|
207
222
|
indexes.push(
|
|
208
223
|
'CREATE INDEX IF NOT EXISTS idx_memory_swarm ON collective_memory(swarm_id)',
|
|
209
224
|
'CREATE INDEX IF NOT EXISTS idx_memory_key ON collective_memory(key)',
|
|
210
|
-
'CREATE INDEX IF NOT EXISTS idx_memory_type ON collective_memory(type)'
|
|
225
|
+
'CREATE INDEX IF NOT EXISTS idx_memory_type ON collective_memory(type)',
|
|
211
226
|
);
|
|
212
227
|
}
|
|
213
|
-
|
|
228
|
+
|
|
214
229
|
if (tableSet.has('consensus_decisions')) {
|
|
215
230
|
indexes.push(
|
|
216
231
|
'CREATE INDEX IF NOT EXISTS idx_consensus_swarm ON consensus_decisions(swarm_id)',
|
|
217
|
-
'CREATE INDEX IF NOT EXISTS idx_consensus_created ON consensus_decisions(created_at)'
|
|
232
|
+
'CREATE INDEX IF NOT EXISTS idx_consensus_created ON consensus_decisions(created_at)',
|
|
218
233
|
);
|
|
219
234
|
}
|
|
220
|
-
|
|
221
|
-
indexes.forEach(sql => {
|
|
235
|
+
|
|
236
|
+
indexes.forEach((sql) => {
|
|
222
237
|
try {
|
|
223
238
|
db.exec(sql);
|
|
224
239
|
} catch (error) {
|
|
@@ -232,81 +247,113 @@ function applyBasicIndexes(db) {
|
|
|
232
247
|
*/
|
|
233
248
|
function ensureRequiredColumns(db) {
|
|
234
249
|
// First check which tables exist
|
|
235
|
-
const tables = db
|
|
250
|
+
const tables = db
|
|
251
|
+
.prepare(
|
|
252
|
+
`
|
|
236
253
|
SELECT name FROM sqlite_master
|
|
237
254
|
WHERE type='table' AND name NOT LIKE 'sqlite_%'
|
|
238
|
-
|
|
239
|
-
|
|
255
|
+
`,
|
|
256
|
+
)
|
|
257
|
+
.all()
|
|
258
|
+
.map((row) => row.name);
|
|
259
|
+
|
|
240
260
|
const tableSet = new Set(tables);
|
|
241
|
-
|
|
261
|
+
|
|
242
262
|
// Only check columns for tables that exist
|
|
243
263
|
if (tableSet.has('tasks')) {
|
|
244
264
|
// Check and add priority column to tasks table
|
|
245
|
-
const hasPriority = db
|
|
265
|
+
const hasPriority = db
|
|
266
|
+
.prepare(
|
|
267
|
+
`
|
|
246
268
|
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
247
269
|
WHERE name = 'priority'
|
|
248
|
-
|
|
249
|
-
|
|
270
|
+
`,
|
|
271
|
+
)
|
|
272
|
+
.get();
|
|
273
|
+
|
|
250
274
|
if (!hasPriority || hasPriority.count === 0) {
|
|
251
275
|
try {
|
|
252
276
|
db.exec('ALTER TABLE tasks ADD COLUMN priority INTEGER DEFAULT 5');
|
|
253
277
|
console.log('Added missing priority column to tasks table');
|
|
254
278
|
} catch (error) {
|
|
255
|
-
if (
|
|
279
|
+
if (
|
|
280
|
+
!error.message.includes('duplicate column') &&
|
|
281
|
+
!error.message.includes('no such table')
|
|
282
|
+
) {
|
|
256
283
|
throw error;
|
|
257
284
|
}
|
|
258
285
|
}
|
|
259
286
|
}
|
|
260
|
-
|
|
287
|
+
|
|
261
288
|
// Check and add completed_at column to tasks table
|
|
262
|
-
const hasCompletedAt = db
|
|
289
|
+
const hasCompletedAt = db
|
|
290
|
+
.prepare(
|
|
291
|
+
`
|
|
263
292
|
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
264
293
|
WHERE name = 'completed_at'
|
|
265
|
-
|
|
266
|
-
|
|
294
|
+
`,
|
|
295
|
+
)
|
|
296
|
+
.get();
|
|
297
|
+
|
|
267
298
|
if (!hasCompletedAt || hasCompletedAt.count === 0) {
|
|
268
299
|
try {
|
|
269
300
|
db.exec('ALTER TABLE tasks ADD COLUMN completed_at DATETIME');
|
|
270
301
|
console.log('Added missing completed_at column to tasks table');
|
|
271
302
|
} catch (error) {
|
|
272
|
-
if (
|
|
303
|
+
if (
|
|
304
|
+
!error.message.includes('duplicate column') &&
|
|
305
|
+
!error.message.includes('no such table')
|
|
306
|
+
) {
|
|
273
307
|
throw error;
|
|
274
308
|
}
|
|
275
309
|
}
|
|
276
310
|
}
|
|
277
|
-
|
|
311
|
+
|
|
278
312
|
// Check and add result column to tasks table
|
|
279
|
-
const hasResult = db
|
|
313
|
+
const hasResult = db
|
|
314
|
+
.prepare(
|
|
315
|
+
`
|
|
280
316
|
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
281
317
|
WHERE name = 'result'
|
|
282
|
-
|
|
283
|
-
|
|
318
|
+
`,
|
|
319
|
+
)
|
|
320
|
+
.get();
|
|
321
|
+
|
|
284
322
|
if (!hasResult || hasResult.count === 0) {
|
|
285
323
|
try {
|
|
286
324
|
db.exec('ALTER TABLE tasks ADD COLUMN result TEXT');
|
|
287
325
|
console.log('Added missing result column to tasks table');
|
|
288
326
|
} catch (error) {
|
|
289
|
-
if (
|
|
327
|
+
if (
|
|
328
|
+
!error.message.includes('duplicate column') &&
|
|
329
|
+
!error.message.includes('no such table')
|
|
330
|
+
) {
|
|
290
331
|
throw error;
|
|
291
332
|
}
|
|
292
333
|
}
|
|
293
334
|
}
|
|
294
335
|
}
|
|
295
|
-
|
|
296
|
-
|
|
336
|
+
|
|
297
337
|
if (tableSet.has('swarms')) {
|
|
298
338
|
// Check and add updated_at column to swarms table
|
|
299
|
-
const hasUpdatedAt = db
|
|
339
|
+
const hasUpdatedAt = db
|
|
340
|
+
.prepare(
|
|
341
|
+
`
|
|
300
342
|
SELECT COUNT(*) as count FROM pragma_table_info('swarms')
|
|
301
343
|
WHERE name = 'updated_at'
|
|
302
|
-
|
|
303
|
-
|
|
344
|
+
`,
|
|
345
|
+
)
|
|
346
|
+
.get();
|
|
347
|
+
|
|
304
348
|
if (!hasUpdatedAt || hasUpdatedAt.count === 0) {
|
|
305
349
|
try {
|
|
306
350
|
db.exec('ALTER TABLE swarms ADD COLUMN updated_at DATETIME');
|
|
307
351
|
console.log('Added missing updated_at column to swarms table');
|
|
308
352
|
} catch (error) {
|
|
309
|
-
if (
|
|
353
|
+
if (
|
|
354
|
+
!error.message.includes('duplicate column') &&
|
|
355
|
+
!error.message.includes('no such table')
|
|
356
|
+
) {
|
|
310
357
|
throw error;
|
|
311
358
|
}
|
|
312
359
|
}
|
|
@@ -319,43 +366,48 @@ function ensureRequiredColumns(db) {
|
|
|
319
366
|
*/
|
|
320
367
|
function applyAdvancedIndexes(db) {
|
|
321
368
|
// Check which tables exist
|
|
322
|
-
const tables = db
|
|
369
|
+
const tables = db
|
|
370
|
+
.prepare(
|
|
371
|
+
`
|
|
323
372
|
SELECT name FROM sqlite_master
|
|
324
373
|
WHERE type='table' AND name NOT LIKE 'sqlite_%'
|
|
325
|
-
|
|
326
|
-
|
|
374
|
+
`,
|
|
375
|
+
)
|
|
376
|
+
.all()
|
|
377
|
+
.map((row) => row.name);
|
|
378
|
+
|
|
327
379
|
const tableSet = new Set(tables);
|
|
328
380
|
const indexes = [];
|
|
329
|
-
|
|
381
|
+
|
|
330
382
|
// Composite indexes for common queries
|
|
331
383
|
if (tableSet.has('tasks')) {
|
|
332
384
|
indexes.push(
|
|
333
385
|
'CREATE INDEX IF NOT EXISTS idx_tasks_swarm_status ON tasks(swarm_id, status)',
|
|
334
386
|
'CREATE INDEX IF NOT EXISTS idx_tasks_full ON tasks(swarm_id, agent_id, status, priority)',
|
|
335
|
-
"CREATE INDEX IF NOT EXISTS idx_tasks_pending ON tasks(swarm_id, priority) WHERE status = 'pending'"
|
|
387
|
+
"CREATE INDEX IF NOT EXISTS idx_tasks_pending ON tasks(swarm_id, priority) WHERE status = 'pending'",
|
|
336
388
|
);
|
|
337
389
|
}
|
|
338
|
-
|
|
390
|
+
|
|
339
391
|
if (tableSet.has('agents')) {
|
|
340
392
|
indexes.push(
|
|
341
393
|
'CREATE INDEX IF NOT EXISTS idx_agents_swarm_type ON agents(swarm_id, type)',
|
|
342
|
-
'CREATE INDEX IF NOT EXISTS idx_agents_full ON agents(swarm_id, type, status, role)'
|
|
394
|
+
'CREATE INDEX IF NOT EXISTS idx_agents_full ON agents(swarm_id, type, status, role)',
|
|
343
395
|
);
|
|
344
396
|
}
|
|
345
|
-
|
|
397
|
+
|
|
346
398
|
if (tableSet.has('collective_memory')) {
|
|
347
399
|
indexes.push(
|
|
348
|
-
'CREATE INDEX IF NOT EXISTS idx_memory_swarm_key ON collective_memory(swarm_id, key)'
|
|
400
|
+
'CREATE INDEX IF NOT EXISTS idx_memory_swarm_key ON collective_memory(swarm_id, key)',
|
|
349
401
|
);
|
|
350
402
|
}
|
|
351
|
-
|
|
403
|
+
|
|
352
404
|
if (tableSet.has('swarms')) {
|
|
353
405
|
indexes.push(
|
|
354
|
-
"CREATE INDEX IF NOT EXISTS idx_swarms_active ON swarms(id, name) WHERE status = 'active'"
|
|
406
|
+
"CREATE INDEX IF NOT EXISTS idx_swarms_active ON swarms(id, name) WHERE status = 'active'",
|
|
355
407
|
);
|
|
356
408
|
}
|
|
357
|
-
|
|
358
|
-
indexes.forEach(sql => {
|
|
409
|
+
|
|
410
|
+
indexes.forEach((sql) => {
|
|
359
411
|
try {
|
|
360
412
|
db.exec(sql);
|
|
361
413
|
} catch (error) {
|
|
@@ -380,7 +432,7 @@ function addPerformanceTracking(db) {
|
|
|
380
432
|
FOREIGN KEY (agent_id) REFERENCES agents(id)
|
|
381
433
|
)
|
|
382
434
|
`);
|
|
383
|
-
|
|
435
|
+
|
|
384
436
|
// Swarm performance metrics
|
|
385
437
|
db.exec(`
|
|
386
438
|
CREATE TABLE IF NOT EXISTS swarm_performance (
|
|
@@ -393,7 +445,7 @@ function addPerformanceTracking(db) {
|
|
|
393
445
|
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
394
446
|
)
|
|
395
447
|
`);
|
|
396
|
-
|
|
448
|
+
|
|
397
449
|
// Create triggers to update performance metrics
|
|
398
450
|
db.exec(`
|
|
399
451
|
CREATE TRIGGER IF NOT EXISTS update_agent_performance
|
|
@@ -417,22 +469,30 @@ function addPerformanceTracking(db) {
|
|
|
417
469
|
*/
|
|
418
470
|
function addMemoryOptimization(db) {
|
|
419
471
|
// Check if collective_memory table exists
|
|
420
|
-
const tables = db
|
|
472
|
+
const tables = db
|
|
473
|
+
.prepare(
|
|
474
|
+
`
|
|
421
475
|
SELECT name FROM sqlite_master
|
|
422
476
|
WHERE type='table' AND name = 'collective_memory'
|
|
423
|
-
|
|
424
|
-
|
|
477
|
+
`,
|
|
478
|
+
)
|
|
479
|
+
.all();
|
|
480
|
+
|
|
425
481
|
if (tables.length === 0) {
|
|
426
482
|
console.log('collective_memory table does not exist, skipping memory optimization');
|
|
427
483
|
return;
|
|
428
484
|
}
|
|
429
|
-
|
|
485
|
+
|
|
430
486
|
// Check and add access_count column
|
|
431
|
-
const hasAccessCount = db
|
|
487
|
+
const hasAccessCount = db
|
|
488
|
+
.prepare(
|
|
489
|
+
`
|
|
432
490
|
SELECT COUNT(*) as count FROM pragma_table_info('collective_memory')
|
|
433
491
|
WHERE name = 'access_count'
|
|
434
|
-
|
|
435
|
-
|
|
492
|
+
`,
|
|
493
|
+
)
|
|
494
|
+
.get();
|
|
495
|
+
|
|
436
496
|
if (!hasAccessCount || hasAccessCount.count === 0) {
|
|
437
497
|
try {
|
|
438
498
|
db.exec(`
|
|
@@ -446,13 +506,17 @@ function addMemoryOptimization(db) {
|
|
|
446
506
|
}
|
|
447
507
|
}
|
|
448
508
|
}
|
|
449
|
-
|
|
509
|
+
|
|
450
510
|
// Check and add accessed_at column (not last_accessed)
|
|
451
|
-
const hasAccessedAt = db
|
|
511
|
+
const hasAccessedAt = db
|
|
512
|
+
.prepare(
|
|
513
|
+
`
|
|
452
514
|
SELECT COUNT(*) as count FROM pragma_table_info('collective_memory')
|
|
453
515
|
WHERE name = 'accessed_at'
|
|
454
|
-
|
|
455
|
-
|
|
516
|
+
`,
|
|
517
|
+
)
|
|
518
|
+
.get();
|
|
519
|
+
|
|
456
520
|
if (!hasAccessedAt || hasAccessedAt.count === 0) {
|
|
457
521
|
try {
|
|
458
522
|
db.exec(`
|
|
@@ -466,13 +530,17 @@ function addMemoryOptimization(db) {
|
|
|
466
530
|
}
|
|
467
531
|
}
|
|
468
532
|
}
|
|
469
|
-
|
|
533
|
+
|
|
470
534
|
// Add compressed and size columns if missing
|
|
471
|
-
const hasCompressed = db
|
|
535
|
+
const hasCompressed = db
|
|
536
|
+
.prepare(
|
|
537
|
+
`
|
|
472
538
|
SELECT COUNT(*) as count FROM pragma_table_info('collective_memory')
|
|
473
539
|
WHERE name = 'compressed'
|
|
474
|
-
|
|
475
|
-
|
|
540
|
+
`,
|
|
541
|
+
)
|
|
542
|
+
.get();
|
|
543
|
+
|
|
476
544
|
if (!hasCompressed || hasCompressed.count === 0) {
|
|
477
545
|
try {
|
|
478
546
|
db.exec(`
|
|
@@ -485,12 +553,16 @@ function addMemoryOptimization(db) {
|
|
|
485
553
|
}
|
|
486
554
|
}
|
|
487
555
|
}
|
|
488
|
-
|
|
489
|
-
const hasSize = db
|
|
556
|
+
|
|
557
|
+
const hasSize = db
|
|
558
|
+
.prepare(
|
|
559
|
+
`
|
|
490
560
|
SELECT COUNT(*) as count FROM pragma_table_info('collective_memory')
|
|
491
561
|
WHERE name = 'size'
|
|
492
|
-
|
|
493
|
-
|
|
562
|
+
`,
|
|
563
|
+
)
|
|
564
|
+
.get();
|
|
565
|
+
|
|
494
566
|
if (!hasSize || hasSize.count === 0) {
|
|
495
567
|
try {
|
|
496
568
|
db.exec(`
|
|
@@ -503,7 +575,7 @@ function addMemoryOptimization(db) {
|
|
|
503
575
|
}
|
|
504
576
|
}
|
|
505
577
|
}
|
|
506
|
-
|
|
578
|
+
|
|
507
579
|
// Create memory usage summary view
|
|
508
580
|
db.exec(`
|
|
509
581
|
CREATE VIEW IF NOT EXISTS memory_usage_summary AS
|
|
@@ -516,7 +588,7 @@ function addMemoryOptimization(db) {
|
|
|
516
588
|
FROM collective_memory
|
|
517
589
|
GROUP BY swarm_id
|
|
518
590
|
`);
|
|
519
|
-
|
|
591
|
+
|
|
520
592
|
// Add memory cleanup tracking
|
|
521
593
|
db.exec(`
|
|
522
594
|
CREATE TABLE IF NOT EXISTS memory_cleanup_log (
|
|
@@ -548,7 +620,7 @@ function addBehavioralTracking(db) {
|
|
|
548
620
|
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
549
621
|
)
|
|
550
622
|
`);
|
|
551
|
-
|
|
623
|
+
|
|
552
624
|
// Behavioral patterns
|
|
553
625
|
db.exec(`
|
|
554
626
|
CREATE TABLE IF NOT EXISTS behavioral_patterns (
|
|
@@ -563,7 +635,7 @@ function addBehavioralTracking(db) {
|
|
|
563
635
|
FOREIGN KEY (swarm_id) REFERENCES swarms(id)
|
|
564
636
|
)
|
|
565
637
|
`);
|
|
566
|
-
|
|
638
|
+
|
|
567
639
|
// Create indexes for behavioral analysis
|
|
568
640
|
db.exec(`
|
|
569
641
|
CREATE INDEX IF NOT EXISTS idx_interactions_swarm ON agent_interactions(swarm_id);
|
|
@@ -577,29 +649,37 @@ function addBehavioralTracking(db) {
|
|
|
577
649
|
*/
|
|
578
650
|
export async function performMaintenance(dbPath, options = {}) {
|
|
579
651
|
const spinner = ora('Performing database maintenance...').start();
|
|
580
|
-
|
|
652
|
+
|
|
581
653
|
try {
|
|
582
654
|
const db = new Database(dbPath);
|
|
583
|
-
|
|
655
|
+
|
|
584
656
|
// Clean up old memory entries
|
|
585
657
|
if (options.cleanMemory) {
|
|
586
658
|
// Check if collective_memory table exists
|
|
587
|
-
const hasMemoryTable = db
|
|
659
|
+
const hasMemoryTable = db
|
|
660
|
+
.prepare(
|
|
661
|
+
`
|
|
588
662
|
SELECT name FROM sqlite_master
|
|
589
663
|
WHERE type='table' AND name='collective_memory'
|
|
590
|
-
|
|
591
|
-
|
|
664
|
+
`,
|
|
665
|
+
)
|
|
666
|
+
.get();
|
|
667
|
+
|
|
592
668
|
if (hasMemoryTable) {
|
|
593
669
|
spinner.text = 'Cleaning old memory entries...';
|
|
594
670
|
const cutoffDate = new Date();
|
|
595
671
|
cutoffDate.setDate(cutoffDate.getDate() - (options.memoryRetentionDays || 30));
|
|
596
|
-
|
|
672
|
+
|
|
597
673
|
try {
|
|
598
|
-
const result = db
|
|
674
|
+
const result = db
|
|
675
|
+
.prepare(
|
|
676
|
+
`
|
|
599
677
|
DELETE FROM collective_memory
|
|
600
678
|
WHERE accessed_at < ? AND access_count < 5
|
|
601
|
-
|
|
602
|
-
|
|
679
|
+
`,
|
|
680
|
+
)
|
|
681
|
+
.run(cutoffDate.toISOString());
|
|
682
|
+
|
|
603
683
|
console.log(chalk.green(`✓ Removed ${result.changes} old memory entries`));
|
|
604
684
|
} catch (error) {
|
|
605
685
|
console.warn(chalk.yellow(`⚠ Could not clean memory entries: ${error.message}`));
|
|
@@ -608,64 +688,76 @@ export async function performMaintenance(dbPath, options = {}) {
|
|
|
608
688
|
console.log(chalk.yellow('⚠ collective_memory table not found, skipping memory cleanup'));
|
|
609
689
|
}
|
|
610
690
|
}
|
|
611
|
-
|
|
691
|
+
|
|
612
692
|
// Archive completed tasks
|
|
613
693
|
if (options.archiveTasks) {
|
|
614
694
|
spinner.text = 'Archiving completed tasks...';
|
|
615
|
-
|
|
695
|
+
|
|
616
696
|
// Create archive table if not exists
|
|
617
697
|
db.exec(`
|
|
618
698
|
CREATE TABLE IF NOT EXISTS tasks_archive AS
|
|
619
699
|
SELECT * FROM tasks WHERE 1=0
|
|
620
700
|
`);
|
|
621
|
-
|
|
701
|
+
|
|
622
702
|
// Check if completed_at column exists
|
|
623
|
-
const hasCompletedAt = db
|
|
703
|
+
const hasCompletedAt = db
|
|
704
|
+
.prepare(
|
|
705
|
+
`
|
|
624
706
|
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
625
707
|
WHERE name = 'completed_at'
|
|
626
|
-
|
|
627
|
-
|
|
708
|
+
`,
|
|
709
|
+
)
|
|
710
|
+
.get();
|
|
711
|
+
|
|
628
712
|
let archived = { changes: 0 };
|
|
629
|
-
|
|
713
|
+
|
|
630
714
|
if (hasCompletedAt && hasCompletedAt.count > 0) {
|
|
631
715
|
// Move old completed tasks using completed_at
|
|
632
716
|
const archiveCutoff = new Date();
|
|
633
717
|
archiveCutoff.setDate(archiveCutoff.getDate() - (options.taskRetentionDays || 7));
|
|
634
|
-
|
|
718
|
+
|
|
635
719
|
db.exec(`
|
|
636
720
|
INSERT INTO tasks_archive
|
|
637
721
|
SELECT * FROM tasks
|
|
638
722
|
WHERE status = 'completed' AND completed_at < '${archiveCutoff.toISOString()}'
|
|
639
723
|
`);
|
|
640
|
-
|
|
641
|
-
archived = db
|
|
724
|
+
|
|
725
|
+
archived = db
|
|
726
|
+
.prepare(
|
|
727
|
+
`
|
|
642
728
|
DELETE FROM tasks
|
|
643
729
|
WHERE status = 'completed' AND completed_at < ?
|
|
644
|
-
|
|
730
|
+
`,
|
|
731
|
+
)
|
|
732
|
+
.run(archiveCutoff.toISOString());
|
|
645
733
|
} else {
|
|
646
734
|
// Use created_at as fallback
|
|
647
735
|
const archiveCutoff = new Date();
|
|
648
736
|
archiveCutoff.setDate(archiveCutoff.getDate() - (options.taskRetentionDays || 7));
|
|
649
|
-
|
|
737
|
+
|
|
650
738
|
db.exec(`
|
|
651
739
|
INSERT INTO tasks_archive
|
|
652
740
|
SELECT * FROM tasks
|
|
653
741
|
WHERE status = 'completed' AND created_at < '${archiveCutoff.toISOString()}'
|
|
654
742
|
`);
|
|
655
|
-
|
|
656
|
-
archived = db
|
|
743
|
+
|
|
744
|
+
archived = db
|
|
745
|
+
.prepare(
|
|
746
|
+
`
|
|
657
747
|
DELETE FROM tasks
|
|
658
748
|
WHERE status = 'completed' AND created_at < ?
|
|
659
|
-
|
|
749
|
+
`,
|
|
750
|
+
)
|
|
751
|
+
.run(archiveCutoff.toISOString());
|
|
660
752
|
}
|
|
661
|
-
|
|
753
|
+
|
|
662
754
|
console.log(chalk.green(`✓ Archived ${archived.changes} completed tasks`));
|
|
663
755
|
}
|
|
664
|
-
|
|
756
|
+
|
|
665
757
|
// Update statistics
|
|
666
758
|
spinner.text = 'Updating database statistics...';
|
|
667
759
|
db.exec('ANALYZE');
|
|
668
|
-
|
|
760
|
+
|
|
669
761
|
// Check integrity
|
|
670
762
|
if (options.checkIntegrity) {
|
|
671
763
|
spinner.text = 'Checking database integrity...';
|
|
@@ -676,10 +768,9 @@ export async function performMaintenance(dbPath, options = {}) {
|
|
|
676
768
|
console.log(chalk.yellow('⚠ Database integrity issues detected'));
|
|
677
769
|
}
|
|
678
770
|
}
|
|
679
|
-
|
|
771
|
+
|
|
680
772
|
db.close();
|
|
681
773
|
spinner.succeed('Database maintenance complete!');
|
|
682
|
-
|
|
683
774
|
} catch (error) {
|
|
684
775
|
spinner.fail('Database maintenance failed');
|
|
685
776
|
console.error(chalk.red('Error:'), error.message);
|
|
@@ -692,62 +783,81 @@ export async function performMaintenance(dbPath, options = {}) {
|
|
|
692
783
|
export async function generateOptimizationReport(dbPath) {
|
|
693
784
|
try {
|
|
694
785
|
const db = new Database(dbPath, { readonly: true });
|
|
695
|
-
|
|
786
|
+
|
|
696
787
|
const report = {
|
|
697
788
|
schemaVersion: getSchemaVersion(db),
|
|
698
789
|
tables: {},
|
|
699
790
|
indexes: [],
|
|
700
|
-
performance: {}
|
|
791
|
+
performance: {},
|
|
701
792
|
};
|
|
702
|
-
|
|
793
|
+
|
|
703
794
|
// Get table statistics
|
|
704
|
-
const tables = db
|
|
795
|
+
const tables = db
|
|
796
|
+
.prepare(
|
|
797
|
+
`
|
|
705
798
|
SELECT name FROM sqlite_master WHERE type='table'
|
|
706
|
-
|
|
707
|
-
|
|
799
|
+
`,
|
|
800
|
+
)
|
|
801
|
+
.all();
|
|
802
|
+
|
|
708
803
|
for (const table of tables) {
|
|
709
804
|
const count = db.prepare(`SELECT COUNT(*) as count FROM ${table.name}`).get();
|
|
710
|
-
const size = db
|
|
805
|
+
const size = db
|
|
806
|
+
.prepare(
|
|
807
|
+
`
|
|
711
808
|
SELECT SUM(pgsize) as size FROM dbstat WHERE name=?
|
|
712
|
-
|
|
713
|
-
|
|
809
|
+
`,
|
|
810
|
+
)
|
|
811
|
+
.get(table.name);
|
|
812
|
+
|
|
714
813
|
report.tables[table.name] = {
|
|
715
814
|
rowCount: count.count,
|
|
716
|
-
sizeBytes: size?.size || 0
|
|
815
|
+
sizeBytes: size?.size || 0,
|
|
717
816
|
};
|
|
718
817
|
}
|
|
719
|
-
|
|
818
|
+
|
|
720
819
|
// Get index information
|
|
721
|
-
report.indexes = db
|
|
820
|
+
report.indexes = db
|
|
821
|
+
.prepare(
|
|
822
|
+
`
|
|
722
823
|
SELECT name, tbl_name FROM sqlite_master WHERE type='index'
|
|
723
|
-
|
|
724
|
-
|
|
824
|
+
`,
|
|
825
|
+
)
|
|
826
|
+
.all();
|
|
827
|
+
|
|
725
828
|
// Get performance metrics (check if completed_at column exists)
|
|
726
829
|
let avgTaskTime = { avg_minutes: 0 };
|
|
727
830
|
try {
|
|
728
831
|
// First check if completed_at column exists
|
|
729
|
-
const hasCompletedAt = db
|
|
832
|
+
const hasCompletedAt = db
|
|
833
|
+
.prepare(
|
|
834
|
+
`
|
|
730
835
|
SELECT COUNT(*) as count FROM pragma_table_info('tasks')
|
|
731
836
|
WHERE name = 'completed_at'
|
|
732
|
-
|
|
733
|
-
|
|
837
|
+
`,
|
|
838
|
+
)
|
|
839
|
+
.get();
|
|
840
|
+
|
|
734
841
|
if (hasCompletedAt && hasCompletedAt.count > 0) {
|
|
735
|
-
avgTaskTime = db
|
|
842
|
+
avgTaskTime = db
|
|
843
|
+
.prepare(
|
|
844
|
+
`
|
|
736
845
|
SELECT AVG(julianday(completed_at) - julianday(created_at)) * 24 * 60 as avg_minutes
|
|
737
846
|
FROM tasks WHERE completed_at IS NOT NULL
|
|
738
|
-
|
|
847
|
+
`,
|
|
848
|
+
)
|
|
849
|
+
.get();
|
|
739
850
|
}
|
|
740
851
|
} catch (error) {
|
|
741
852
|
// If error, just use default value
|
|
742
853
|
console.warn('Could not calculate average task time:', error.message);
|
|
743
854
|
}
|
|
744
|
-
|
|
855
|
+
|
|
745
856
|
report.performance.avgTaskCompletionMinutes = avgTaskTime?.avg_minutes || 0;
|
|
746
|
-
|
|
857
|
+
|
|
747
858
|
db.close();
|
|
748
|
-
|
|
859
|
+
|
|
749
860
|
return report;
|
|
750
|
-
|
|
751
861
|
} catch (error) {
|
|
752
862
|
console.error('Error generating report:', error);
|
|
753
863
|
return null;
|
|
@@ -758,5 +868,5 @@ export async function generateOptimizationReport(dbPath) {
|
|
|
758
868
|
export default {
|
|
759
869
|
optimizeHiveMindDatabase,
|
|
760
870
|
performMaintenance,
|
|
761
|
-
generateOptimizationReport
|
|
762
|
-
};
|
|
871
|
+
generateOptimizationReport,
|
|
872
|
+
};
|