claude-flow-novice 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/MIGRATION_SUMMARY.md +222 -0
- package/.claude/agents/README.md +89 -0
- package/.claude/agents/analysis/code-analyzer.md +209 -0
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
- package/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
- package/.claude/agents/base-template-generator.md +42 -0
- package/.claude/agents/consensus/README.md +253 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
- package/.claude/agents/consensus/consensus-builder.md +242 -0
- package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
- package/.claude/agents/consensus/gossip-coordinator.md +63 -0
- package/.claude/agents/consensus/performance-benchmarker.md +851 -0
- package/.claude/agents/consensus/quorum-manager.md +823 -0
- package/.claude/agents/consensus/raft-manager.md +63 -0
- package/.claude/agents/consensus/security-manager.md +622 -0
- package/.claude/agents/core/coder.md +211 -0
- package/.claude/agents/core/planner.md +116 -0
- package/.claude/agents/core/researcher.md +136 -0
- package/.claude/agents/core/reviewer.md +272 -0
- package/.claude/agents/core/tester.md +266 -0
- package/.claude/agents/data/ml/data-ml-model.md +193 -0
- package/.claude/agents/development/backend/dev-backend-api.md +142 -0
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
- package/.claude/agents/flow-nexus/app-store.md +88 -0
- package/.claude/agents/flow-nexus/authentication.md +69 -0
- package/.claude/agents/flow-nexus/challenges.md +81 -0
- package/.claude/agents/flow-nexus/neural-network.md +88 -0
- package/.claude/agents/flow-nexus/payments.md +83 -0
- package/.claude/agents/flow-nexus/sandbox.md +76 -0
- package/.claude/agents/flow-nexus/swarm.md +76 -0
- package/.claude/agents/flow-nexus/user-tools.md +96 -0
- package/.claude/agents/flow-nexus/workflow.md +84 -0
- package/.claude/agents/github/code-review-swarm.md +538 -0
- package/.claude/agents/github/github-modes.md +173 -0
- package/.claude/agents/github/issue-tracker.md +319 -0
- package/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude/agents/github/pr-manager.md +191 -0
- package/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude/agents/github/release-manager.md +367 -0
- package/.claude/agents/github/release-swarm.md +583 -0
- package/.claude/agents/github/repo-architect.md +398 -0
- package/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude/agents/github/workflow-automation.md +635 -0
- package/.claude/agents/goal/goal-planner.md +73 -0
- package/.claude/agents/neural/safla-neural.md +74 -0
- package/.claude/agents/optimization/README.md +250 -0
- package/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude/agents/sparc/architecture.md +472 -0
- package/.claude/agents/sparc/pseudocode.md +318 -0
- package/.claude/agents/sparc/refinement.md +525 -0
- package/.claude/agents/sparc/specification.md +276 -0
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
- package/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
- package/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
- package/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
- package/.claude/agents/sublinear/pagerank-agent.md +699 -0
- package/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
- package/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
- package/.claude/agents/sublinear/sublinear.md +816 -0
- package/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
- package/.claude/agents/swarm/README.md +190 -0
- package/.claude/agents/swarm/adaptive-coordinator.md +396 -0
- package/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
- package/.claude/agents/swarm/mesh-coordinator.md +435 -0
- package/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +90 -0
- package/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude/agents/templates/migration-plan.md +746 -0
- package/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude/agents/templates/sparc-coordinator.md +183 -0
- package/.claude/agents/testing/e2e/playwright-agent.md +249 -0
- package/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
- package/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude/commands/agents/README.md +10 -0
- package/.claude/commands/agents/agent-capabilities.md +21 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +26 -0
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/README.md +9 -0
- package/.claude/commands/analysis/bottleneck-detect.md +162 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
- package/.claude/commands/analysis/performance-report.md +25 -0
- package/.claude/commands/analysis/token-efficiency.md +45 -0
- package/.claude/commands/analysis/token-usage.md +25 -0
- package/.claude/commands/automation/README.md +9 -0
- package/.claude/commands/automation/auto-agent.md +122 -0
- package/.claude/commands/automation/self-healing.md +106 -0
- package/.claude/commands/automation/session-memory.md +90 -0
- package/.claude/commands/automation/smart-agents.md +73 -0
- package/.claude/commands/automation/smart-spawn.md +25 -0
- package/.claude/commands/automation/workflow-select.md +25 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/flow-nexus/app-store.md +124 -0
- package/.claude/commands/flow-nexus/challenges.md +120 -0
- package/.claude/commands/flow-nexus/login-registration.md +65 -0
- package/.claude/commands/flow-nexus/neural-network.md +134 -0
- package/.claude/commands/flow-nexus/payments.md +116 -0
- package/.claude/commands/flow-nexus/sandbox.md +83 -0
- package/.claude/commands/flow-nexus/swarm.md +87 -0
- package/.claude/commands/flow-nexus/user-tools.md +152 -0
- package/.claude/commands/flow-nexus/workflow.md +115 -0
- package/.claude/commands/github/README.md +11 -0
- package/.claude/commands/github/code-review-swarm.md +514 -0
- package/.claude/commands/github/code-review.md +25 -0
- package/.claude/commands/github/github-modes.md +147 -0
- package/.claude/commands/github/github-swarm.md +121 -0
- package/.claude/commands/github/issue-tracker.md +292 -0
- package/.claude/commands/github/issue-triage.md +25 -0
- package/.claude/commands/github/multi-repo-swarm.md +519 -0
- package/.claude/commands/github/pr-enhance.md +26 -0
- package/.claude/commands/github/pr-manager.md +170 -0
- package/.claude/commands/github/project-board-sync.md +471 -0
- package/.claude/commands/github/release-manager.md +338 -0
- package/.claude/commands/github/release-swarm.md +544 -0
- package/.claude/commands/github/repo-analyze.md +25 -0
- package/.claude/commands/github/repo-architect.md +367 -0
- package/.claude/commands/github/swarm-issue.md +482 -0
- package/.claude/commands/github/swarm-pr.md +285 -0
- package/.claude/commands/github/sync-coordinator.md +301 -0
- package/.claude/commands/github/workflow-automation.md +442 -0
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/hooks/README.md +11 -0
- package/.claude/commands/hooks/overview.md +58 -0
- package/.claude/commands/hooks/post-edit.md +117 -0
- package/.claude/commands/hooks/post-task.md +112 -0
- package/.claude/commands/hooks/pre-edit.md +113 -0
- package/.claude/commands/hooks/pre-task.md +111 -0
- package/.claude/commands/hooks/session-end.md +118 -0
- package/.claude/commands/hooks/setup.md +103 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/memory/usage.md +46 -0
- package/.claude/commands/monitoring/README.md +9 -0
- package/.claude/commands/monitoring/agent-metrics.md +25 -0
- package/.claude/commands/monitoring/agents.md +44 -0
- package/.claude/commands/monitoring/real-time-view.md +25 -0
- package/.claude/commands/monitoring/status.md +46 -0
- package/.claude/commands/monitoring/swarm-monitor.md +25 -0
- package/.claude/commands/optimization/README.md +9 -0
- package/.claude/commands/optimization/auto-topology.md +62 -0
- package/.claude/commands/optimization/cache-manage.md +25 -0
- package/.claude/commands/optimization/parallel-execute.md +25 -0
- package/.claude/commands/optimization/parallel-execution.md +50 -0
- package/.claude/commands/optimization/topology-optimize.md +25 -0
- package/.claude/commands/pair/README.md +261 -0
- package/.claude/commands/pair/commands.md +546 -0
- package/.claude/commands/pair/config.md +510 -0
- package/.claude/commands/pair/examples.md +512 -0
- package/.claude/commands/pair/modes.md +348 -0
- package/.claude/commands/pair/session.md +407 -0
- package/.claude/commands/pair/start.md +209 -0
- package/.claude/commands/sparc/analyzer.md +52 -0
- package/.claude/commands/sparc/architect.md +53 -0
- package/.claude/commands/sparc/batch-executor.md +54 -0
- package/.claude/commands/sparc/coder.md +54 -0
- package/.claude/commands/sparc/debugger.md +54 -0
- package/.claude/commands/sparc/designer.md +53 -0
- package/.claude/commands/sparc/documenter.md +54 -0
- package/.claude/commands/sparc/innovator.md +54 -0
- package/.claude/commands/sparc/memory-manager.md +54 -0
- package/.claude/commands/sparc/optimizer.md +54 -0
- package/.claude/commands/sparc/orchestrator.md +132 -0
- package/.claude/commands/sparc/researcher.md +54 -0
- package/.claude/commands/sparc/reviewer.md +54 -0
- package/.claude/commands/sparc/sparc-modes.md +174 -0
- package/.claude/commands/sparc/swarm-coordinator.md +54 -0
- package/.claude/commands/sparc/tdd.md +54 -0
- package/.claude/commands/sparc/tester.md +54 -0
- package/.claude/commands/sparc/workflow-manager.md +54 -0
- package/.claude/commands/stream-chain/pipeline.md +121 -0
- package/.claude/commands/stream-chain/run.md +70 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +27 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/testing/playwright-e2e.md +288 -0
- package/.claude/commands/training/README.md +9 -0
- package/.claude/commands/training/model-update.md +25 -0
- package/.claude/commands/training/neural-patterns.md +74 -0
- package/.claude/commands/training/neural-train.md +25 -0
- package/.claude/commands/training/pattern-learn.md +25 -0
- package/.claude/commands/training/specialization.md +63 -0
- package/.claude/commands/truth/start.md +143 -0
- package/.claude/commands/verify/check.md +50 -0
- package/.claude/commands/verify/start.md +128 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/checkpoint-manager.sh +251 -0
- package/.claude/helpers/github-safe.js +106 -0
- package/.claude/helpers/github-setup.sh +28 -0
- package/.claude/helpers/quick-start.sh +19 -0
- package/.claude/helpers/setup-mcp.sh +18 -0
- package/.claude/helpers/standard-checkpoint-hooks.sh +179 -0
- package/.claude/settings.json +112 -0
- package/.claude/settings.local.json +10 -0
- package/CHANGELOG.md +1517 -0
- package/LICENSE +21 -0
- package/README.md +338 -0
- package/dist/src/adapters/cliffy-node.js +70 -0
- package/dist/src/adapters/cliffy-node.js.map +1 -0
- package/dist/src/agents/agent-loader.js +208 -0
- package/dist/src/agents/agent-loader.js.map +1 -0
- package/dist/src/agents/agent-manager.js +1786 -0
- package/dist/src/agents/agent-manager.js.map +1 -0
- package/dist/src/agents/agent-registry.js +356 -0
- package/dist/src/agents/agent-registry.js.map +1 -0
- package/dist/src/agents/agent-validator.js +273 -0
- package/dist/src/agents/agent-validator.js.map +1 -0
- package/dist/src/agents/github/agent-factory.js +553 -0
- package/dist/src/agents/github/agent-factory.js.map +1 -0
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js +307 -0
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js.map +1 -0
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js +334 -0
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js.map +1 -0
- package/dist/src/agents/github/core/github-collaboration-manager.js +796 -0
- package/dist/src/agents/github/core/github-collaboration-manager.js.map +1 -0
- package/dist/src/agents/github/core/github-integration-manager.js +546 -0
- package/dist/src/agents/github/core/github-integration-manager.js.map +1 -0
- package/dist/src/agents/github/core/github-release-coordinator.js +718 -0
- package/dist/src/agents/github/core/github-release-coordinator.js.map +1 -0
- package/dist/src/agents/github/index.js +68 -0
- package/dist/src/agents/github/index.js.map +1 -0
- package/dist/src/agents/github/types/index.js +6 -0
- package/dist/src/agents/github/types/index.js.map +1 -0
- package/dist/src/agents/github/utils/error-handling.js +496 -0
- package/dist/src/agents/github/utils/error-handling.js.map +1 -0
- package/dist/src/agents/github/utils/github-client.js +158 -0
- package/dist/src/agents/github/utils/github-client.js.map +1 -0
- package/dist/src/agents/github/utils/hook-integration.js +450 -0
- package/dist/src/agents/github/utils/hook-integration.js.map +1 -0
- package/dist/src/agents/github/utils/performance-optimizer.js +501 -0
- package/dist/src/agents/github/utils/performance-optimizer.js.map +1 -0
- package/dist/src/agents/hierarchical-coordinator.js +775 -0
- package/dist/src/agents/hierarchical-coordinator.js.map +1 -0
- package/dist/src/agents/lifecycle-manager.js +613 -0
- package/dist/src/agents/lifecycle-manager.js.map +1 -0
- package/dist/src/agents/mesh-coordinator.js +580 -0
- package/dist/src/agents/mesh-coordinator.js.map +1 -0
- package/dist/src/agents/simple-agent.js +89 -0
- package/dist/src/agents/simple-agent.js.map +1 -0
- package/dist/src/agents/task-agent-integration.js +240 -0
- package/dist/src/agents/task-agent-integration.js.map +1 -0
- package/dist/src/api/auth-service.js +474 -0
- package/dist/src/api/auth-service.js.map +1 -0
- package/dist/src/api/claude-api-errors.js +171 -0
- package/dist/src/api/claude-api-errors.js.map +1 -0
- package/dist/src/api/claude-client-enhanced.js +473 -0
- package/dist/src/api/claude-client-enhanced.js.map +1 -0
- package/dist/src/api/claude-client.js +527 -0
- package/dist/src/api/claude-client.js.map +1 -0
- package/dist/src/api/database-service.js +666 -0
- package/dist/src/api/database-service.js.map +1 -0
- package/dist/src/api/swarm-api.js +585 -0
- package/dist/src/api/swarm-api.js.map +1 -0
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js +448 -0
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js.map +1 -0
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js +572 -0
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js.map +1 -0
- package/dist/src/automation/test-pipeline/PipelineValidator.js +654 -0
- package/dist/src/automation/test-pipeline/PipelineValidator.js.map +1 -0
- package/dist/src/automation/test-pipeline/RegressionTestManager.js +545 -0
- package/dist/src/automation/test-pipeline/RegressionTestManager.js.map +1 -0
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js +450 -0
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js.map +1 -0
- package/dist/src/automation/test-pipeline/TestDataManager.js +708 -0
- package/dist/src/automation/test-pipeline/TestDataManager.js.map +1 -0
- package/dist/src/automation/test-pipeline/TestReportingSystem.js +527 -0
- package/dist/src/automation/test-pipeline/TestReportingSystem.js.map +1 -0
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js +353 -0
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js.map +1 -0
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js +448 -0
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js.map +1 -0
- package/dist/src/ci-cd/deployment-orchestrator.js +477 -0
- package/dist/src/ci-cd/deployment-orchestrator.js.map +1 -0
- package/dist/src/ci-cd/github-actions-templates.js +972 -0
- package/dist/src/ci-cd/github-actions-templates.js.map +1 -0
- package/dist/src/ci-cd/performance/PerformanceGate.js +383 -0
- package/dist/src/ci-cd/performance/PerformanceGate.js.map +1 -0
- package/dist/src/cli/agents/analyst.js +788 -0
- package/dist/src/cli/agents/analyst.js.map +1 -0
- package/dist/src/cli/agents/architect.js +846 -0
- package/dist/src/cli/agents/architect.js.map +1 -0
- package/dist/src/cli/agents/base-agent.js +437 -0
- package/dist/src/cli/agents/base-agent.js.map +1 -0
- package/dist/src/cli/agents/capabilities.js +701 -0
- package/dist/src/cli/agents/capabilities.js.map +1 -0
- package/dist/src/cli/agents/coder.js +936 -0
- package/dist/src/cli/agents/coder.js.map +1 -0
- package/dist/src/cli/agents/coordinator.js +489 -0
- package/dist/src/cli/agents/coordinator.js.map +1 -0
- package/dist/src/cli/agents/hive-agents.js +708 -0
- package/dist/src/cli/agents/hive-agents.js.map +1 -0
- package/dist/src/cli/agents/index.js +299 -0
- package/dist/src/cli/agents/index.js.map +1 -0
- package/dist/src/cli/agents/researcher.js +388 -0
- package/dist/src/cli/agents/researcher.js.map +1 -0
- package/dist/src/cli/agents/tester.js +634 -0
- package/dist/src/cli/agents/tester.js.map +1 -0
- package/dist/src/cli/cli-core.js +264 -0
- package/dist/src/cli/cli-core.js.map +1 -0
- package/dist/src/cli/commands/advanced-memory-commands.js +834 -0
- package/dist/src/cli/commands/advanced-memory-commands.js.map +1 -0
- package/dist/src/cli/commands/agent-simple.js +346 -0
- package/dist/src/cli/commands/agent-simple.js.map +1 -0
- package/dist/src/cli/commands/agent.js +368 -0
- package/dist/src/cli/commands/agent.js.map +1 -0
- package/dist/src/cli/commands/claude-api.js +237 -0
- package/dist/src/cli/commands/claude-api.js.map +1 -0
- package/dist/src/cli/commands/claude.js +132 -0
- package/dist/src/cli/commands/claude.js.map +1 -0
- package/dist/src/cli/commands/config-integration.js +395 -0
- package/dist/src/cli/commands/config-integration.js.map +1 -0
- package/dist/src/cli/commands/config.js +67 -0
- package/dist/src/cli/commands/config.js.map +1 -0
- package/dist/src/cli/commands/enterprise.js +1523 -0
- package/dist/src/cli/commands/enterprise.js.map +1 -0
- package/dist/src/cli/commands/goal-init.js +262 -0
- package/dist/src/cli/commands/goal-init.js.map +1 -0
- package/dist/src/cli/commands/help-new.js +276 -0
- package/dist/src/cli/commands/help-new.js.map +1 -0
- package/dist/src/cli/commands/help.js +1055 -0
- package/dist/src/cli/commands/help.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/index.js +20 -0
- package/dist/src/cli/commands/hive-mind/index.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/init.js +58 -0
- package/dist/src/cli/commands/hive-mind/init.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/optimize-memory.js +362 -0
- package/dist/src/cli/commands/hive-mind/optimize-memory.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/pause.js +73 -0
- package/dist/src/cli/commands/hive-mind/pause.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/ps.js +104 -0
- package/dist/src/cli/commands/hive-mind/ps.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/resume.js +56 -0
- package/dist/src/cli/commands/hive-mind/resume.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/spawn.js +242 -0
- package/dist/src/cli/commands/hive-mind/spawn.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/status.js +250 -0
- package/dist/src/cli/commands/hive-mind/status.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/stop.js +116 -0
- package/dist/src/cli/commands/hive-mind/stop.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/task.js +302 -0
- package/dist/src/cli/commands/hive-mind/task.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/wizard.js +705 -0
- package/dist/src/cli/commands/hive-mind/wizard.js.map +1 -0
- package/dist/src/cli/commands/hive.js +506 -0
- package/dist/src/cli/commands/hive.js.map +1 -0
- package/dist/src/cli/commands/hook-types.js +5 -0
- package/dist/src/cli/commands/hook-types.js.map +1 -0
- package/dist/src/cli/commands/hook-validator.js +177 -0
- package/dist/src/cli/commands/hook-validator.js.map +1 -0
- package/dist/src/cli/commands/hook.js +303 -0
- package/dist/src/cli/commands/hook.js.map +1 -0
- package/dist/src/cli/commands/index.js +2745 -0
- package/dist/src/cli/commands/index.js.map +1 -0
- package/dist/src/cli/commands/maestro.js +242 -0
- package/dist/src/cli/commands/maestro.js.map +1 -0
- package/dist/src/cli/commands/mcp.js +148 -0
- package/dist/src/cli/commands/mcp.js.map +1 -0
- package/dist/src/cli/commands/memory.js +193 -0
- package/dist/src/cli/commands/memory.js.map +1 -0
- package/dist/src/cli/commands/migrate.js +107 -0
- package/dist/src/cli/commands/migrate.js.map +1 -0
- package/dist/src/cli/commands/monitor.js +574 -0
- package/dist/src/cli/commands/monitor.js.map +1 -0
- package/dist/src/cli/commands/neural-init.js +211 -0
- package/dist/src/cli/commands/neural-init.js.map +1 -0
- package/dist/src/cli/commands/ruv-swarm.js +555 -0
- package/dist/src/cli/commands/ruv-swarm.js.map +1 -0
- package/dist/src/cli/commands/session.js +517 -0
- package/dist/src/cli/commands/session.js.map +1 -0
- package/dist/src/cli/commands/sparc.js +486 -0
- package/dist/src/cli/commands/sparc.js.map +1 -0
- package/dist/src/cli/commands/start/event-emitter.js +35 -0
- package/dist/src/cli/commands/start/event-emitter.js.map +1 -0
- package/dist/src/cli/commands/start/index.js +9 -0
- package/dist/src/cli/commands/start/index.js.map +1 -0
- package/dist/src/cli/commands/start/process-manager.js +294 -0
- package/dist/src/cli/commands/start/process-manager.js.map +1 -0
- package/dist/src/cli/commands/start/process-ui-simple.js +322 -0
- package/dist/src/cli/commands/start/process-ui-simple.js.map +1 -0
- package/dist/src/cli/commands/start/process-ui.js +5 -0
- package/dist/src/cli/commands/start/process-ui.js.map +1 -0
- package/dist/src/cli/commands/start/start-command.js +463 -0
- package/dist/src/cli/commands/start/start-command.js.map +1 -0
- package/dist/src/cli/commands/start/system-monitor.js +268 -0
- package/dist/src/cli/commands/start/system-monitor.js.map +1 -0
- package/dist/src/cli/commands/start/types.js +22 -0
- package/dist/src/cli/commands/start/types.js.map +1 -0
- package/dist/src/cli/commands/start.js +6 -0
- package/dist/src/cli/commands/start.js.map +1 -0
- package/dist/src/cli/commands/status.js +328 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/swarm-spawn.js +56 -0
- package/dist/src/cli/commands/swarm-spawn.js.map +1 -0
- package/dist/src/cli/commands/swarm.js +567 -0
- package/dist/src/cli/commands/swarm.js.map +1 -0
- package/dist/src/cli/commands/task.js +44 -0
- package/dist/src/cli/commands/task.js.map +1 -0
- package/dist/src/cli/commands/validate-integration.js +122 -0
- package/dist/src/cli/commands/validate-integration.js.map +1 -0
- package/dist/src/cli/commands/verification.js +351 -0
- package/dist/src/cli/commands/verification.js.map +1 -0
- package/dist/src/cli/commands/workflow.js +615 -0
- package/dist/src/cli/commands/workflow.js.map +1 -0
- package/dist/src/cli/completion.js +578 -0
- package/dist/src/cli/completion.js.map +1 -0
- package/dist/src/cli/consolidated/ConsolidatedCLI.js +379 -0
- package/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -0
- package/dist/src/cli/consolidated/core/CommandHandlers.js +833 -0
- package/dist/src/cli/consolidated/core/CommandHandlers.js.map +1 -0
- package/dist/src/cli/consolidated/core/TierManager.js +291 -0
- package/dist/src/cli/consolidated/core/TierManager.js.map +1 -0
- package/dist/src/cli/consolidated/help/InteractiveHelp.js +714 -0
- package/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -0
- package/dist/src/cli/consolidated/index.js +62 -0
- package/dist/src/cli/consolidated/index.js.map +1 -0
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js +457 -0
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js.map +1 -0
- package/dist/src/cli/consolidated/routing/CommandRouter.js +526 -0
- package/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -0
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js +729 -0
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -0
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +416 -0
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -0
- package/dist/src/cli/formatter.js +284 -0
- package/dist/src/cli/formatter.js.map +1 -0
- package/dist/src/cli/help-formatter.js +111 -0
- package/dist/src/cli/help-formatter.js.map +1 -0
- package/dist/src/cli/index-remote.js +125 -0
- package/dist/src/cli/index-remote.js.map +1 -0
- package/dist/src/cli/index.js +159 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/init/batch-tools.js +388 -0
- package/dist/src/cli/init/batch-tools.js.map +1 -0
- package/dist/src/cli/init/claude-config.js +401 -0
- package/dist/src/cli/init/claude-config.js.map +1 -0
- package/dist/src/cli/init/directory-structure.js +146 -0
- package/dist/src/cli/init/directory-structure.js.map +1 -0
- package/dist/src/cli/init/index.js +52 -0
- package/dist/src/cli/init/index.js.map +1 -0
- package/dist/src/cli/init/sparc-environment.js +543 -0
- package/dist/src/cli/init/sparc-environment.js.map +1 -0
- package/dist/src/cli/init/swarm-commands.js +796 -0
- package/dist/src/cli/init/swarm-commands.js.map +1 -0
- package/dist/src/cli/init/utils.js +15 -0
- package/dist/src/cli/init/utils.js.map +1 -0
- package/dist/src/cli/maestro-cli-bridge.js +426 -0
- package/dist/src/cli/maestro-cli-bridge.js.map +1 -0
- package/dist/src/cli/main.js +26 -0
- package/dist/src/cli/main.js.map +1 -0
- package/dist/src/cli/node-repl.js +652 -0
- package/dist/src/cli/node-repl.js.map +1 -0
- package/dist/src/cli/repl.js +1078 -0
- package/dist/src/cli/repl.js.map +1 -0
- package/dist/src/cli/simple-cli.js +3026 -0
- package/dist/src/cli/simple-cli.js.map +1 -0
- package/dist/src/cli/simple-mcp.js +87 -0
- package/dist/src/cli/simple-mcp.js.map +1 -0
- package/dist/src/cli/simple-orchestrator.js +857 -0
- package/dist/src/cli/simple-orchestrator.js.map +1 -0
- package/dist/src/cli/ui/compatible-ui.js +322 -0
- package/dist/src/cli/ui/compatible-ui.js.map +1 -0
- package/dist/src/cli/ui/fallback-handler.js +156 -0
- package/dist/src/cli/ui/fallback-handler.js.map +1 -0
- package/dist/src/cli/ui/index.js +32 -0
- package/dist/src/cli/ui/index.js.map +1 -0
- package/dist/src/cli/utils/environment-detector.js +228 -0
- package/dist/src/cli/utils/environment-detector.js.map +1 -0
- package/dist/src/cli/utils/prompt-defaults.js +234 -0
- package/dist/src/cli/utils/prompt-defaults.js.map +1 -0
- package/dist/src/cli/validation-helper.js +66 -0
- package/dist/src/cli/validation-helper.js.map +1 -0
- package/dist/src/communication/message-bus.js +1007 -0
- package/dist/src/communication/message-bus.js.map +1 -0
- package/dist/src/communication/reliable-communication-manager.js +374 -0
- package/dist/src/communication/reliable-communication-manager.js.map +1 -0
- package/dist/src/config/ai/decision-tree-generator.js +763 -0
- package/dist/src/config/ai/decision-tree-generator.js.map +1 -0
- package/dist/src/config/ai/project-detection-engine.js +1081 -0
- package/dist/src/config/ai/project-detection-engine.js.map +1 -0
- package/dist/src/config/config-manager.js +1285 -0
- package/dist/src/config/config-manager.js.map +1 -0
- package/dist/src/config/consent-manager.js +433 -0
- package/dist/src/config/consent-manager.js.map +1 -0
- package/dist/src/config/core/intelligent-configuration-manager.js +674 -0
- package/dist/src/config/core/intelligent-configuration-manager.js.map +1 -0
- package/dist/src/config/index.js +110 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/integration/hooks-integration.js +548 -0
- package/dist/src/config/integration/hooks-integration.js.map +1 -0
- package/dist/src/config/migration/config-migration.js +285 -0
- package/dist/src/config/migration/config-migration.js.map +1 -0
- package/dist/src/config/migration/version-migration-engine.js +984 -0
- package/dist/src/config/migration/version-migration-engine.js.map +1 -0
- package/dist/src/config/migration-manager.js +529 -0
- package/dist/src/config/migration-manager.js.map +1 -0
- package/dist/src/config/ruv-swarm-config.js +332 -0
- package/dist/src/config/ruv-swarm-config.js.map +1 -0
- package/dist/src/config/ruv-swarm-integration.js +285 -0
- package/dist/src/config/ruv-swarm-integration.js.map +1 -0
- package/dist/src/config/storage/multi-tier-storage.js +626 -0
- package/dist/src/config/storage/multi-tier-storage.js.map +1 -0
- package/dist/src/config/test-migration-fixer.js +332 -0
- package/dist/src/config/test-migration-fixer.js.map +1 -0
- package/dist/src/config/ui/progressive-disclosure-engine.js +876 -0
- package/dist/src/config/ui/progressive-disclosure-engine.js.map +1 -0
- package/dist/src/config/utils/config-export-import.js +454 -0
- package/dist/src/config/utils/config-export-import.js.map +1 -0
- package/dist/src/config/utils/zero-config-setup.js +238 -0
- package/dist/src/config/utils/zero-config-setup.js.map +1 -0
- package/dist/src/config/validation/config-validator.js +462 -0
- package/dist/src/config/validation/config-validator.js.map +1 -0
- package/dist/src/config/web-portal-config.js +343 -0
- package/dist/src/config/web-portal-config.js.map +1 -0
- package/dist/src/config/zero-config-setup.js +294 -0
- package/dist/src/config/zero-config-setup.js.map +1 -0
- package/dist/src/constants/agent-types.js +51 -0
- package/dist/src/constants/agent-types.js.map +1 -0
- package/dist/src/coordination/advanced-scheduler.js +370 -0
- package/dist/src/coordination/advanced-scheduler.js.map +1 -0
- package/dist/src/coordination/advanced-task-executor.js +481 -0
- package/dist/src/coordination/advanced-task-executor.js.map +1 -0
- package/dist/src/coordination/background-executor.js +366 -0
- package/dist/src/coordination/background-executor.js.map +1 -0
- package/dist/src/coordination/circuit-breaker.js +286 -0
- package/dist/src/coordination/circuit-breaker.js.map +1 -0
- package/dist/src/coordination/conflict-resolution.js +348 -0
- package/dist/src/coordination/conflict-resolution.js.map +1 -0
- package/dist/src/coordination/dependency-graph.js +398 -0
- package/dist/src/coordination/dependency-graph.js.map +1 -0
- package/dist/src/coordination/hive-orchestrator.js +309 -0
- package/dist/src/coordination/hive-orchestrator.js.map +1 -0
- package/dist/src/coordination/hive-protocol.js +363 -0
- package/dist/src/coordination/hive-protocol.js.map +1 -0
- package/dist/src/coordination/index.js +21 -0
- package/dist/src/coordination/index.js.map +1 -0
- package/dist/src/coordination/load-balancer.js +737 -0
- package/dist/src/coordination/load-balancer.js.map +1 -0
- package/dist/src/coordination/manager.js +360 -0
- package/dist/src/coordination/manager.js.map +1 -0
- package/dist/src/coordination/messaging.js +221 -0
- package/dist/src/coordination/messaging.js.map +1 -0
- package/dist/src/coordination/metrics.js +415 -0
- package/dist/src/coordination/metrics.js.map +1 -0
- package/dist/src/coordination/resources.js +276 -0
- package/dist/src/coordination/resources.js.map +1 -0
- package/dist/src/coordination/scheduler.js +322 -0
- package/dist/src/coordination/scheduler.js.map +1 -0
- package/dist/src/coordination/swarm-coordinator.js +585 -0
- package/dist/src/coordination/swarm-coordinator.js.map +1 -0
- package/dist/src/coordination/swarm-monitor.js +359 -0
- package/dist/src/coordination/swarm-monitor.js.map +1 -0
- package/dist/src/coordination/work-stealing.js +164 -0
- package/dist/src/coordination/work-stealing.js.map +1 -0
- package/dist/src/core/agent-manager.js +80 -0
- package/dist/src/core/agent-manager.js.map +1 -0
- package/dist/src/core/config.js +1221 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/event-bus.js +136 -0
- package/dist/src/core/event-bus.js.map +1 -0
- package/dist/src/core/index.js +6 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/json-persistence.js +112 -0
- package/dist/src/core/json-persistence.js.map +1 -0
- package/dist/src/core/logger.js +245 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/orchestrator-fixed.js +236 -0
- package/dist/src/core/orchestrator-fixed.js.map +1 -0
- package/dist/src/core/orchestrator.js +1136 -0
- package/dist/src/core/orchestrator.js.map +1 -0
- package/dist/src/core/persistence.js +185 -0
- package/dist/src/core/persistence.js.map +1 -0
- package/dist/src/core/project-manager.js +80 -0
- package/dist/src/core/project-manager.js.map +1 -0
- package/dist/src/core/version.js +35 -0
- package/dist/src/core/version.js.map +1 -0
- package/dist/src/crdt/types.js +509 -0
- package/dist/src/crdt/types.js.map +1 -0
- package/dist/src/enterprise/analytics-manager.js +1133 -0
- package/dist/src/enterprise/analytics-manager.js.map +1 -0
- package/dist/src/enterprise/audit-manager.js +1112 -0
- package/dist/src/enterprise/audit-manager.js.map +1 -0
- package/dist/src/enterprise/cloud-manager.js +886 -0
- package/dist/src/enterprise/cloud-manager.js.map +1 -0
- package/dist/src/enterprise/deployment-manager.js +963 -0
- package/dist/src/enterprise/deployment-manager.js.map +1 -0
- package/dist/src/enterprise/index.js +8 -0
- package/dist/src/enterprise/index.js.map +1 -0
- package/dist/src/enterprise/project-manager.js +577 -0
- package/dist/src/enterprise/project-manager.js.map +1 -0
- package/dist/src/enterprise/security-manager.js +987 -0
- package/dist/src/enterprise/security-manager.js.map +1 -0
- package/dist/src/feature-flags/cli/Phase4CLI.js +463 -0
- package/dist/src/feature-flags/cli/Phase4CLI.js.map +1 -0
- package/dist/src/feature-flags/core/FeatureFlagManager.js +324 -0
- package/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -0
- package/dist/src/feature-flags/index.js +237 -0
- package/dist/src/feature-flags/index.js.map +1 -0
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js +275 -0
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js.map +1 -0
- package/dist/src/feature-flags/rollout/RolloutController.js +301 -0
- package/dist/src/feature-flags/rollout/RolloutController.js.map +1 -0
- package/dist/src/feature-flags/validation/HookInterceptor.js +310 -0
- package/dist/src/feature-flags/validation/HookInterceptor.js.map +1 -0
- package/dist/src/feature-flags/validation/TruthBasedValidator.js +263 -0
- package/dist/src/feature-flags/validation/TruthBasedValidator.js.map +1 -0
- package/dist/src/hive-mind/core/Agent.js +569 -0
- package/dist/src/hive-mind/core/Agent.js.map +1 -0
- package/dist/src/hive-mind/core/Communication.js +411 -0
- package/dist/src/hive-mind/core/Communication.js.map +1 -0
- package/dist/src/hive-mind/core/DatabaseManager.js +599 -0
- package/dist/src/hive-mind/core/DatabaseManager.js.map +1 -0
- package/dist/src/hive-mind/core/HiveMind.js +575 -0
- package/dist/src/hive-mind/core/HiveMind.js.map +1 -0
- package/dist/src/hive-mind/core/Memory.js +1159 -0
- package/dist/src/hive-mind/core/Memory.js.map +1 -0
- package/dist/src/hive-mind/core/MemoryMonitor.js +525 -0
- package/dist/src/hive-mind/core/MemoryMonitor.js.map +1 -0
- package/dist/src/hive-mind/core/Queen.js +753 -0
- package/dist/src/hive-mind/core/Queen.js.map +1 -0
- package/dist/src/hive-mind/index.js +21 -0
- package/dist/src/hive-mind/index.js.map +1 -0
- package/dist/src/hive-mind/integration/ConsensusEngine.js +460 -0
- package/dist/src/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/dist/src/hive-mind/integration/MCPToolWrapper.js +243 -0
- package/dist/src/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js +812 -0
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/dist/src/hive-mind/types.js +9 -0
- package/dist/src/hive-mind/types.js.map +1 -0
- package/dist/src/hooks/index.js +197 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/index.js +11 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/integration/mock-components.js +362 -0
- package/dist/src/integration/mock-components.js.map +1 -0
- package/dist/src/integration/system-integration.js +428 -0
- package/dist/src/integration/system-integration.js.map +1 -0
- package/dist/src/integration/types.js +5 -0
- package/dist/src/integration/types.js.map +1 -0
- package/dist/src/lifecycle/communication-protocols.js +568 -0
- package/dist/src/lifecycle/communication-protocols.js.map +1 -0
- package/dist/src/lifecycle/dependency-tracker.js +799 -0
- package/dist/src/lifecycle/dependency-tracker.js.map +1 -0
- package/dist/src/lifecycle/memory-schema.js +622 -0
- package/dist/src/lifecycle/memory-schema.js.map +1 -0
- package/dist/src/maestro/maestro-swarm-coordinator.js +504 -0
- package/dist/src/maestro/maestro-swarm-coordinator.js.map +1 -0
- package/dist/src/maestro/maestro-types.js +3 -0
- package/dist/src/maestro/maestro-types.js.map +1 -0
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js +382 -0
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js.map +1 -0
- package/dist/src/mcp/auth.js +347 -0
- package/dist/src/mcp/auth.js.map +1 -0
- package/dist/src/mcp/claude-code-wrapper.js +717 -0
- package/dist/src/mcp/claude-code-wrapper.js.map +1 -0
- package/dist/src/mcp/claude-flow-tools.js +1365 -0
- package/dist/src/mcp/claude-flow-tools.js.map +1 -0
- package/dist/src/mcp/client.js +201 -0
- package/dist/src/mcp/client.js.map +1 -0
- package/dist/src/mcp/index.js +192 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/integrate-wrapper.js +85 -0
- package/dist/src/mcp/integrate-wrapper.js.map +1 -0
- package/dist/src/mcp/lifecycle-manager.js +348 -0
- package/dist/src/mcp/lifecycle-manager.js.map +1 -0
- package/dist/src/mcp/load-balancer.js +386 -0
- package/dist/src/mcp/load-balancer.js.map +1 -0
- package/dist/src/mcp/orchestration-integration.js +800 -0
- package/dist/src/mcp/orchestration-integration.js.map +1 -0
- package/dist/src/mcp/performance-monitor.js +489 -0
- package/dist/src/mcp/performance-monitor.js.map +1 -0
- package/dist/src/mcp/protocol-manager.js +376 -0
- package/dist/src/mcp/protocol-manager.js.map +1 -0
- package/dist/src/mcp/recovery/connection-health-monitor.js +240 -0
- package/dist/src/mcp/recovery/connection-health-monitor.js.map +1 -0
- package/dist/src/mcp/recovery/connection-state-manager.js +309 -0
- package/dist/src/mcp/recovery/connection-state-manager.js.map +1 -0
- package/dist/src/mcp/recovery/fallback-coordinator.js +288 -0
- package/dist/src/mcp/recovery/fallback-coordinator.js.map +1 -0
- package/dist/src/mcp/recovery/index.js +10 -0
- package/dist/src/mcp/recovery/index.js.map +1 -0
- package/dist/src/mcp/recovery/reconnection-manager.js +219 -0
- package/dist/src/mcp/recovery/reconnection-manager.js.map +1 -0
- package/dist/src/mcp/recovery/recovery-manager.js +262 -0
- package/dist/src/mcp/recovery/recovery-manager.js.map +1 -0
- package/dist/src/mcp/router.js +220 -0
- package/dist/src/mcp/router.js.map +1 -0
- package/dist/src/mcp/ruv-swarm-tools.js +671 -0
- package/dist/src/mcp/ruv-swarm-tools.js.map +1 -0
- package/dist/src/mcp/server-with-wrapper.js +32 -0
- package/dist/src/mcp/server-with-wrapper.js.map +1 -0
- package/dist/src/mcp/server-wrapper-mode.js +26 -0
- package/dist/src/mcp/server-wrapper-mode.js.map +1 -0
- package/dist/src/mcp/server.js +539 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/session-manager.js +338 -0
- package/dist/src/mcp/session-manager.js.map +1 -0
- package/dist/src/mcp/sparc-modes.js +455 -0
- package/dist/src/mcp/sparc-modes.js.map +1 -0
- package/dist/src/mcp/swarm-tools.js +903 -0
- package/dist/src/mcp/swarm-tools.js.map +1 -0
- package/dist/src/mcp/tests/mcp-integration.test.js +493 -0
- package/dist/src/mcp/tests/mcp-integration.test.js.map +1 -0
- package/dist/src/mcp/tools.js +426 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/mcp/transports/base.js +5 -0
- package/dist/src/mcp/transports/base.js.map +1 -0
- package/dist/src/mcp/transports/http.js +414 -0
- package/dist/src/mcp/transports/http.js.map +1 -0
- package/dist/src/mcp/transports/stdio.js +217 -0
- package/dist/src/mcp/transports/stdio.js.map +1 -0
- package/dist/src/memory/advanced-memory-manager.js +1522 -0
- package/dist/src/memory/advanced-memory-manager.js.map +1 -0
- package/dist/src/memory/backends/base.js +5 -0
- package/dist/src/memory/backends/base.js.map +1 -0
- package/dist/src/memory/backends/markdown.js +235 -0
- package/dist/src/memory/backends/markdown.js.map +1 -0
- package/dist/src/memory/backends/sqlite.js +295 -0
- package/dist/src/memory/backends/sqlite.js.map +1 -0
- package/dist/src/memory/cache.js +177 -0
- package/dist/src/memory/cache.js.map +1 -0
- package/dist/src/memory/distributed-memory.js +745 -0
- package/dist/src/memory/distributed-memory.js.map +1 -0
- package/dist/src/memory/indexer.js +184 -0
- package/dist/src/memory/indexer.js.map +1 -0
- package/dist/src/memory/manager.js +457 -0
- package/dist/src/memory/manager.js.map +1 -0
- package/dist/src/memory/sqlite-enhanced-backend.js +529 -0
- package/dist/src/memory/sqlite-enhanced-backend.js.map +1 -0
- package/dist/src/memory/swarm-memory.js +446 -0
- package/dist/src/memory/swarm-memory.js.map +1 -0
- package/dist/src/migration/index.js +94 -0
- package/dist/src/migration/index.js.map +1 -0
- package/dist/src/migration/logger.js +110 -0
- package/dist/src/migration/logger.js.map +1 -0
- package/dist/src/migration/migration-analyzer.js +255 -0
- package/dist/src/migration/migration-analyzer.js.map +1 -0
- package/dist/src/migration/migration-runner.js +511 -0
- package/dist/src/migration/migration-runner.js.map +1 -0
- package/dist/src/migration/migration-validator.js +272 -0
- package/dist/src/migration/migration-validator.js.map +1 -0
- package/dist/src/migration/progress-reporter.js +139 -0
- package/dist/src/migration/progress-reporter.js.map +1 -0
- package/dist/src/migration/rollback-manager.js +310 -0
- package/dist/src/migration/rollback-manager.js.map +1 -0
- package/dist/src/migration/tests/migration-system.test.js +9 -0
- package/dist/src/migration/tests/migration-system.test.js.map +1 -0
- package/dist/src/migration/types.js +5 -0
- package/dist/src/migration/types.js.map +1 -0
- package/dist/src/monitoring/diagnostics.js +532 -0
- package/dist/src/monitoring/diagnostics.js.map +1 -0
- package/dist/src/monitoring/health-check.js +355 -0
- package/dist/src/monitoring/health-check.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js +764 -0
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js +859 -0
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js +667 -0
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js.map +1 -0
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js +1008 -0
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js.map +1 -0
- package/dist/src/monitoring/phase4/rollout-decision-engine.js +849 -0
- package/dist/src/monitoring/phase4/rollout-decision-engine.js.map +1 -0
- package/dist/src/monitoring/real-time-feedback-system.js +688 -0
- package/dist/src/monitoring/real-time-feedback-system.js.map +1 -0
- package/dist/src/monitoring/real-time-monitor.js +981 -0
- package/dist/src/monitoring/real-time-monitor.js.map +1 -0
- package/dist/src/monitoring/regression/RegressionDetector.js +525 -0
- package/dist/src/monitoring/regression/RegressionDetector.js.map +1 -0
- package/dist/src/neural/NeuralDomainMapper.js +1137 -0
- package/dist/src/neural/NeuralDomainMapper.js.map +1 -0
- package/dist/src/neural/index.js +418 -0
- package/dist/src/neural/index.js.map +1 -0
- package/dist/src/neural/integration.js +590 -0
- package/dist/src/neural/integration.js.map +1 -0
- package/dist/src/providers/anthropic-provider.js +245 -0
- package/dist/src/providers/anthropic-provider.js.map +1 -0
- package/dist/src/providers/base-provider.js +389 -0
- package/dist/src/providers/base-provider.js.map +1 -0
- package/dist/src/providers/cohere-provider.js +405 -0
- package/dist/src/providers/cohere-provider.js.map +1 -0
- package/dist/src/providers/google-provider.js +376 -0
- package/dist/src/providers/google-provider.js.map +1 -0
- package/dist/src/providers/index.js +18 -0
- package/dist/src/providers/index.js.map +1 -0
- package/dist/src/providers/ollama-provider.js +400 -0
- package/dist/src/providers/ollama-provider.js.map +1 -0
- package/dist/src/providers/openai-provider.js +364 -0
- package/dist/src/providers/openai-provider.js.map +1 -0
- package/dist/src/providers/provider-manager.js +487 -0
- package/dist/src/providers/provider-manager.js.map +1 -0
- package/dist/src/providers/types.js +55 -0
- package/dist/src/providers/types.js.map +1 -0
- package/dist/src/providers/utils.js +343 -0
- package/dist/src/providers/utils.js.map +1 -0
- package/dist/src/quality-gates/automated-review-system.js +645 -0
- package/dist/src/quality-gates/automated-review-system.js.map +1 -0
- package/dist/src/resources/resource-manager.js +1275 -0
- package/dist/src/resources/resource-manager.js.map +1 -0
- package/dist/src/rollback/recovery-manager.js +1065 -0
- package/dist/src/rollback/recovery-manager.js.map +1 -0
- package/dist/src/services/agent-manager.js +308 -0
- package/dist/src/services/agent-manager.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/hook-manager.js +506 -0
- package/dist/src/services/agentic-flow-hooks/hook-manager.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/index.js +322 -0
- package/dist/src/services/agentic-flow-hooks/index.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js +445 -0
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js +558 -0
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js +595 -0
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js +640 -0
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/types.js +8 -0
- package/dist/src/services/agentic-flow-hooks/types.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js +746 -0
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +1 -0
- package/dist/src/services/performance-metrics-collector.js +529 -0
- package/dist/src/services/performance-metrics-collector.js.map +1 -0
- package/dist/src/services/swarm-coordinator.js +431 -0
- package/dist/src/services/swarm-coordinator.js.map +1 -0
- package/dist/src/services/swarm-memory-manager.js +513 -0
- package/dist/src/services/swarm-memory-manager.js.map +1 -0
- package/dist/src/services/swarm-relaunch-manager.js +408 -0
- package/dist/src/services/swarm-relaunch-manager.js.map +1 -0
- package/dist/src/services/task-handoff-service.js +361 -0
- package/dist/src/services/task-handoff-service.js.map +1 -0
- package/dist/src/swarm/__tests__/integration.test.js +229 -0
- package/dist/src/swarm/__tests__/integration.test.js.map +1 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js +346 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js.map +1 -0
- package/dist/src/swarm/advanced-orchestrator.js +1093 -0
- package/dist/src/swarm/advanced-orchestrator.js.map +1 -0
- package/dist/src/swarm/claude-code-interface.js +959 -0
- package/dist/src/swarm/claude-code-interface.js.map +1 -0
- package/dist/src/swarm/claude-flow-executor.js +218 -0
- package/dist/src/swarm/claude-flow-executor.js.map +1 -0
- package/dist/src/swarm/coordinator.js +3001 -0
- package/dist/src/swarm/coordinator.js.map +1 -0
- package/dist/src/swarm/direct-executor.js +1169 -0
- package/dist/src/swarm/direct-executor.js.map +1 -0
- package/dist/src/swarm/executor-v2.js +312 -0
- package/dist/src/swarm/executor-v2.js.map +1 -0
- package/dist/src/swarm/executor.js +813 -0
- package/dist/src/swarm/executor.js.map +1 -0
- package/dist/src/swarm/hive-mind-integration.js +700 -0
- package/dist/src/swarm/hive-mind-integration.js.map +1 -0
- package/dist/src/swarm/index.js +43 -0
- package/dist/src/swarm/index.js.map +1 -0
- package/dist/src/swarm/json-output-aggregator.js +269 -0
- package/dist/src/swarm/json-output-aggregator.js.map +1 -0
- package/dist/src/swarm/mcp-integration-wrapper.js +623 -0
- package/dist/src/swarm/mcp-integration-wrapper.js.map +1 -0
- package/dist/src/swarm/memory.js +1119 -0
- package/dist/src/swarm/memory.js.map +1 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js +350 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js.map +1 -0
- package/dist/src/swarm/optimizations/async-file-manager.js +273 -0
- package/dist/src/swarm/optimizations/async-file-manager.js.map +1 -0
- package/dist/src/swarm/optimizations/circular-buffer.js +148 -0
- package/dist/src/swarm/optimizations/circular-buffer.js.map +1 -0
- package/dist/src/swarm/optimizations/connection-pool.js +239 -0
- package/dist/src/swarm/optimizations/connection-pool.js.map +1 -0
- package/dist/src/swarm/optimizations/index.js +30 -0
- package/dist/src/swarm/optimizations/index.js.map +1 -0
- package/dist/src/swarm/optimizations/optimized-executor.js +318 -0
- package/dist/src/swarm/optimizations/optimized-executor.js.map +1 -0
- package/dist/src/swarm/optimizations/ttl-map.js +223 -0
- package/dist/src/swarm/optimizations/ttl-map.js.map +1 -0
- package/dist/src/swarm/prompt-cli.js +202 -0
- package/dist/src/swarm/prompt-cli.js.map +1 -0
- package/dist/src/swarm/prompt-copier-enhanced.js +193 -0
- package/dist/src/swarm/prompt-copier-enhanced.js.map +1 -0
- package/dist/src/swarm/prompt-copier.js +376 -0
- package/dist/src/swarm/prompt-copier.js.map +1 -0
- package/dist/src/swarm/prompt-manager.js +287 -0
- package/dist/src/swarm/prompt-manager.js.map +1 -0
- package/dist/src/swarm/prompt-utils.js +299 -0
- package/dist/src/swarm/prompt-utils.js.map +1 -0
- package/dist/src/swarm/result-aggregator.js +713 -0
- package/dist/src/swarm/result-aggregator.js.map +1 -0
- package/dist/src/swarm/sparc-executor.js +1557 -0
- package/dist/src/swarm/sparc-executor.js.map +1 -0
- package/dist/src/swarm/strategies/auto.js +751 -0
- package/dist/src/swarm/strategies/auto.js.map +1 -0
- package/dist/src/swarm/strategies/base.js +117 -0
- package/dist/src/swarm/strategies/base.js.map +1 -0
- package/dist/src/swarm/strategies/research.js +911 -0
- package/dist/src/swarm/strategies/research.js.map +1 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js +4 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js.map +1 -0
- package/dist/src/swarm/types.js +54 -0
- package/dist/src/swarm/types.js.map +1 -0
- package/dist/src/swarm/workers/copy-worker.js +58 -0
- package/dist/src/swarm/workers/copy-worker.js.map +1 -0
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js +412 -0
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js.map +1 -0
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js +560 -0
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js.map +1 -0
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js +582 -0
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js.map +1 -0
- package/dist/src/swarm-fullstack/config/fullstack-config.js +369 -0
- package/dist/src/swarm-fullstack/config/fullstack-config.js.map +1 -0
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js +687 -0
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js.map +1 -0
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js +589 -0
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js.map +1 -0
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js +538 -0
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js.map +1 -0
- package/dist/src/swarm-fullstack/types/index.js +8 -0
- package/dist/src/swarm-fullstack/types/index.js.map +1 -0
- package/dist/src/task/commands.js +130 -0
- package/dist/src/task/commands.js.map +1 -0
- package/dist/src/task/coordination.js +737 -0
- package/dist/src/task/coordination.js.map +1 -0
- package/dist/src/task/engine.js +490 -0
- package/dist/src/task/engine.js.map +1 -0
- package/dist/src/task/index.js +269 -0
- package/dist/src/task/index.js.map +1 -0
- package/dist/src/task/types.js +5 -0
- package/dist/src/task/types.js.map +1 -0
- package/dist/src/terminal/adapters/base.js +5 -0
- package/dist/src/terminal/adapters/base.js.map +1 -0
- package/dist/src/terminal/adapters/native.js +473 -0
- package/dist/src/terminal/adapters/native.js.map +1 -0
- package/dist/src/terminal/adapters/vscode.js +285 -0
- package/dist/src/terminal/adapters/vscode.js.map +1 -0
- package/dist/src/terminal/manager.js +237 -0
- package/dist/src/terminal/manager.js.map +1 -0
- package/dist/src/terminal/pool.js +209 -0
- package/dist/src/terminal/pool.js.map +1 -0
- package/dist/src/terminal/session.js +211 -0
- package/dist/src/terminal/session.js.map +1 -0
- package/dist/src/terminal/vscode-bridge.js +186 -0
- package/dist/src/terminal/vscode-bridge.js.map +1 -0
- package/dist/src/testing/performance/PerformanceTestRunner.js +401 -0
- package/dist/src/testing/performance/PerformanceTestRunner.js.map +1 -0
- package/dist/src/testing-integration/chrome-mcp-integration.js +556 -0
- package/dist/src/testing-integration/chrome-mcp-integration.js.map +1 -0
- package/dist/src/testing-integration/continuous-test-runner.js +509 -0
- package/dist/src/testing-integration/continuous-test-runner.js.map +1 -0
- package/dist/src/tests/validation-consistency.test.js +52 -0
- package/dist/src/tests/validation-consistency.test.js.map +1 -0
- package/dist/src/topology/adaptive-coordinator.js +691 -0
- package/dist/src/topology/adaptive-coordinator.js.map +1 -0
- package/dist/src/topology/communication-bridge.js +551 -0
- package/dist/src/topology/communication-bridge.js.map +1 -0
- package/dist/src/topology/enhanced-hierarchical-coordinator.js +1732 -0
- package/dist/src/topology/enhanced-hierarchical-coordinator.js.map +1 -0
- package/dist/src/topology/enhanced-mesh-coordinator.js +1271 -0
- package/dist/src/topology/enhanced-mesh-coordinator.js.map +1 -0
- package/dist/src/topology/topology-manager.js +797 -0
- package/dist/src/topology/topology-manager.js.map +1 -0
- package/dist/src/topology/types.js +8 -0
- package/dist/src/topology/types.js.map +1 -0
- package/dist/src/types/agent-lifecycle-types.js +172 -0
- package/dist/src/types/agent-lifecycle-types.js.map +1 -0
- package/dist/src/types/agent-types.js +11 -0
- package/dist/src/types/agent-types.js.map +1 -0
- package/dist/src/types/cliffy.d.js +9 -0
- package/dist/src/types/cliffy.d.js.map +1 -0
- package/dist/src/types/global.d.js +5 -0
- package/dist/src/types/global.d.js.map +1 -0
- package/dist/src/types/index.js +16 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/mcp.d.js +3 -0
- package/dist/src/types/mcp.d.js.map +1 -0
- package/dist/src/types/vscode.d.js +4 -0
- package/dist/src/types/vscode.d.js.map +1 -0
- package/dist/src/ui/hive-dashboard.js +284 -0
- package/dist/src/ui/hive-dashboard.js.map +1 -0
- package/dist/src/utils/error-handler.js +27 -0
- package/dist/src/utils/error-handler.js.map +1 -0
- package/dist/src/utils/errors.js +195 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/formatters.js +66 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/helpers.js +451 -0
- package/dist/src/utils/helpers.js.map +1 -0
- package/dist/src/utils/paths.js +43 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/type-guards.js +119 -0
- package/dist/src/utils/type-guards.js.map +1 -0
- package/dist/src/utils/types.js +38 -0
- package/dist/src/utils/types.js.map +1 -0
- package/dist/src/verification/agent-scorer.js +633 -0
- package/dist/src/verification/agent-scorer.js.map +1 -0
- package/dist/src/verification/alert-manager.js +1126 -0
- package/dist/src/verification/alert-manager.js.map +1 -0
- package/dist/src/verification/api/types/index.js +6 -0
- package/dist/src/verification/api/types/index.js.map +1 -0
- package/dist/src/verification/checkpoint-manager.js +519 -0
- package/dist/src/verification/checkpoint-manager.js.map +1 -0
- package/dist/src/verification/cli-integration.js +500 -0
- package/dist/src/verification/cli-integration.js.map +1 -0
- package/dist/src/verification/conflict-resolver.js +534 -0
- package/dist/src/verification/conflict-resolver.js.map +1 -0
- package/dist/src/verification/crdt-coordinator.js +506 -0
- package/dist/src/verification/crdt-coordinator.js.map +1 -0
- package/dist/src/verification/dashboard-exporter.js +876 -0
- package/dist/src/verification/dashboard-exporter.js.map +1 -0
- package/dist/src/verification/demo.js +320 -0
- package/dist/src/verification/demo.js.map +1 -0
- package/dist/src/verification/examples.js +508 -0
- package/dist/src/verification/examples.js.map +1 -0
- package/dist/src/verification/hooks.js +961 -0
- package/dist/src/verification/hooks.js.map +1 -0
- package/dist/src/verification/index.js +73 -0
- package/dist/src/verification/index.js.map +1 -0
- package/dist/src/verification/interfaces.js +7 -0
- package/dist/src/verification/interfaces.js.map +1 -0
- package/dist/src/verification/memory-manager.js +510 -0
- package/dist/src/verification/memory-manager.js.map +1 -0
- package/dist/src/verification/middleware.js +579 -0
- package/dist/src/verification/middleware.js.map +1 -0
- package/dist/src/verification/rollback-engine.js +511 -0
- package/dist/src/verification/rollback-engine.js.map +1 -0
- package/dist/src/verification/rollback.js +1710 -0
- package/dist/src/verification/rollback.js.map +1 -0
- package/dist/src/verification/security-bypass-test.js +704 -0
- package/dist/src/verification/security-bypass-test.js.map +1 -0
- package/dist/src/verification/security.js +1125 -0
- package/dist/src/verification/security.js.map +1 -0
- package/dist/src/verification/simple-hooks.js +189 -0
- package/dist/src/verification/simple-hooks.js.map +1 -0
- package/dist/src/verification/system-tracker.js +657 -0
- package/dist/src/verification/system-tracker.js.map +1 -0
- package/dist/src/verification/telemetry.js +922 -0
- package/dist/src/verification/telemetry.js.map +1 -0
- package/dist/src/verification/test-verification.js +43 -0
- package/dist/src/verification/test-verification.js.map +1 -0
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js +1027 -0
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js.map +1 -0
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js +638 -0
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js.map +1 -0
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js +1029 -0
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +1 -0
- package/dist/src/verification/tests/performance/verification-overhead.test.js +587 -0
- package/dist/src/verification/tests/performance/verification-overhead.test.js.map +1 -0
- package/dist/src/verification/tests/unit/truth-scoring.test.js +579 -0
- package/dist/src/verification/tests/unit/truth-scoring.test.js.map +1 -0
- package/dist/src/verification/tests.js +611 -0
- package/dist/src/verification/tests.js.map +1 -0
- package/dist/src/verification/truth-scorer.js +584 -0
- package/dist/src/verification/truth-scorer.js.map +1 -0
- package/dist/src/verification/types.js +56 -0
- package/dist/src/verification/types.js.map +1 -0
- package/dist/src/verification/verification-pipeline.js +884 -0
- package/dist/src/verification/verification-pipeline.js.map +1 -0
- package/dist/src/web/messaging/agent-status-tracker.js +447 -0
- package/dist/src/web/messaging/agent-status-tracker.js.map +1 -0
- package/dist/src/web/messaging/human-intervention-system.js +298 -0
- package/dist/src/web/messaging/human-intervention-system.js.map +1 -0
- package/dist/src/web/messaging/message-filter.js +289 -0
- package/dist/src/web/messaging/message-filter.js.map +1 -0
- package/dist/src/web/messaging/swarm-message-router.js +320 -0
- package/dist/src/web/messaging/swarm-message-router.js.map +1 -0
- package/dist/src/web/messaging/transparency-logger.js +415 -0
- package/dist/src/web/messaging/transparency-logger.js.map +1 -0
- package/dist/src/web/portal-server.js +440 -0
- package/dist/src/web/portal-server.js.map +1 -0
- package/dist/src/web/server.js +311 -0
- package/dist/src/web/server.js.map +1 -0
- package/dist/src/web/websocket/websocket-manager.js +509 -0
- package/dist/src/web/websocket/websocket-manager.js.map +1 -0
- package/dist/src/workflows/feature-lifecycle-manager.js +386 -0
- package/dist/src/workflows/feature-lifecycle-manager.js.map +1 -0
- package/dist/src/workflows/fullstack-coordination-manager.js +801 -0
- package/dist/src/workflows/fullstack-coordination-manager.js.map +1 -0
- package/dist/src/workflows/iterative-development-orchestrator.js +1128 -0
- package/dist/src/workflows/iterative-development-orchestrator.js.map +1 -0
- package/dist/src/workflows/progressive-rollout-manager.js +710 -0
- package/dist/src/workflows/progressive-rollout-manager.js.map +1 -0
- package/package.json +264 -0
- package/scripts/README.md +339 -0
- package/scripts/post-install-claude-md.js +50 -0
- package/src/commands/dependency-recommendations.js +551 -0
- package/src/commands/suggest-improvements.js +492 -0
- package/src/commands/suggest-templates.js +916 -0
- package/src/npx/claude-md-protection.js +169 -0
- package/wiki/INDEX.md +264 -0
- package/wiki/NAVIGATION.md +270 -0
- package/wiki/README.md +101 -0
- package/wiki/accessibility/README.md +103 -0
- package/wiki/accessibility/assistive-tech/screen-reader-support.md +912 -0
- package/wiki/accessibility/automation/agent-testing-automation.md +880 -0
- package/wiki/accessibility/guidelines/wcag-compliance.md +278 -0
- package/wiki/accessibility/i18n/internationalization-strategies.md +1022 -0
- package/wiki/accessibility/motor-accessibility/keyboard-navigation.md +1182 -0
- package/wiki/accessibility/patterns/inclusive-design-patterns.md +715 -0
- package/wiki/accessibility/testing/automated-testing.md +665 -0
- package/wiki/accessibility/visual-design/color-contrast.md +926 -0
- package/wiki/accessibility/workflows/accessibility-first-development.md +916 -0
- package/wiki/accessibility/workflows/inclusive-design-review.md +835 -0
- package/wiki/api-reference/README.md +565 -0
- package/wiki/api-reference/agent-management-api.md +931 -0
- package/wiki/api-reference/cli-api.md +630 -0
- package/wiki/api-reference/configuration-api.md +1355 -0
- package/wiki/api-reference/examples-code-samples.md +2241 -0
- package/wiki/api-reference/hooks-coordination-api.md +1406 -0
- package/wiki/api-reference/mcp-tool-specifications.md +944 -0
- package/wiki/api-reference/plugin-development.md +1695 -0
- package/wiki/api-reference/technical-architecture.md +1729 -0
- package/wiki/command-reference/README.md +305 -0
- package/wiki/command-reference/agent-commands.md +571 -0
- package/wiki/command-reference/cli-commands.md +516 -0
- package/wiki/command-reference/command-syntax.md +676 -0
- package/wiki/command-reference/expert/README.md +616 -0
- package/wiki/command-reference/expert-tier.md +791 -0
- package/wiki/command-reference/intermediate/README.md +628 -0
- package/wiki/command-reference/intermediate-tier.md +1024 -0
- package/wiki/command-reference/mcp-integration.md +412 -0
- package/wiki/command-reference/mcp-tools/README.md +1743 -0
- package/wiki/command-reference/mcp-tools/dual-access-workflows.md +911 -0
- package/wiki/command-reference/mcp-tools/index.md +201 -0
- package/wiki/command-reference/mcp-tools/integration-patterns.md +830 -0
- package/wiki/command-reference/mcp-tools/quick-reference.md +383 -0
- package/wiki/command-reference/mcp-tools/session-management.md +1183 -0
- package/wiki/command-reference/mcp-tools/task-tool-integration.md +827 -0
- package/wiki/command-reference/novice/README.md +661 -0
- package/wiki/command-reference/novice-tier.md +1142 -0
- package/wiki/command-reference/progression-guide.md +772 -0
- package/wiki/command-reference/troubleshooting.md +803 -0
- package/wiki/command-reference/workflows.md +752 -0
- package/wiki/community/README.md +328 -0
- package/wiki/community/contributing/README.md +623 -0
- package/wiki/community/contributing/code-of-conduct.md +388 -0
- package/wiki/community/contributing/collaboration-workflows.md +1 -0
- package/wiki/community/contributing/issue-reporting.md +1 -0
- package/wiki/community/contributing/onboarding-guide.md +1 -0
- package/wiki/community/contributing/recognition-system.md +1 -0
- package/wiki/community/discussions/README.md +54 -0
- package/wiki/community/learning-resources.md +476 -0
- package/wiki/community/showcase/README.md +1 -0
- package/wiki/core-concepts/README.md +656 -0
- package/wiki/core-concepts/agent-feedback-hooks/README.md +298 -0
- package/wiki/core-concepts/agents/README.md +392 -0
- package/wiki/core-concepts/agents/agent-creation-guide.md +431 -0
- package/wiki/core-concepts/agents.md +301 -0
- package/wiki/core-concepts/architecture.md +227 -0
- package/wiki/core-concepts/hooks-lifecycle/README.md +543 -0
- package/wiki/core-concepts/integration.md +507 -0
- package/wiki/core-concepts/memory-system/README.md +521 -0
- package/wiki/core-concepts/performance.md +463 -0
- package/wiki/core-concepts/sparc-methodology/README.md +465 -0
- package/wiki/core-concepts/sparc-workflow.md +407 -0
- package/wiki/core-concepts/swarm-coordination/README.md +525 -0
- package/wiki/core-concepts/swarm-coordination.md +453 -0
- package/wiki/cost-optimization/enterprise-cost-management.md +1356 -0
- package/wiki/deployment/enterprise-deployment-patterns.md +1739 -0
- package/wiki/enterprise-architecture/enterprise-architecture-overview.md +348 -0
- package/wiki/enterprise-architecture/enterprise-scaling-patterns.md +1184 -0
- package/wiki/examples/README.md +288 -0
- package/wiki/examples/automation/cicd-pipeline/README.md +1265 -0
- package/wiki/examples/basic/hello-world/README.md +434 -0
- package/wiki/examples/basic-projects/README.md +427 -0
- package/wiki/examples/enterprise-integration/README.md +602 -0
- package/wiki/examples/integration-patterns.md +825 -0
- package/wiki/examples/legacy-migration/README.md +656 -0
- package/wiki/examples/multi-cloud/README.md +1071 -0
- package/wiki/examples/performance-benchmarks.md +729 -0
- package/wiki/examples/performance-optimization/README.md +1214 -0
- package/wiki/examples/projects/rest-api/README.md +845 -0
- package/wiki/examples/real-time-collaboration/README.md +1092 -0
- package/wiki/examples/scenarios/ecommerce/README.md +1273 -0
- package/wiki/examples/swarm-patterns.md +1026 -0
- package/wiki/examples/templates/download-system.md +993 -0
- package/wiki/examples/templates/javascript/README.md +487 -0
- package/wiki/examples/templates/javascript/package.json +119 -0
- package/wiki/examples/troubleshooting/README.md +1317 -0
- package/wiki/examples/utilities/patterns/README.md +1347 -0
- package/wiki/examples/videos/01-setup.md +403 -0
- package/wiki/examples/workflow-automation/README.md +1023 -0
- package/wiki/getting-started/README.md +398 -0
- package/wiki/getting-started/benefits.md +451 -0
- package/wiki/getting-started/claude-code-mcp/README.md +319 -0
- package/wiki/getting-started/claude-code-mcp/setup.md +431 -0
- package/wiki/getting-started/claude-code-mcp/usage-examples.md +501 -0
- package/wiki/getting-started/cli-access/README.md +300 -0
- package/wiki/getting-started/cli-access/first-commands.md +319 -0
- package/wiki/getting-started/installation/README.md +469 -0
- package/wiki/getting-started/installation/troubleshooting.md +617 -0
- package/wiki/getting-started/learning-path.md +494 -0
- package/wiki/getting-started/learning-plan-generator.md +434 -0
- package/wiki/getting-started/quick-start/README.md +255 -0
- package/wiki/getting-started/quick-start/cli-tutorial.md +680 -0
- package/wiki/getting-started/quick-start/mcp-tutorial.md +544 -0
- package/wiki/governance/multi-project-coordination.md +820 -0
- package/wiki/languages/README.md +349 -0
- package/wiki/languages/go/README.md +124 -0
- package/wiki/languages/go/examples/README.md +1066 -0
- package/wiki/languages/go/frameworks/README.md +708 -0
- package/wiki/languages/go/integration/README.md +748 -0
- package/wiki/languages/go/microservices/README.md +1185 -0
- package/wiki/languages/go/performance/README.md +1310 -0
- package/wiki/languages/go/setup/README.md +397 -0
- package/wiki/languages/go/systems/README.md +1116 -0
- package/wiki/languages/go/testing/README.md +999 -0
- package/wiki/languages/java/README.md +217 -0
- package/wiki/languages/java/claude-flow-integration.md +1220 -0
- package/wiki/languages/java/enterprise-java.md +1247 -0
- package/wiki/languages/java/examples.md +1712 -0
- package/wiki/languages/java/microservices.md +1600 -0
- package/wiki/languages/java/performance.md +1122 -0
- package/wiki/languages/java/project-setup.md +504 -0
- package/wiki/languages/java/spring-boot.md +756 -0
- package/wiki/languages/java/testing.md +1323 -0
- package/wiki/languages/javascript/README.md +575 -0
- package/wiki/languages/javascript/api/README.md +1445 -0
- package/wiki/languages/javascript/backend/README.md +748 -0
- package/wiki/languages/javascript/frontend/README.md +1048 -0
- package/wiki/languages/javascript/integration.md +1107 -0
- package/wiki/languages/javascript/setup/README.md +438 -0
- package/wiki/languages/javascript/testing/README.md +1775 -0
- package/wiki/languages/python/README.md +1002 -0
- package/wiki/languages/python/data-science/README.md +1317 -0
- package/wiki/languages/python/examples/README.md +911 -0
- package/wiki/languages/python/integration.md +1515 -0
- package/wiki/languages/python/mcp-integration.md +843 -0
- package/wiki/languages/python/setup/README.md +622 -0
- package/wiki/languages/python/testing/README.md +1680 -0
- package/wiki/languages/python/web-development/README.md +974 -0
- package/wiki/languages/rust/README.md +936 -0
- package/wiki/languages/rust/examples/cli-mcp-workflows.md +850 -0
- package/wiki/languages/rust/examples/rest-api.md +1927 -0
- package/wiki/languages/rust/setup/cargo-integration.md +780 -0
- package/wiki/languages/rust/testing/quality-validation.md +1098 -0
- package/wiki/languages/rust/web-development/axum.md +1497 -0
- package/wiki/languages/rust/workflows/systems-programming.md +1189 -0
- package/wiki/languages/typescript/README.md +581 -0
- package/wiki/languages/typescript/automation.md +1070 -0
- package/wiki/languages/typescript/coordination.md +971 -0
- package/wiki/languages/typescript/enterprise.md +1368 -0
- package/wiki/languages/typescript/frameworks.md +970 -0
- package/wiki/languages/typescript/migration.md +1384 -0
- package/wiki/languages/typescript/patterns.md +694 -0
- package/wiki/languages/typescript/performance.md +1195 -0
- package/wiki/languages/typescript/setup.md +516 -0
- package/wiki/languages/typescript/workflows.md +481 -0
- package/wiki/monitoring/enterprise-observability.md +1141 -0
- package/wiki/security/enterprise-security-framework.md +1174 -0
- package/wiki/team-coordination/team-scaling-strategies.md +1486 -0
- package/wiki/troubleshooting/README.md +654 -0
- package/wiki/troubleshooting/common-issues/README.md +659 -0
- package/wiki/troubleshooting/common-issues.md +458 -0
- package/wiki/troubleshooting/error-resolution.md +763 -0
- package/wiki/troubleshooting/performance-optimization.md +540 -0
- package/wiki/tutorials/README.md +607 -0
- package/wiki/tutorials/advanced/01-multi-agent-orchestration-patterns.md +585 -0
- package/wiki/tutorials/advanced/02-enterprise-architecture-development.md +661 -0
- package/wiki/tutorials/advanced/03-advanced-sparc-methodology.md +595 -0
- package/wiki/tutorials/advanced/04-performance-optimization-workflows.md +613 -0
- package/wiki/tutorials/advanced/05-custom-agent-development.md +681 -0
- package/wiki/tutorials/advanced/06-legacy-system-integration.md +574 -0
- package/wiki/tutorials/advanced/07-production-deployment-monitoring.md +684 -0
- package/wiki/tutorials/advanced/08-enterprise-scenarios.md +700 -0
- package/wiki/tutorials/advanced/README.md +577 -0
- package/wiki/tutorials/advanced/performance-optimization.md +476 -0
- package/wiki/tutorials/advanced/swarm-orchestration.md +627 -0
- package/wiki/tutorials/beginner/01-first-project.md +532 -0
- package/wiki/tutorials/beginner/02-basic-workflows.md +523 -0
- package/wiki/tutorials/beginner/03-simple-automation.md +641 -0
- package/wiki/tutorials/beginner/04-quality-testing.md +984 -0
- package/wiki/tutorials/beginner/README.md +388 -0
- package/wiki/tutorials/exercises/ecommerce-platform.md +1370 -0
- package/wiki/tutorials/intermediate/01-multi-agent-teams.md +961 -0
- package/wiki/tutorials/intermediate/README.md +452 -0
- package/wiki/tutorials/intermediate/optimization.md +402 -0
- package/wiki/tutorials/skill-assessment.md +522 -0
- package/wiki/tutorials/skill-competency-matrix.md +548 -0
- package/wiki/tutorials/troubleshooting/command-cheatsheet.md +425 -0
- package/wiki/tutorials/troubleshooting/setup-issues.md +717 -0
- package/wiki/video-tutorials/README.md +202 -0
- package/wiki/video-tutorials/accessibility/README.md +1349 -0
- package/wiki/video-tutorials/community/README.md +1366 -0
- package/wiki/video-tutorials/content-organization/README.md +1295 -0
- package/wiki/video-tutorials/distribution/README.md +1093 -0
- package/wiki/video-tutorials/editing/README.md +751 -0
- package/wiki/video-tutorials/interactive/README.md +1151 -0
- package/wiki/video-tutorials/multi-language/README.md +1384 -0
- package/wiki/video-tutorials/planning/README.md +461 -0
- package/wiki/video-tutorials/recording/README.md +619 -0
- package/wiki/video-tutorials/technical-specs/README.md +1018 -0
|
@@ -0,0 +1,1927 @@
|
|
|
1
|
+
# Complete REST API Example with Claude-Flow
|
|
2
|
+
|
|
3
|
+
This comprehensive example demonstrates building a production-ready REST API using Rust, Axum, and claude-flow orchestration, showcasing real toolchain integration and agent coordination.
|
|
4
|
+
|
|
5
|
+
## 🎯 Project Overview
|
|
6
|
+
|
|
7
|
+
We'll build a **Task Management API** with the following features:
|
|
8
|
+
- User authentication and authorization
|
|
9
|
+
- CRUD operations for tasks and projects
|
|
10
|
+
- Real-time notifications via WebSockets
|
|
11
|
+
- Rate limiting and caching
|
|
12
|
+
- Comprehensive testing and monitoring
|
|
13
|
+
- Production deployment configuration
|
|
14
|
+
|
|
15
|
+
## 🚀 Project Initialization
|
|
16
|
+
|
|
17
|
+
### 1. Create Project with Claude-Flow
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Initialize the project with multiple specialized agents
|
|
21
|
+
npx claude-flow sparc run architect "Create a production-ready REST API for task management with user auth, real-time updates, and PostgreSQL"
|
|
22
|
+
|
|
23
|
+
# This spawns coordinated agents:
|
|
24
|
+
Task("API Architect", "Design RESTful API architecture with proper resource modeling", "api-architect")
|
|
25
|
+
Task("Database Engineer", "Design PostgreSQL schema with proper relationships and indexing", "database-engineer")
|
|
26
|
+
Task("Auth Specialist", "Implement JWT authentication with role-based access control", "auth-engineer")
|
|
27
|
+
Task("Performance Engineer", "Add caching, rate limiting, and performance optimization", "performance-optimizer")
|
|
28
|
+
Task("Testing Engineer", "Create comprehensive test suite with integration tests", "test-engineer")
|
|
29
|
+
Task("DevOps Engineer", "Set up Docker, CI/CD, and monitoring", "devops-engineer")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Generated Project Structure
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
task-management-api/
|
|
36
|
+
├── Cargo.toml
|
|
37
|
+
├── Cargo.lock
|
|
38
|
+
├── src/
|
|
39
|
+
│ ├── main.rs
|
|
40
|
+
│ ├── lib.rs
|
|
41
|
+
│ ├── config/
|
|
42
|
+
│ │ ├── mod.rs
|
|
43
|
+
│ │ ├── database.rs
|
|
44
|
+
│ │ ├── cache.rs
|
|
45
|
+
│ │ └── settings.rs
|
|
46
|
+
│ ├── handlers/
|
|
47
|
+
│ │ ├── mod.rs
|
|
48
|
+
│ │ ├── auth.rs
|
|
49
|
+
│ │ ├── users.rs
|
|
50
|
+
│ │ ├── projects.rs
|
|
51
|
+
│ │ ├── tasks.rs
|
|
52
|
+
│ │ └── websocket.rs
|
|
53
|
+
│ ├── models/
|
|
54
|
+
│ │ ├── mod.rs
|
|
55
|
+
│ │ ├── user.rs
|
|
56
|
+
│ │ ├── project.rs
|
|
57
|
+
│ │ ├── task.rs
|
|
58
|
+
│ │ └── auth.rs
|
|
59
|
+
│ ├── services/
|
|
60
|
+
│ │ ├── mod.rs
|
|
61
|
+
│ │ ├── auth_service.rs
|
|
62
|
+
│ │ ├── user_service.rs
|
|
63
|
+
│ │ ├── project_service.rs
|
|
64
|
+
│ │ ├── task_service.rs
|
|
65
|
+
│ │ └── notification_service.rs
|
|
66
|
+
│ ├── middleware/
|
|
67
|
+
│ │ ├── mod.rs
|
|
68
|
+
│ │ ├── auth.rs
|
|
69
|
+
│ │ ├── rate_limit.rs
|
|
70
|
+
│ │ ├── cors.rs
|
|
71
|
+
│ │ └── logging.rs
|
|
72
|
+
│ ├── utils/
|
|
73
|
+
│ │ ├── mod.rs
|
|
74
|
+
│ │ ├── cache.rs
|
|
75
|
+
│ │ ├── validation.rs
|
|
76
|
+
│ │ └── pagination.rs
|
|
77
|
+
│ └── error.rs
|
|
78
|
+
├── migrations/
|
|
79
|
+
│ ├── 001_initial_schema.sql
|
|
80
|
+
│ ├── 002_add_projects.sql
|
|
81
|
+
│ ├── 003_add_tasks.sql
|
|
82
|
+
│ └── 004_add_notifications.sql
|
|
83
|
+
├── tests/
|
|
84
|
+
│ ├── integration/
|
|
85
|
+
│ │ ├── auth_tests.rs
|
|
86
|
+
│ │ ├── project_tests.rs
|
|
87
|
+
│ │ ├── task_tests.rs
|
|
88
|
+
│ │ └── websocket_tests.rs
|
|
89
|
+
│ └── common/
|
|
90
|
+
│ └── mod.rs
|
|
91
|
+
├── benches/
|
|
92
|
+
│ └── api_benchmarks.rs
|
|
93
|
+
├── docs/
|
|
94
|
+
│ ├── api-spec.yml
|
|
95
|
+
│ └── README.md
|
|
96
|
+
├── docker/
|
|
97
|
+
│ ├── Dockerfile
|
|
98
|
+
│ ├── docker-compose.yml
|
|
99
|
+
│ └── nginx.conf
|
|
100
|
+
├── .github/
|
|
101
|
+
│ └── workflows/
|
|
102
|
+
│ ├── ci.yml
|
|
103
|
+
│ └── deploy.yml
|
|
104
|
+
└── scripts/
|
|
105
|
+
├── setup-dev.sh
|
|
106
|
+
├── run-tests.sh
|
|
107
|
+
└── deploy.sh
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 📦 Dependencies Configuration
|
|
111
|
+
|
|
112
|
+
### Generated Cargo.toml
|
|
113
|
+
|
|
114
|
+
```toml
|
|
115
|
+
[package]
|
|
116
|
+
name = "task-management-api"
|
|
117
|
+
version = "0.1.0"
|
|
118
|
+
edition = "2021"
|
|
119
|
+
rust-version = "1.70"
|
|
120
|
+
authors = ["Development Team <team@example.com>"]
|
|
121
|
+
description = "Production-ready task management REST API built with Rust and Axum"
|
|
122
|
+
license = "MIT"
|
|
123
|
+
repository = "https://github.com/company/task-management-api"
|
|
124
|
+
|
|
125
|
+
[dependencies]
|
|
126
|
+
# Web framework
|
|
127
|
+
axum = { version = "0.7", features = ["macros", "multipart", "ws"] }
|
|
128
|
+
tokio = { version = "1.0", features = ["full"] }
|
|
129
|
+
tower = { version = "0.4", features = ["util", "timeout", "load-shed", "limit"] }
|
|
130
|
+
tower-http = { version = "0.5", features = ["fs", "trace", "cors", "compression-gzip", "request-id"] }
|
|
131
|
+
|
|
132
|
+
# Database
|
|
133
|
+
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "chrono", "uuid", "migrate", "json"] }
|
|
134
|
+
|
|
135
|
+
# Serialization
|
|
136
|
+
serde = { version = "1.0", features = ["derive"] }
|
|
137
|
+
serde_json = "1.0"
|
|
138
|
+
|
|
139
|
+
# Authentication & Security
|
|
140
|
+
jsonwebtoken = "9.0"
|
|
141
|
+
argon2 = "0.5"
|
|
142
|
+
uuid = { version = "1.0", features = ["v4", "serde"] }
|
|
143
|
+
|
|
144
|
+
# Caching
|
|
145
|
+
redis = { version = "0.24", features = ["tokio-comp", "connection-manager"] }
|
|
146
|
+
|
|
147
|
+
# Rate limiting
|
|
148
|
+
governor = "0.6"
|
|
149
|
+
|
|
150
|
+
# Configuration
|
|
151
|
+
config = "0.14"
|
|
152
|
+
dotenvy = "0.15"
|
|
153
|
+
|
|
154
|
+
# Logging & Monitoring
|
|
155
|
+
tracing = "0.1"
|
|
156
|
+
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
|
|
157
|
+
metrics = "0.22"
|
|
158
|
+
metrics-exporter-prometheus = "0.13"
|
|
159
|
+
|
|
160
|
+
# Error handling
|
|
161
|
+
anyhow = "1.0"
|
|
162
|
+
thiserror = "1.0"
|
|
163
|
+
|
|
164
|
+
# Validation
|
|
165
|
+
validator = { version = "0.18", features = ["derive"] }
|
|
166
|
+
|
|
167
|
+
# Time handling
|
|
168
|
+
chrono = { version = "0.4", features = ["serde"] }
|
|
169
|
+
|
|
170
|
+
# HTTP client for external services
|
|
171
|
+
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
|
|
172
|
+
|
|
173
|
+
# Utilities
|
|
174
|
+
futures = "0.3"
|
|
175
|
+
async-trait = "0.1"
|
|
176
|
+
|
|
177
|
+
[dev-dependencies]
|
|
178
|
+
axum-test = "14.0"
|
|
179
|
+
tokio-test = "0.4"
|
|
180
|
+
wiremock = "0.5"
|
|
181
|
+
tempfile = "3.0"
|
|
182
|
+
criterion = { version = "0.5", features = ["html_reports"] }
|
|
183
|
+
|
|
184
|
+
[[bench]]
|
|
185
|
+
name = "api_benchmarks"
|
|
186
|
+
harness = false
|
|
187
|
+
|
|
188
|
+
[profile.release]
|
|
189
|
+
opt-level = 3
|
|
190
|
+
lto = "thin"
|
|
191
|
+
codegen-units = 1
|
|
192
|
+
panic = "abort"
|
|
193
|
+
strip = true
|
|
194
|
+
|
|
195
|
+
[profile.dev]
|
|
196
|
+
opt-level = 0
|
|
197
|
+
debug = true
|
|
198
|
+
|
|
199
|
+
[profile.test]
|
|
200
|
+
opt-level = 1
|
|
201
|
+
debug = true
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## 🗄️ Database Schema Design
|
|
205
|
+
|
|
206
|
+
### Generated Migration Files
|
|
207
|
+
|
|
208
|
+
**migrations/001_initial_schema.sql:**
|
|
209
|
+
```sql
|
|
210
|
+
-- Initial database schema for task management API
|
|
211
|
+
-- Generated by Database Engineer agent
|
|
212
|
+
|
|
213
|
+
-- Enable UUID extension
|
|
214
|
+
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
|
215
|
+
|
|
216
|
+
-- Users table
|
|
217
|
+
CREATE TABLE users (
|
|
218
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
219
|
+
email VARCHAR(255) UNIQUE NOT NULL,
|
|
220
|
+
username VARCHAR(100) UNIQUE NOT NULL,
|
|
221
|
+
password_hash TEXT NOT NULL,
|
|
222
|
+
first_name VARCHAR(100),
|
|
223
|
+
last_name VARCHAR(100),
|
|
224
|
+
avatar_url TEXT,
|
|
225
|
+
is_active BOOLEAN NOT NULL DEFAULT true,
|
|
226
|
+
email_verified BOOLEAN NOT NULL DEFAULT false,
|
|
227
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
228
|
+
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
-- User sessions for JWT token management
|
|
232
|
+
CREATE TABLE user_sessions (
|
|
233
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
234
|
+
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
235
|
+
token_hash TEXT NOT NULL UNIQUE,
|
|
236
|
+
expires_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
|
237
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
238
|
+
user_agent TEXT,
|
|
239
|
+
ip_address INET
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
-- Roles and permissions
|
|
243
|
+
CREATE TABLE roles (
|
|
244
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
245
|
+
name VARCHAR(50) UNIQUE NOT NULL,
|
|
246
|
+
description TEXT,
|
|
247
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
CREATE TABLE permissions (
|
|
251
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
252
|
+
name VARCHAR(100) UNIQUE NOT NULL,
|
|
253
|
+
description TEXT,
|
|
254
|
+
resource VARCHAR(100) NOT NULL,
|
|
255
|
+
action VARCHAR(50) NOT NULL,
|
|
256
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
CREATE TABLE role_permissions (
|
|
260
|
+
role_id UUID NOT NULL REFERENCES roles(id) ON DELETE CASCADE,
|
|
261
|
+
permission_id UUID NOT NULL REFERENCES permissions(id) ON DELETE CASCADE,
|
|
262
|
+
PRIMARY KEY (role_id, permission_id)
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
CREATE TABLE user_roles (
|
|
266
|
+
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
267
|
+
role_id UUID NOT NULL REFERENCES roles(id) ON DELETE CASCADE,
|
|
268
|
+
granted_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
269
|
+
granted_by UUID REFERENCES users(id),
|
|
270
|
+
PRIMARY KEY (user_id, role_id)
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
-- Projects table
|
|
274
|
+
CREATE TABLE projects (
|
|
275
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
276
|
+
name VARCHAR(255) NOT NULL,
|
|
277
|
+
description TEXT,
|
|
278
|
+
owner_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
279
|
+
status VARCHAR(50) NOT NULL DEFAULT 'active',
|
|
280
|
+
priority VARCHAR(20) NOT NULL DEFAULT 'medium',
|
|
281
|
+
start_date DATE,
|
|
282
|
+
due_date DATE,
|
|
283
|
+
completed_at TIMESTAMP WITH TIME ZONE,
|
|
284
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
285
|
+
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
-- Project members
|
|
289
|
+
CREATE TABLE project_members (
|
|
290
|
+
project_id UUID NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
291
|
+
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
292
|
+
role VARCHAR(50) NOT NULL DEFAULT 'member',
|
|
293
|
+
joined_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
294
|
+
PRIMARY KEY (project_id, user_id)
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
-- Tasks table
|
|
298
|
+
CREATE TABLE tasks (
|
|
299
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
300
|
+
title VARCHAR(255) NOT NULL,
|
|
301
|
+
description TEXT,
|
|
302
|
+
project_id UUID NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
|
303
|
+
assignee_id UUID REFERENCES users(id) ON DELETE SET NULL,
|
|
304
|
+
created_by UUID NOT NULL REFERENCES users(id),
|
|
305
|
+
status VARCHAR(50) NOT NULL DEFAULT 'todo',
|
|
306
|
+
priority VARCHAR(20) NOT NULL DEFAULT 'medium',
|
|
307
|
+
due_date TIMESTAMP WITH TIME ZONE,
|
|
308
|
+
completed_at TIMESTAMP WITH TIME ZONE,
|
|
309
|
+
estimated_hours INTEGER,
|
|
310
|
+
actual_hours INTEGER,
|
|
311
|
+
tags TEXT[],
|
|
312
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
313
|
+
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
-- Task comments
|
|
317
|
+
CREATE TABLE task_comments (
|
|
318
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
319
|
+
task_id UUID NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
|
320
|
+
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
321
|
+
content TEXT NOT NULL,
|
|
322
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
|
|
323
|
+
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
-- Task attachments
|
|
327
|
+
CREATE TABLE task_attachments (
|
|
328
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
329
|
+
task_id UUID NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
|
330
|
+
filename VARCHAR(255) NOT NULL,
|
|
331
|
+
file_path TEXT NOT NULL,
|
|
332
|
+
file_size BIGINT NOT NULL,
|
|
333
|
+
mime_type VARCHAR(100),
|
|
334
|
+
uploaded_by UUID NOT NULL REFERENCES users(id),
|
|
335
|
+
uploaded_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
-- Notifications
|
|
339
|
+
CREATE TABLE notifications (
|
|
340
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
341
|
+
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
342
|
+
title VARCHAR(255) NOT NULL,
|
|
343
|
+
message TEXT NOT NULL,
|
|
344
|
+
type VARCHAR(50) NOT NULL,
|
|
345
|
+
entity_type VARCHAR(50),
|
|
346
|
+
entity_id UUID,
|
|
347
|
+
is_read BOOLEAN NOT NULL DEFAULT false,
|
|
348
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
-- Activity log
|
|
352
|
+
CREATE TABLE activity_log (
|
|
353
|
+
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
|
354
|
+
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
355
|
+
action VARCHAR(100) NOT NULL,
|
|
356
|
+
entity_type VARCHAR(50) NOT NULL,
|
|
357
|
+
entity_id UUID NOT NULL,
|
|
358
|
+
details JSONB,
|
|
359
|
+
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
-- Indexes for performance
|
|
363
|
+
CREATE INDEX idx_users_email ON users(email);
|
|
364
|
+
CREATE INDEX idx_users_username ON users(username);
|
|
365
|
+
CREATE INDEX idx_users_created_at ON users(created_at);
|
|
366
|
+
|
|
367
|
+
CREATE INDEX idx_user_sessions_user_id ON user_sessions(user_id);
|
|
368
|
+
CREATE INDEX idx_user_sessions_expires_at ON user_sessions(expires_at);
|
|
369
|
+
CREATE INDEX idx_user_sessions_token_hash ON user_sessions(token_hash);
|
|
370
|
+
|
|
371
|
+
CREATE INDEX idx_projects_owner_id ON projects(owner_id);
|
|
372
|
+
CREATE INDEX idx_projects_status ON projects(status);
|
|
373
|
+
CREATE INDEX idx_projects_created_at ON projects(created_at);
|
|
374
|
+
|
|
375
|
+
CREATE INDEX idx_project_members_user_id ON project_members(user_id);
|
|
376
|
+
|
|
377
|
+
CREATE INDEX idx_tasks_project_id ON tasks(project_id);
|
|
378
|
+
CREATE INDEX idx_tasks_assignee_id ON tasks(assignee_id);
|
|
379
|
+
CREATE INDEX idx_tasks_created_by ON tasks(created_by);
|
|
380
|
+
CREATE INDEX idx_tasks_status ON tasks(status);
|
|
381
|
+
CREATE INDEX idx_tasks_due_date ON tasks(due_date);
|
|
382
|
+
CREATE INDEX idx_tasks_created_at ON tasks(created_at);
|
|
383
|
+
|
|
384
|
+
CREATE INDEX idx_task_comments_task_id ON task_comments(task_id);
|
|
385
|
+
CREATE INDEX idx_task_comments_user_id ON task_comments(user_id);
|
|
386
|
+
|
|
387
|
+
CREATE INDEX idx_task_attachments_task_id ON task_attachments(task_id);
|
|
388
|
+
|
|
389
|
+
CREATE INDEX idx_notifications_user_id ON notifications(user_id);
|
|
390
|
+
CREATE INDEX idx_notifications_is_read ON notifications(is_read);
|
|
391
|
+
CREATE INDEX idx_notifications_created_at ON notifications(created_at);
|
|
392
|
+
|
|
393
|
+
CREATE INDEX idx_activity_log_user_id ON activity_log(user_id);
|
|
394
|
+
CREATE INDEX idx_activity_log_entity ON activity_log(entity_type, entity_id);
|
|
395
|
+
CREATE INDEX idx_activity_log_created_at ON activity_log(created_at);
|
|
396
|
+
|
|
397
|
+
-- Insert default roles
|
|
398
|
+
INSERT INTO roles (name, description) VALUES
|
|
399
|
+
('admin', 'System administrator with full access'),
|
|
400
|
+
('manager', 'Project manager with enhanced permissions'),
|
|
401
|
+
('developer', 'Developer with standard permissions'),
|
|
402
|
+
('viewer', 'Read-only access to assigned projects');
|
|
403
|
+
|
|
404
|
+
-- Insert basic permissions
|
|
405
|
+
INSERT INTO permissions (name, description, resource, action) VALUES
|
|
406
|
+
('users.read', 'Read user information', 'users', 'read'),
|
|
407
|
+
('users.write', 'Create and update users', 'users', 'write'),
|
|
408
|
+
('users.delete', 'Delete users', 'users', 'delete'),
|
|
409
|
+
('projects.read', 'Read project information', 'projects', 'read'),
|
|
410
|
+
('projects.write', 'Create and update projects', 'projects', 'write'),
|
|
411
|
+
('projects.delete', 'Delete projects', 'projects', 'delete'),
|
|
412
|
+
('tasks.read', 'Read task information', 'tasks', 'read'),
|
|
413
|
+
('tasks.write', 'Create and update tasks', 'tasks', 'write'),
|
|
414
|
+
('tasks.delete', 'Delete tasks', 'tasks', 'delete'),
|
|
415
|
+
('admin.access', 'Access admin features', 'admin', 'access');
|
|
416
|
+
|
|
417
|
+
-- Grant permissions to roles
|
|
418
|
+
-- Admin gets all permissions
|
|
419
|
+
INSERT INTO role_permissions (role_id, permission_id)
|
|
420
|
+
SELECT r.id, p.id FROM roles r, permissions p WHERE r.name = 'admin';
|
|
421
|
+
|
|
422
|
+
-- Manager gets project and task permissions
|
|
423
|
+
INSERT INTO role_permissions (role_id, permission_id)
|
|
424
|
+
SELECT r.id, p.id FROM roles r, permissions p
|
|
425
|
+
WHERE r.name = 'manager' AND p.resource IN ('projects', 'tasks');
|
|
426
|
+
|
|
427
|
+
-- Developer gets read/write for tasks, read for projects
|
|
428
|
+
INSERT INTO role_permissions (role_id, permission_id)
|
|
429
|
+
SELECT r.id, p.id FROM roles r, permissions p
|
|
430
|
+
WHERE r.name = 'developer' AND (
|
|
431
|
+
(p.resource = 'tasks' AND p.action IN ('read', 'write')) OR
|
|
432
|
+
(p.resource = 'projects' AND p.action = 'read')
|
|
433
|
+
);
|
|
434
|
+
|
|
435
|
+
-- Viewer gets read-only access
|
|
436
|
+
INSERT INTO role_permissions (role_id, permission_id)
|
|
437
|
+
SELECT r.id, p.id FROM roles r, permissions p
|
|
438
|
+
WHERE r.name = 'viewer' AND p.action = 'read';
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
## 🏗️ Core Application Architecture
|
|
442
|
+
|
|
443
|
+
### 1. Main Application Setup
|
|
444
|
+
|
|
445
|
+
```rust
|
|
446
|
+
// src/main.rs - Generated by API Architect agent
|
|
447
|
+
use axum::{
|
|
448
|
+
extract::State,
|
|
449
|
+
http::{HeaderMap, StatusCode},
|
|
450
|
+
middleware,
|
|
451
|
+
response::Json,
|
|
452
|
+
routing::{get, post},
|
|
453
|
+
Router,
|
|
454
|
+
};
|
|
455
|
+
use sqlx::PgPool;
|
|
456
|
+
use std::sync::Arc;
|
|
457
|
+
use task_management_api::{
|
|
458
|
+
config::AppConfig,
|
|
459
|
+
handlers,
|
|
460
|
+
middleware::{auth_middleware, cors_middleware, logging_middleware, rate_limit_middleware},
|
|
461
|
+
services::NotificationService,
|
|
462
|
+
utils::cache::CacheManager,
|
|
463
|
+
};
|
|
464
|
+
use tower::ServiceBuilder;
|
|
465
|
+
use tower_http::{
|
|
466
|
+
compression::CompressionLayer,
|
|
467
|
+
request_id::{MakeRequestId, RequestId},
|
|
468
|
+
timeout::TimeoutLayer,
|
|
469
|
+
trace::TraceLayer,
|
|
470
|
+
};
|
|
471
|
+
use tracing::{info, warn};
|
|
472
|
+
use uuid::Uuid;
|
|
473
|
+
|
|
474
|
+
// Application state
|
|
475
|
+
#[derive(Clone)]
|
|
476
|
+
pub struct AppState {
|
|
477
|
+
pub db: PgPool,
|
|
478
|
+
pub cache: Arc<CacheManager>,
|
|
479
|
+
pub config: Arc<AppConfig>,
|
|
480
|
+
pub notification_service: Arc<NotificationService>,
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// Request ID generation
|
|
484
|
+
#[derive(Clone)]
|
|
485
|
+
struct MakeRequestUuid;
|
|
486
|
+
|
|
487
|
+
impl MakeRequestId for MakeRequestUuid {
|
|
488
|
+
type RequestId = String;
|
|
489
|
+
|
|
490
|
+
fn make_request_id<B>(&mut self, _: &axum::http::Request<B>) -> Self::RequestId {
|
|
491
|
+
Uuid::new_v4().to_string()
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
#[tokio::main]
|
|
496
|
+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
497
|
+
// Initialize tracing
|
|
498
|
+
tracing_subscriber::registry()
|
|
499
|
+
.with(tracing_subscriber::EnvFilter::new(
|
|
500
|
+
std::env::var("RUST_LOG").unwrap_or_else(|_| {
|
|
501
|
+
"task_management_api=debug,axum=debug,tower_http=debug,sqlx=info".into()
|
|
502
|
+
})
|
|
503
|
+
))
|
|
504
|
+
.with(tracing_subscriber::fmt::layer().json())
|
|
505
|
+
.init();
|
|
506
|
+
|
|
507
|
+
// Load configuration
|
|
508
|
+
let config = AppConfig::from_env()?;
|
|
509
|
+
info!("Configuration loaded successfully");
|
|
510
|
+
|
|
511
|
+
// Connect to database
|
|
512
|
+
let db = PgPool::connect(&config.database_url).await?;
|
|
513
|
+
info!("Connected to database");
|
|
514
|
+
|
|
515
|
+
// Run migrations
|
|
516
|
+
sqlx::migrate!("./migrations").run(&db).await?;
|
|
517
|
+
info!("Database migrations completed");
|
|
518
|
+
|
|
519
|
+
// Initialize cache
|
|
520
|
+
let cache = Arc::new(CacheManager::new(&config.redis_url).await?);
|
|
521
|
+
info!("Cache initialized");
|
|
522
|
+
|
|
523
|
+
// Initialize notification service
|
|
524
|
+
let notification_service = Arc::new(NotificationService::new(
|
|
525
|
+
db.clone(),
|
|
526
|
+
cache.clone(),
|
|
527
|
+
));
|
|
528
|
+
|
|
529
|
+
// Create application state
|
|
530
|
+
let state = AppState {
|
|
531
|
+
db: db.clone(),
|
|
532
|
+
cache,
|
|
533
|
+
config: Arc::new(config.clone()),
|
|
534
|
+
notification_service,
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
// Create the application
|
|
538
|
+
let app = create_app(state);
|
|
539
|
+
|
|
540
|
+
// Create server
|
|
541
|
+
let listener = tokio::net::TcpListener::bind(
|
|
542
|
+
format!("{}:{}", config.server.host, config.server.port)
|
|
543
|
+
).await?;
|
|
544
|
+
|
|
545
|
+
info!(
|
|
546
|
+
"Server starting on http://{}:{}",
|
|
547
|
+
config.server.host, config.server.port
|
|
548
|
+
);
|
|
549
|
+
|
|
550
|
+
// Start metrics server in background
|
|
551
|
+
tokio::spawn(start_metrics_server(config.metrics.port));
|
|
552
|
+
|
|
553
|
+
// Run the server
|
|
554
|
+
axum::serve(listener, app)
|
|
555
|
+
.with_graceful_shutdown(shutdown_signal())
|
|
556
|
+
.await?;
|
|
557
|
+
|
|
558
|
+
info!("Server shutdown completed");
|
|
559
|
+
Ok(())
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
fn create_app(state: AppState) -> Router {
|
|
563
|
+
Router::new()
|
|
564
|
+
// API routes
|
|
565
|
+
.nest("/api/v1", api_routes())
|
|
566
|
+
// Health check
|
|
567
|
+
.route("/health", get(health_check))
|
|
568
|
+
// WebSocket endpoint
|
|
569
|
+
.route("/ws", get(handlers::websocket::websocket_handler))
|
|
570
|
+
// Static file serving (for uploads)
|
|
571
|
+
.nest_service("/uploads", tower_http::services::ServeDir::new("uploads"))
|
|
572
|
+
// Add application state
|
|
573
|
+
.with_state(state.clone())
|
|
574
|
+
// Add middleware stack
|
|
575
|
+
.layer(
|
|
576
|
+
ServiceBuilder::new()
|
|
577
|
+
// Timeout for all requests
|
|
578
|
+
.layer(TimeoutLayer::new(
|
|
579
|
+
std::time::Duration::from_secs(state.config.server.request_timeout)
|
|
580
|
+
))
|
|
581
|
+
// Rate limiting
|
|
582
|
+
.layer(middleware::from_fn_with_state(
|
|
583
|
+
state.clone(),
|
|
584
|
+
rate_limit_middleware
|
|
585
|
+
))
|
|
586
|
+
// Compression
|
|
587
|
+
.layer(CompressionLayer::new())
|
|
588
|
+
// CORS
|
|
589
|
+
.layer(cors_middleware(&state.config.server.cors_origins))
|
|
590
|
+
// Request tracing
|
|
591
|
+
.layer(TraceLayer::new_for_http())
|
|
592
|
+
// Request ID
|
|
593
|
+
.layer(middleware::from_fn(logging_middleware))
|
|
594
|
+
)
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
fn api_routes() -> Router<AppState> {
|
|
598
|
+
Router::new()
|
|
599
|
+
// Public routes (no authentication required)
|
|
600
|
+
.nest("/auth", handlers::auth::routes())
|
|
601
|
+
.route("/health", get(health_check))
|
|
602
|
+
|
|
603
|
+
// Protected routes (authentication required)
|
|
604
|
+
.nest("/users", handlers::users::routes())
|
|
605
|
+
.nest("/projects", handlers::projects::routes())
|
|
606
|
+
.nest("/tasks", handlers::tasks::routes())
|
|
607
|
+
.nest("/notifications", handlers::notifications::routes())
|
|
608
|
+
|
|
609
|
+
// Admin routes (admin role required)
|
|
610
|
+
.nest("/admin", admin_routes())
|
|
611
|
+
|
|
612
|
+
// Apply authentication middleware to protected routes
|
|
613
|
+
.layer(middleware::from_fn_with_state(AppState::clone, auth_middleware))
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
fn admin_routes() -> Router<AppState> {
|
|
617
|
+
Router::new()
|
|
618
|
+
.route("/users", get(handlers::admin::list_all_users))
|
|
619
|
+
.route("/metrics", get(handlers::admin::system_metrics))
|
|
620
|
+
.route("/logs", get(handlers::admin::recent_logs))
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
async fn health_check(State(state): State<AppState>) -> Result<Json<serde_json::Value>, StatusCode> {
|
|
624
|
+
// Check database connection
|
|
625
|
+
let db_status = match sqlx::query("SELECT 1").fetch_one(&state.db).await {
|
|
626
|
+
Ok(_) => "healthy",
|
|
627
|
+
Err(_) => "unhealthy",
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
// Check cache connection
|
|
631
|
+
let cache_status = match state.cache.ping().await {
|
|
632
|
+
Ok(_) => "healthy",
|
|
633
|
+
Err(_) => "unhealthy",
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
let response = serde_json::json!({
|
|
637
|
+
"status": if db_status == "healthy" && cache_status == "healthy" { "healthy" } else { "unhealthy" },
|
|
638
|
+
"timestamp": chrono::Utc::now(),
|
|
639
|
+
"version": env!("CARGO_PKG_VERSION"),
|
|
640
|
+
"services": {
|
|
641
|
+
"database": db_status,
|
|
642
|
+
"cache": cache_status
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
Ok(Json(response))
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
async fn start_metrics_server(port: u16) {
|
|
650
|
+
let metrics_app = Router::new()
|
|
651
|
+
.route("/metrics", get(|| async {
|
|
652
|
+
metrics_exporter_prometheus::render()
|
|
653
|
+
}));
|
|
654
|
+
|
|
655
|
+
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", port))
|
|
656
|
+
.await
|
|
657
|
+
.expect("Failed to bind metrics server");
|
|
658
|
+
|
|
659
|
+
info!("Metrics server starting on port {}", port);
|
|
660
|
+
|
|
661
|
+
axum::serve(listener, metrics_app)
|
|
662
|
+
.await
|
|
663
|
+
.expect("Metrics server failed");
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
async fn shutdown_signal() {
|
|
667
|
+
let ctrl_c = async {
|
|
668
|
+
tokio::signal::ctrl_c()
|
|
669
|
+
.await
|
|
670
|
+
.expect("failed to install Ctrl+C handler");
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
#[cfg(unix)]
|
|
674
|
+
let terminate = async {
|
|
675
|
+
tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate())
|
|
676
|
+
.expect("failed to install signal handler")
|
|
677
|
+
.recv()
|
|
678
|
+
.await;
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
#[cfg(not(unix))]
|
|
682
|
+
let terminate = std::future::pending::<()>();
|
|
683
|
+
|
|
684
|
+
tokio::select! {
|
|
685
|
+
_ = ctrl_c => {},
|
|
686
|
+
_ = terminate => {},
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
warn!("Shutdown signal received");
|
|
690
|
+
}
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
### 2. Task Management Handlers
|
|
694
|
+
|
|
695
|
+
```rust
|
|
696
|
+
// src/handlers/tasks.rs - Generated by API Architect agent
|
|
697
|
+
use axum::{
|
|
698
|
+
extract::{Path, Query, State},
|
|
699
|
+
http::StatusCode,
|
|
700
|
+
response::Json,
|
|
701
|
+
routing::{delete, get, post, put},
|
|
702
|
+
Router,
|
|
703
|
+
};
|
|
704
|
+
use serde::{Deserialize, Serialize};
|
|
705
|
+
use uuid::Uuid;
|
|
706
|
+
use validator::Validate;
|
|
707
|
+
use crate::{
|
|
708
|
+
error::{AppError, AppResult},
|
|
709
|
+
extractors::{AuthenticatedUser, ValidatedJson},
|
|
710
|
+
models::task::{Task, TaskStatus, TaskPriority},
|
|
711
|
+
services::TaskService,
|
|
712
|
+
utils::pagination::{PaginationParams, PaginatedResponse},
|
|
713
|
+
AppState,
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
// Route definitions
|
|
717
|
+
pub fn routes() -> Router<AppState> {
|
|
718
|
+
Router::new()
|
|
719
|
+
.route("/", get(list_tasks).post(create_task))
|
|
720
|
+
.route("/:id", get(get_task).put(update_task).delete(delete_task))
|
|
721
|
+
.route("/:id/comments", get(list_task_comments).post(add_task_comment))
|
|
722
|
+
.route("/:id/attachments", get(list_task_attachments).post(upload_attachment))
|
|
723
|
+
.route("/:id/assign", put(assign_task))
|
|
724
|
+
.route("/:id/status", put(update_task_status))
|
|
725
|
+
.route("/search", get(search_tasks))
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// Request/Response DTOs
|
|
729
|
+
#[derive(Debug, Deserialize, Validate)]
|
|
730
|
+
pub struct CreateTaskRequest {
|
|
731
|
+
#[validate(length(min = 1, max = 255))]
|
|
732
|
+
pub title: String,
|
|
733
|
+
|
|
734
|
+
pub description: Option<String>,
|
|
735
|
+
|
|
736
|
+
pub project_id: Uuid,
|
|
737
|
+
|
|
738
|
+
pub assignee_id: Option<Uuid>,
|
|
739
|
+
|
|
740
|
+
#[serde(default)]
|
|
741
|
+
pub priority: TaskPriority,
|
|
742
|
+
|
|
743
|
+
pub due_date: Option<chrono::DateTime<chrono::Utc>>,
|
|
744
|
+
|
|
745
|
+
pub estimated_hours: Option<i32>,
|
|
746
|
+
|
|
747
|
+
pub tags: Option<Vec<String>>,
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
#[derive(Debug, Deserialize, Validate)]
|
|
751
|
+
pub struct UpdateTaskRequest {
|
|
752
|
+
#[validate(length(min = 1, max = 255))]
|
|
753
|
+
pub title: Option<String>,
|
|
754
|
+
|
|
755
|
+
pub description: Option<String>,
|
|
756
|
+
|
|
757
|
+
pub assignee_id: Option<Uuid>,
|
|
758
|
+
|
|
759
|
+
pub priority: Option<TaskPriority>,
|
|
760
|
+
|
|
761
|
+
pub due_date: Option<chrono::DateTime<chrono::Utc>>,
|
|
762
|
+
|
|
763
|
+
pub estimated_hours: Option<i32>,
|
|
764
|
+
|
|
765
|
+
pub actual_hours: Option<i32>,
|
|
766
|
+
|
|
767
|
+
pub tags: Option<Vec<String>>,
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
#[derive(Debug, Deserialize, Validate)]
|
|
771
|
+
pub struct UpdateTaskStatusRequest {
|
|
772
|
+
pub status: TaskStatus,
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
#[derive(Debug, Deserialize, Validate)]
|
|
776
|
+
pub struct AssignTaskRequest {
|
|
777
|
+
pub assignee_id: Option<Uuid>,
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
#[derive(Debug, Deserialize)]
|
|
781
|
+
pub struct TaskSearchParams {
|
|
782
|
+
pub project_id: Option<Uuid>,
|
|
783
|
+
pub assignee_id: Option<Uuid>,
|
|
784
|
+
pub status: Option<TaskStatus>,
|
|
785
|
+
pub priority: Option<TaskPriority>,
|
|
786
|
+
pub tags: Option<Vec<String>>,
|
|
787
|
+
pub due_date_from: Option<chrono::Date<chrono::Utc>>,
|
|
788
|
+
pub due_date_to: Option<chrono::Date<chrono::Utc>>,
|
|
789
|
+
pub search: Option<String>,
|
|
790
|
+
#[serde(flatten)]
|
|
791
|
+
pub pagination: PaginationParams,
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
#[derive(Debug, Serialize)]
|
|
795
|
+
pub struct TaskResponse {
|
|
796
|
+
pub id: Uuid,
|
|
797
|
+
pub title: String,
|
|
798
|
+
pub description: Option<String>,
|
|
799
|
+
pub project_id: Uuid,
|
|
800
|
+
pub project_name: String,
|
|
801
|
+
pub assignee_id: Option<Uuid>,
|
|
802
|
+
pub assignee_name: Option<String>,
|
|
803
|
+
pub created_by: Uuid,
|
|
804
|
+
pub created_by_name: String,
|
|
805
|
+
pub status: TaskStatus,
|
|
806
|
+
pub priority: TaskPriority,
|
|
807
|
+
pub due_date: Option<chrono::DateTime<chrono::Utc>>,
|
|
808
|
+
pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
|
|
809
|
+
pub estimated_hours: Option<i32>,
|
|
810
|
+
pub actual_hours: Option<i32>,
|
|
811
|
+
pub tags: Vec<String>,
|
|
812
|
+
pub created_at: chrono::DateTime<chrono::Utc>,
|
|
813
|
+
pub updated_at: chrono::DateTime<chrono::Utc>,
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// Handler implementations
|
|
817
|
+
pub async fn list_tasks(
|
|
818
|
+
State(state): State<AppState>,
|
|
819
|
+
Query(params): Query<TaskSearchParams>,
|
|
820
|
+
user: AuthenticatedUser,
|
|
821
|
+
) -> AppResult<Json<PaginatedResponse<TaskResponse>>> {
|
|
822
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
823
|
+
|
|
824
|
+
let tasks = task_service
|
|
825
|
+
.list_tasks_for_user(user.user_id, ¶ms)
|
|
826
|
+
.await?;
|
|
827
|
+
|
|
828
|
+
let total = task_service
|
|
829
|
+
.count_tasks_for_user(user.user_id, ¶ms)
|
|
830
|
+
.await?;
|
|
831
|
+
|
|
832
|
+
let task_responses: Vec<TaskResponse> = tasks
|
|
833
|
+
.into_iter()
|
|
834
|
+
.map(TaskResponse::from)
|
|
835
|
+
.collect();
|
|
836
|
+
|
|
837
|
+
let response = PaginatedResponse {
|
|
838
|
+
data: task_responses,
|
|
839
|
+
pagination: crate::utils::pagination::PaginationResponse {
|
|
840
|
+
page: params.pagination.page.unwrap_or(1),
|
|
841
|
+
limit: params.pagination.limit.unwrap_or(20),
|
|
842
|
+
total,
|
|
843
|
+
pages: (total as f64 / params.pagination.limit.unwrap_or(20) as f64).ceil() as u32,
|
|
844
|
+
},
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
Ok(Json(response))
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
pub async fn get_task(
|
|
851
|
+
State(state): State<AppState>,
|
|
852
|
+
Path(task_id): Path<Uuid>,
|
|
853
|
+
user: AuthenticatedUser,
|
|
854
|
+
) -> AppResult<Json<TaskResponse>> {
|
|
855
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
856
|
+
|
|
857
|
+
let task = task_service
|
|
858
|
+
.get_task_by_id(task_id, user.user_id)
|
|
859
|
+
.await?
|
|
860
|
+
.ok_or(AppError::NotFound)?;
|
|
861
|
+
|
|
862
|
+
Ok(Json(TaskResponse::from(task)))
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
pub async fn create_task(
|
|
866
|
+
State(state): State<AppState>,
|
|
867
|
+
user: AuthenticatedUser,
|
|
868
|
+
ValidatedJson(request): ValidatedJson<CreateTaskRequest>,
|
|
869
|
+
) -> AppResult<Json<TaskResponse>> {
|
|
870
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
871
|
+
|
|
872
|
+
// Check if user has access to the project
|
|
873
|
+
if !task_service.user_has_project_access(user.user_id, request.project_id).await? {
|
|
874
|
+
return Err(AppError::Forbidden);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
let task = task_service
|
|
878
|
+
.create_task(request, user.user_id)
|
|
879
|
+
.await?;
|
|
880
|
+
|
|
881
|
+
// Send notification to assignee if assigned
|
|
882
|
+
if let Some(assignee_id) = task.assignee_id {
|
|
883
|
+
let notification_service = state.notification_service.clone();
|
|
884
|
+
tokio::spawn(async move {
|
|
885
|
+
let _ = notification_service.send_task_assigned_notification(
|
|
886
|
+
assignee_id,
|
|
887
|
+
task.id,
|
|
888
|
+
&task.title,
|
|
889
|
+
).await;
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// Log activity
|
|
894
|
+
task_service.log_task_activity(
|
|
895
|
+
task.id,
|
|
896
|
+
user.user_id,
|
|
897
|
+
"task_created",
|
|
898
|
+
serde_json::json!({
|
|
899
|
+
"task_title": task.title,
|
|
900
|
+
"project_id": task.project_id
|
|
901
|
+
})
|
|
902
|
+
).await?;
|
|
903
|
+
|
|
904
|
+
Ok(Json(TaskResponse::from(task)))
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
pub async fn update_task(
|
|
908
|
+
State(state): State<AppState>,
|
|
909
|
+
Path(task_id): Path<Uuid>,
|
|
910
|
+
user: AuthenticatedUser,
|
|
911
|
+
ValidatedJson(request): ValidatedJson<UpdateTaskRequest>,
|
|
912
|
+
) -> AppResult<Json<TaskResponse>> {
|
|
913
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
914
|
+
|
|
915
|
+
// Check if user has access to the task
|
|
916
|
+
let existing_task = task_service
|
|
917
|
+
.get_task_by_id(task_id, user.user_id)
|
|
918
|
+
.await?
|
|
919
|
+
.ok_or(AppError::NotFound)?;
|
|
920
|
+
|
|
921
|
+
let updated_task = task_service
|
|
922
|
+
.update_task(task_id, request, user.user_id)
|
|
923
|
+
.await?;
|
|
924
|
+
|
|
925
|
+
// Send notifications for significant changes
|
|
926
|
+
if let Some(new_assignee) = updated_task.assignee_id {
|
|
927
|
+
if existing_task.assignee_id != Some(new_assignee) {
|
|
928
|
+
let notification_service = state.notification_service.clone();
|
|
929
|
+
let task_title = updated_task.title.clone();
|
|
930
|
+
tokio::spawn(async move {
|
|
931
|
+
let _ = notification_service.send_task_assigned_notification(
|
|
932
|
+
new_assignee,
|
|
933
|
+
task_id,
|
|
934
|
+
&task_title,
|
|
935
|
+
).await;
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// Log activity
|
|
941
|
+
task_service.log_task_activity(
|
|
942
|
+
task_id,
|
|
943
|
+
user.user_id,
|
|
944
|
+
"task_updated",
|
|
945
|
+
serde_json::json!({
|
|
946
|
+
"changes": request
|
|
947
|
+
})
|
|
948
|
+
).await?;
|
|
949
|
+
|
|
950
|
+
Ok(Json(TaskResponse::from(updated_task)))
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
pub async fn delete_task(
|
|
954
|
+
State(state): State<AppState>,
|
|
955
|
+
Path(task_id): Path<Uuid>,
|
|
956
|
+
user: AuthenticatedUser,
|
|
957
|
+
) -> AppResult<StatusCode> {
|
|
958
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
959
|
+
|
|
960
|
+
// Check if user has access to delete the task
|
|
961
|
+
let task = task_service
|
|
962
|
+
.get_task_by_id(task_id, user.user_id)
|
|
963
|
+
.await?
|
|
964
|
+
.ok_or(AppError::NotFound)?;
|
|
965
|
+
|
|
966
|
+
// Only task creator, project owner, or admin can delete
|
|
967
|
+
if task.created_by != user.user_id && !user.roles.contains(&"admin".to_string()) {
|
|
968
|
+
// Check if user is project owner
|
|
969
|
+
if !task_service.is_project_owner(user.user_id, task.project_id).await? {
|
|
970
|
+
return Err(AppError::Forbidden);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
task_service.delete_task(task_id).await?;
|
|
975
|
+
|
|
976
|
+
// Log activity
|
|
977
|
+
task_service.log_task_activity(
|
|
978
|
+
task_id,
|
|
979
|
+
user.user_id,
|
|
980
|
+
"task_deleted",
|
|
981
|
+
serde_json::json!({
|
|
982
|
+
"task_title": task.title
|
|
983
|
+
})
|
|
984
|
+
).await?;
|
|
985
|
+
|
|
986
|
+
Ok(StatusCode::NO_CONTENT)
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
pub async fn assign_task(
|
|
990
|
+
State(state): State<AppState>,
|
|
991
|
+
Path(task_id): Path<Uuid>,
|
|
992
|
+
user: AuthenticatedUser,
|
|
993
|
+
ValidatedJson(request): ValidatedJson<AssignTaskRequest>,
|
|
994
|
+
) -> AppResult<Json<TaskResponse>> {
|
|
995
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
996
|
+
|
|
997
|
+
let updated_task = task_service
|
|
998
|
+
.assign_task(task_id, request.assignee_id, user.user_id)
|
|
999
|
+
.await?;
|
|
1000
|
+
|
|
1001
|
+
// Send notification
|
|
1002
|
+
if let Some(assignee_id) = request.assignee_id {
|
|
1003
|
+
let notification_service = state.notification_service.clone();
|
|
1004
|
+
let task_title = updated_task.title.clone();
|
|
1005
|
+
tokio::spawn(async move {
|
|
1006
|
+
let _ = notification_service.send_task_assigned_notification(
|
|
1007
|
+
assignee_id,
|
|
1008
|
+
task_id,
|
|
1009
|
+
&task_title,
|
|
1010
|
+
).await;
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
Ok(Json(TaskResponse::from(updated_task)))
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
pub async fn update_task_status(
|
|
1018
|
+
State(state): State<AppState>,
|
|
1019
|
+
Path(task_id): Path<Uuid>,
|
|
1020
|
+
user: AuthenticatedUser,
|
|
1021
|
+
ValidatedJson(request): ValidatedJson<UpdateTaskStatusRequest>,
|
|
1022
|
+
) -> AppResult<Json<TaskResponse>> {
|
|
1023
|
+
let task_service = TaskService::new(state.db.clone(), state.cache.clone());
|
|
1024
|
+
|
|
1025
|
+
let updated_task = task_service
|
|
1026
|
+
.update_task_status(task_id, request.status, user.user_id)
|
|
1027
|
+
.await?;
|
|
1028
|
+
|
|
1029
|
+
// Send completion notification if task is completed
|
|
1030
|
+
if request.status == TaskStatus::Done {
|
|
1031
|
+
if let Some(assignee_id) = updated_task.assignee_id {
|
|
1032
|
+
let notification_service = state.notification_service.clone();
|
|
1033
|
+
let task_title = updated_task.title.clone();
|
|
1034
|
+
tokio::spawn(async move {
|
|
1035
|
+
let _ = notification_service.send_task_completed_notification(
|
|
1036
|
+
assignee_id,
|
|
1037
|
+
task_id,
|
|
1038
|
+
&task_title,
|
|
1039
|
+
).await;
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
Ok(Json(TaskResponse::from(updated_task)))
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
impl From<Task> for TaskResponse {
|
|
1048
|
+
fn from(task: Task) -> Self {
|
|
1049
|
+
Self {
|
|
1050
|
+
id: task.id,
|
|
1051
|
+
title: task.title,
|
|
1052
|
+
description: task.description,
|
|
1053
|
+
project_id: task.project_id,
|
|
1054
|
+
project_name: task.project_name.unwrap_or_default(),
|
|
1055
|
+
assignee_id: task.assignee_id,
|
|
1056
|
+
assignee_name: task.assignee_name,
|
|
1057
|
+
created_by: task.created_by,
|
|
1058
|
+
created_by_name: task.created_by_name.unwrap_or_default(),
|
|
1059
|
+
status: task.status,
|
|
1060
|
+
priority: task.priority,
|
|
1061
|
+
due_date: task.due_date,
|
|
1062
|
+
completed_at: task.completed_at,
|
|
1063
|
+
estimated_hours: task.estimated_hours,
|
|
1064
|
+
actual_hours: task.actual_hours,
|
|
1065
|
+
tags: task.tags.unwrap_or_default(),
|
|
1066
|
+
created_at: task.created_at,
|
|
1067
|
+
updated_at: task.updated_at,
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
## 🧪 Comprehensive Testing
|
|
1074
|
+
|
|
1075
|
+
### 1. Integration Tests
|
|
1076
|
+
|
|
1077
|
+
```rust
|
|
1078
|
+
// tests/integration/task_tests.rs - Generated by Testing Engineer agent
|
|
1079
|
+
use axum_test::TestServer;
|
|
1080
|
+
use serde_json::json;
|
|
1081
|
+
use sqlx::PgPool;
|
|
1082
|
+
use task_management_api::models::task::TaskStatus;
|
|
1083
|
+
use uuid::Uuid;
|
|
1084
|
+
|
|
1085
|
+
mod common;
|
|
1086
|
+
use common::*;
|
|
1087
|
+
|
|
1088
|
+
#[tokio::test]
|
|
1089
|
+
async fn test_task_crud_operations() {
|
|
1090
|
+
let (server, _db) = setup_test_server().await;
|
|
1091
|
+
let (user_token, user) = create_test_user_and_login(&server).await;
|
|
1092
|
+
let project = create_test_project(&server, &user_token, user.id).await;
|
|
1093
|
+
|
|
1094
|
+
// Test create task
|
|
1095
|
+
let create_response = server
|
|
1096
|
+
.post("/api/v1/tasks")
|
|
1097
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1098
|
+
.json(&json!({
|
|
1099
|
+
"title": "Test Task",
|
|
1100
|
+
"description": "This is a test task",
|
|
1101
|
+
"project_id": project.id,
|
|
1102
|
+
"priority": "high",
|
|
1103
|
+
"estimated_hours": 8,
|
|
1104
|
+
"tags": ["urgent", "feature"]
|
|
1105
|
+
}))
|
|
1106
|
+
.await;
|
|
1107
|
+
|
|
1108
|
+
create_response.assert_status_ok();
|
|
1109
|
+
let created_task: TaskResponse = create_response.json();
|
|
1110
|
+
assert_eq!(created_task.title, "Test Task");
|
|
1111
|
+
assert_eq!(created_task.project_id, project.id);
|
|
1112
|
+
assert_eq!(created_task.priority.to_string(), "high");
|
|
1113
|
+
|
|
1114
|
+
// Test get task
|
|
1115
|
+
let get_response = server
|
|
1116
|
+
.get(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1117
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1118
|
+
.await;
|
|
1119
|
+
|
|
1120
|
+
get_response.assert_status_ok();
|
|
1121
|
+
let retrieved_task: TaskResponse = get_response.json();
|
|
1122
|
+
assert_eq!(retrieved_task.id, created_task.id);
|
|
1123
|
+
assert_eq!(retrieved_task.title, "Test Task");
|
|
1124
|
+
|
|
1125
|
+
// Test update task
|
|
1126
|
+
let update_response = server
|
|
1127
|
+
.put(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1128
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1129
|
+
.json(&json!({
|
|
1130
|
+
"title": "Updated Test Task",
|
|
1131
|
+
"actual_hours": 6
|
|
1132
|
+
}))
|
|
1133
|
+
.await;
|
|
1134
|
+
|
|
1135
|
+
update_response.assert_status_ok();
|
|
1136
|
+
let updated_task: TaskResponse = update_response.json();
|
|
1137
|
+
assert_eq!(updated_task.title, "Updated Test Task");
|
|
1138
|
+
assert_eq!(updated_task.actual_hours, Some(6));
|
|
1139
|
+
|
|
1140
|
+
// Test update task status
|
|
1141
|
+
let status_response = server
|
|
1142
|
+
.put(&format!("/api/v1/tasks/{}/status", created_task.id))
|
|
1143
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1144
|
+
.json(&json!({
|
|
1145
|
+
"status": "done"
|
|
1146
|
+
}))
|
|
1147
|
+
.await;
|
|
1148
|
+
|
|
1149
|
+
status_response.assert_status_ok();
|
|
1150
|
+
let completed_task: TaskResponse = status_response.json();
|
|
1151
|
+
assert_eq!(completed_task.status.to_string(), "done");
|
|
1152
|
+
assert!(completed_task.completed_at.is_some());
|
|
1153
|
+
|
|
1154
|
+
// Test delete task
|
|
1155
|
+
let delete_response = server
|
|
1156
|
+
.delete(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1157
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1158
|
+
.await;
|
|
1159
|
+
|
|
1160
|
+
delete_response.assert_status(axum::http::StatusCode::NO_CONTENT);
|
|
1161
|
+
|
|
1162
|
+
// Verify task is deleted
|
|
1163
|
+
let get_deleted_response = server
|
|
1164
|
+
.get(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1165
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1166
|
+
.await;
|
|
1167
|
+
|
|
1168
|
+
get_deleted_response.assert_status_not_found();
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
#[tokio::test]
|
|
1172
|
+
async fn test_task_assignment_and_notifications() {
|
|
1173
|
+
let (server, _db) = setup_test_server().await;
|
|
1174
|
+
let (user1_token, user1) = create_test_user_and_login(&server).await;
|
|
1175
|
+
let (user2_token, user2) = create_test_user_with_email(&server, "user2@example.com").await;
|
|
1176
|
+
let project = create_test_project(&server, &user1_token, user1.id).await;
|
|
1177
|
+
|
|
1178
|
+
// Add user2 to project
|
|
1179
|
+
add_user_to_project(&server, &user1_token, project.id, user2.id).await;
|
|
1180
|
+
|
|
1181
|
+
// Create task
|
|
1182
|
+
let create_response = server
|
|
1183
|
+
.post("/api/v1/tasks")
|
|
1184
|
+
.add_header("authorization", format!("Bearer {}", user1_token))
|
|
1185
|
+
.json(&json!({
|
|
1186
|
+
"title": "Assignable Task",
|
|
1187
|
+
"project_id": project.id
|
|
1188
|
+
}))
|
|
1189
|
+
.await;
|
|
1190
|
+
|
|
1191
|
+
let created_task: TaskResponse = create_response.json();
|
|
1192
|
+
|
|
1193
|
+
// Assign task to user2
|
|
1194
|
+
let assign_response = server
|
|
1195
|
+
.put(&format!("/api/v1/tasks/{}/assign", created_task.id))
|
|
1196
|
+
.add_header("authorization", format!("Bearer {}", user1_token))
|
|
1197
|
+
.json(&json!({
|
|
1198
|
+
"assignee_id": user2.id
|
|
1199
|
+
}))
|
|
1200
|
+
.await;
|
|
1201
|
+
|
|
1202
|
+
assign_response.assert_status_ok();
|
|
1203
|
+
let assigned_task: TaskResponse = assign_response.json();
|
|
1204
|
+
assert_eq!(assigned_task.assignee_id, Some(user2.id));
|
|
1205
|
+
|
|
1206
|
+
// Check notifications for user2
|
|
1207
|
+
let notifications_response = server
|
|
1208
|
+
.get("/api/v1/notifications")
|
|
1209
|
+
.add_header("authorization", format!("Bearer {}", user2_token))
|
|
1210
|
+
.await;
|
|
1211
|
+
|
|
1212
|
+
notifications_response.assert_status_ok();
|
|
1213
|
+
let notifications: PaginatedResponse<NotificationResponse> = notifications_response.json();
|
|
1214
|
+
|
|
1215
|
+
assert!(!notifications.data.is_empty());
|
|
1216
|
+
let notification = ¬ifications.data[0];
|
|
1217
|
+
assert!(notification.title.contains("assigned"));
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
#[tokio::test]
|
|
1221
|
+
async fn test_task_search_and_filtering() {
|
|
1222
|
+
let (server, _db) = setup_test_server().await;
|
|
1223
|
+
let (user_token, user) = create_test_user_and_login(&server).await;
|
|
1224
|
+
let project = create_test_project(&server, &user_token, user.id).await;
|
|
1225
|
+
|
|
1226
|
+
// Create multiple tasks with different properties
|
|
1227
|
+
let tasks = vec![
|
|
1228
|
+
json!({
|
|
1229
|
+
"title": "High Priority Bug Fix",
|
|
1230
|
+
"project_id": project.id,
|
|
1231
|
+
"priority": "high",
|
|
1232
|
+
"tags": ["bug", "urgent"]
|
|
1233
|
+
}),
|
|
1234
|
+
json!({
|
|
1235
|
+
"title": "Feature Development",
|
|
1236
|
+
"project_id": project.id,
|
|
1237
|
+
"priority": "medium",
|
|
1238
|
+
"tags": ["feature", "enhancement"]
|
|
1239
|
+
}),
|
|
1240
|
+
json!({
|
|
1241
|
+
"title": "Low Priority Cleanup",
|
|
1242
|
+
"project_id": project.id,
|
|
1243
|
+
"priority": "low",
|
|
1244
|
+
"tags": ["cleanup", "technical-debt"]
|
|
1245
|
+
}),
|
|
1246
|
+
];
|
|
1247
|
+
|
|
1248
|
+
let mut created_task_ids = Vec::new();
|
|
1249
|
+
for task_data in tasks {
|
|
1250
|
+
let response = server
|
|
1251
|
+
.post("/api/v1/tasks")
|
|
1252
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1253
|
+
.json(&task_data)
|
|
1254
|
+
.await;
|
|
1255
|
+
|
|
1256
|
+
let task: TaskResponse = response.json();
|
|
1257
|
+
created_task_ids.push(task.id);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
// Test search by priority
|
|
1261
|
+
let high_priority_response = server
|
|
1262
|
+
.get("/api/v1/tasks")
|
|
1263
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1264
|
+
.add_query_param("priority", "high")
|
|
1265
|
+
.await;
|
|
1266
|
+
|
|
1267
|
+
high_priority_response.assert_status_ok();
|
|
1268
|
+
let high_priority_tasks: PaginatedResponse<TaskResponse> = high_priority_response.json();
|
|
1269
|
+
assert_eq!(high_priority_tasks.data.len(), 1);
|
|
1270
|
+
assert_eq!(high_priority_tasks.data[0].title, "High Priority Bug Fix");
|
|
1271
|
+
|
|
1272
|
+
// Test search by tags
|
|
1273
|
+
let bug_tasks_response = server
|
|
1274
|
+
.get("/api/v1/tasks")
|
|
1275
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1276
|
+
.add_query_param("tags", "bug")
|
|
1277
|
+
.await;
|
|
1278
|
+
|
|
1279
|
+
bug_tasks_response.assert_status_ok();
|
|
1280
|
+
let bug_tasks: PaginatedResponse<TaskResponse> = bug_tasks_response.json();
|
|
1281
|
+
assert_eq!(bug_tasks.data.len(), 1);
|
|
1282
|
+
assert!(bug_tasks.data[0].tags.contains(&"bug".to_string()));
|
|
1283
|
+
|
|
1284
|
+
// Test text search
|
|
1285
|
+
let search_response = server
|
|
1286
|
+
.get("/api/v1/tasks")
|
|
1287
|
+
.add_header("authorization", format!("Bearer {}", user_token))
|
|
1288
|
+
.add_query_param("search", "Feature")
|
|
1289
|
+
.await;
|
|
1290
|
+
|
|
1291
|
+
search_response.assert_status_ok();
|
|
1292
|
+
let search_results: PaginatedResponse<TaskResponse> = search_response.json();
|
|
1293
|
+
assert_eq!(search_results.data.len(), 1);
|
|
1294
|
+
assert!(search_results.data[0].title.contains("Feature"));
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
#[tokio::test]
|
|
1298
|
+
async fn test_task_permissions() {
|
|
1299
|
+
let (server, _db) = setup_test_server().await;
|
|
1300
|
+
let (user1_token, user1) = create_test_user_and_login(&server).await;
|
|
1301
|
+
let (user2_token, user2) = create_test_user_with_email(&server, "user2@example.com").await;
|
|
1302
|
+
|
|
1303
|
+
let project = create_test_project(&server, &user1_token, user1.id).await;
|
|
1304
|
+
|
|
1305
|
+
// Create task as user1
|
|
1306
|
+
let create_response = server
|
|
1307
|
+
.post("/api/v1/tasks")
|
|
1308
|
+
.add_header("authorization", format!("Bearer {}", user1_token))
|
|
1309
|
+
.json(&json!({
|
|
1310
|
+
"title": "Private Task",
|
|
1311
|
+
"project_id": project.id
|
|
1312
|
+
}))
|
|
1313
|
+
.await;
|
|
1314
|
+
|
|
1315
|
+
let created_task: TaskResponse = create_response.json();
|
|
1316
|
+
|
|
1317
|
+
// user2 should not be able to access the task (not a project member)
|
|
1318
|
+
let unauthorized_response = server
|
|
1319
|
+
.get(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1320
|
+
.add_header("authorization", format!("Bearer {}", user2_token))
|
|
1321
|
+
.await;
|
|
1322
|
+
|
|
1323
|
+
unauthorized_response.assert_status_forbidden();
|
|
1324
|
+
|
|
1325
|
+
// Add user2 to project
|
|
1326
|
+
add_user_to_project(&server, &user1_token, project.id, user2.id).await;
|
|
1327
|
+
|
|
1328
|
+
// Now user2 should be able to access the task
|
|
1329
|
+
let authorized_response = server
|
|
1330
|
+
.get(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1331
|
+
.add_header("authorization", format!("Bearer {}", user2_token))
|
|
1332
|
+
.await;
|
|
1333
|
+
|
|
1334
|
+
authorized_response.assert_status_ok();
|
|
1335
|
+
|
|
1336
|
+
// But user2 should not be able to delete the task (not the creator)
|
|
1337
|
+
let delete_response = server
|
|
1338
|
+
.delete(&format!("/api/v1/tasks/{}", created_task.id))
|
|
1339
|
+
.add_header("authorization", format!("Bearer {}", user2_token))
|
|
1340
|
+
.await;
|
|
1341
|
+
|
|
1342
|
+
delete_response.assert_status_forbidden();
|
|
1343
|
+
}
|
|
1344
|
+
```
|
|
1345
|
+
|
|
1346
|
+
### 2. Load Testing and Benchmarks
|
|
1347
|
+
|
|
1348
|
+
```rust
|
|
1349
|
+
// benches/api_benchmarks.rs - Generated by Performance Engineer agent
|
|
1350
|
+
use criterion::{black_box, criterion_group, criterion_main, Criterion, BenchmarkId};
|
|
1351
|
+
use reqwest::Client;
|
|
1352
|
+
use serde_json::json;
|
|
1353
|
+
use std::time::Duration;
|
|
1354
|
+
use tokio::runtime::Runtime;
|
|
1355
|
+
|
|
1356
|
+
struct ApiTestSetup {
|
|
1357
|
+
client: Client,
|
|
1358
|
+
base_url: String,
|
|
1359
|
+
auth_token: String,
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
impl ApiTestSetup {
|
|
1363
|
+
async fn new() -> Self {
|
|
1364
|
+
let client = Client::new();
|
|
1365
|
+
let base_url = "http://localhost:8080".to_string();
|
|
1366
|
+
|
|
1367
|
+
// Login and get auth token
|
|
1368
|
+
let login_response = client
|
|
1369
|
+
.post(&format!("{}/api/v1/auth/login", base_url))
|
|
1370
|
+
.json(&json!({
|
|
1371
|
+
"email": "bench@example.com",
|
|
1372
|
+
"password": "benchmarkpassword"
|
|
1373
|
+
}))
|
|
1374
|
+
.send()
|
|
1375
|
+
.await
|
|
1376
|
+
.unwrap();
|
|
1377
|
+
|
|
1378
|
+
let auth_data: serde_json::Value = login_response.json().await.unwrap();
|
|
1379
|
+
let auth_token = auth_data["access_token"].as_str().unwrap().to_string();
|
|
1380
|
+
|
|
1381
|
+
Self {
|
|
1382
|
+
client,
|
|
1383
|
+
base_url,
|
|
1384
|
+
auth_token,
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
fn bench_task_creation(c: &mut Criterion) {
|
|
1390
|
+
let rt = Runtime::new().unwrap();
|
|
1391
|
+
let setup = rt.block_on(ApiTestSetup::new());
|
|
1392
|
+
|
|
1393
|
+
let mut group = c.benchmark_group("task_creation");
|
|
1394
|
+
|
|
1395
|
+
for concurrent_requests in [1, 5, 10, 20, 50].iter() {
|
|
1396
|
+
group.bench_with_input(
|
|
1397
|
+
BenchmarkId::from_parameter(concurrent_requests),
|
|
1398
|
+
concurrent_requests,
|
|
1399
|
+
|b, &concurrent_requests| {
|
|
1400
|
+
b.to_async(&rt).iter(|| async {
|
|
1401
|
+
let futures: Vec<_> = (0..concurrent_requests)
|
|
1402
|
+
.map(|i| {
|
|
1403
|
+
let client = &setup.client;
|
|
1404
|
+
let url = format!("{}/api/v1/tasks", setup.base_url);
|
|
1405
|
+
let token = &setup.auth_token;
|
|
1406
|
+
|
|
1407
|
+
async move {
|
|
1408
|
+
client
|
|
1409
|
+
.post(&url)
|
|
1410
|
+
.header("authorization", format!("Bearer {}", token))
|
|
1411
|
+
.json(&json!({
|
|
1412
|
+
"title": format!("Benchmark Task {}", i),
|
|
1413
|
+
"project_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
1414
|
+
"priority": "medium"
|
|
1415
|
+
}))
|
|
1416
|
+
.send()
|
|
1417
|
+
.await
|
|
1418
|
+
.unwrap()
|
|
1419
|
+
}
|
|
1420
|
+
})
|
|
1421
|
+
.collect();
|
|
1422
|
+
|
|
1423
|
+
let responses = futures::future::join_all(futures).await;
|
|
1424
|
+
black_box(responses)
|
|
1425
|
+
});
|
|
1426
|
+
},
|
|
1427
|
+
);
|
|
1428
|
+
}
|
|
1429
|
+
group.finish();
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
fn bench_task_listing(c: &mut Criterion) {
|
|
1433
|
+
let rt = Runtime::new().unwrap();
|
|
1434
|
+
let setup = rt.block_on(ApiTestSetup::new());
|
|
1435
|
+
|
|
1436
|
+
let mut group = c.benchmark_group("task_listing");
|
|
1437
|
+
|
|
1438
|
+
// Test different page sizes
|
|
1439
|
+
for page_size in [10, 20, 50, 100].iter() {
|
|
1440
|
+
group.bench_with_input(
|
|
1441
|
+
BenchmarkId::from_parameter(page_size),
|
|
1442
|
+
page_size,
|
|
1443
|
+
|b, &page_size| {
|
|
1444
|
+
b.to_async(&rt).iter(|| async {
|
|
1445
|
+
let response = setup.client
|
|
1446
|
+
.get(&format!("{}/api/v1/tasks", setup.base_url))
|
|
1447
|
+
.header("authorization", format!("Bearer {}", setup.auth_token))
|
|
1448
|
+
.query(&[("limit", page_size), ("page", 1)])
|
|
1449
|
+
.send()
|
|
1450
|
+
.await
|
|
1451
|
+
.unwrap();
|
|
1452
|
+
|
|
1453
|
+
black_box(response.text().await.unwrap())
|
|
1454
|
+
});
|
|
1455
|
+
},
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
group.finish();
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
fn bench_task_search(c: &mut Criterion) {
|
|
1462
|
+
let rt = Runtime::new().unwrap();
|
|
1463
|
+
let setup = rt.block_on(ApiTestSetup::new());
|
|
1464
|
+
|
|
1465
|
+
c.bench_function("task_search", |b| {
|
|
1466
|
+
b.to_async(&rt).iter(|| async {
|
|
1467
|
+
let response = setup.client
|
|
1468
|
+
.get(&format!("{}/api/v1/tasks", setup.base_url))
|
|
1469
|
+
.header("authorization", format!("Bearer {}", setup.auth_token))
|
|
1470
|
+
.query(&[
|
|
1471
|
+
("search", "important"),
|
|
1472
|
+
("status", "todo"),
|
|
1473
|
+
("priority", "high")
|
|
1474
|
+
])
|
|
1475
|
+
.send()
|
|
1476
|
+
.await
|
|
1477
|
+
.unwrap();
|
|
1478
|
+
|
|
1479
|
+
black_box(response.text().await.unwrap())
|
|
1480
|
+
});
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
fn bench_concurrent_users(c: &mut Criterion) {
|
|
1485
|
+
let rt = Runtime::new().unwrap();
|
|
1486
|
+
|
|
1487
|
+
let mut group = c.benchmark_group("concurrent_users");
|
|
1488
|
+
group.measurement_time(Duration::from_secs(30));
|
|
1489
|
+
|
|
1490
|
+
for user_count in [10, 25, 50, 100].iter() {
|
|
1491
|
+
group.bench_with_input(
|
|
1492
|
+
BenchmarkId::from_parameter(user_count),
|
|
1493
|
+
user_count,
|
|
1494
|
+
|b, &user_count| {
|
|
1495
|
+
b.to_async(&rt).iter(|| async {
|
|
1496
|
+
// Simulate multiple users performing various operations
|
|
1497
|
+
let futures: Vec<_> = (0..user_count)
|
|
1498
|
+
.map(|i| {
|
|
1499
|
+
async move {
|
|
1500
|
+
let client = Client::new();
|
|
1501
|
+
let base_url = "http://localhost:8080";
|
|
1502
|
+
|
|
1503
|
+
// Login
|
|
1504
|
+
let login_response = client
|
|
1505
|
+
.post(&format!("{}/api/v1/auth/login", base_url))
|
|
1506
|
+
.json(&json!({
|
|
1507
|
+
"email": format!("user{}@example.com", i),
|
|
1508
|
+
"password": "password123"
|
|
1509
|
+
}))
|
|
1510
|
+
.send()
|
|
1511
|
+
.await?;
|
|
1512
|
+
|
|
1513
|
+
if login_response.status().is_success() {
|
|
1514
|
+
let auth_data: serde_json::Value = login_response.json().await?;
|
|
1515
|
+
let token = auth_data["access_token"].as_str().unwrap();
|
|
1516
|
+
|
|
1517
|
+
// Perform typical user operations
|
|
1518
|
+
let _tasks = client
|
|
1519
|
+
.get(&format!("{}/api/v1/tasks", base_url))
|
|
1520
|
+
.header("authorization", format!("Bearer {}", token))
|
|
1521
|
+
.send()
|
|
1522
|
+
.await?;
|
|
1523
|
+
|
|
1524
|
+
let _projects = client
|
|
1525
|
+
.get(&format!("{}/api/v1/projects", base_url))
|
|
1526
|
+
.header("authorization", format!("Bearer {}", token))
|
|
1527
|
+
.send()
|
|
1528
|
+
.await?;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
Ok::<(), Box<dyn std::error::Error + Send + Sync>>(())
|
|
1532
|
+
}
|
|
1533
|
+
})
|
|
1534
|
+
.collect();
|
|
1535
|
+
|
|
1536
|
+
let results = futures::future::join_all(futures).await;
|
|
1537
|
+
black_box(results)
|
|
1538
|
+
});
|
|
1539
|
+
},
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1542
|
+
group.finish();
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
criterion_group!(
|
|
1546
|
+
benches,
|
|
1547
|
+
bench_task_creation,
|
|
1548
|
+
bench_task_listing,
|
|
1549
|
+
bench_task_search,
|
|
1550
|
+
bench_concurrent_users
|
|
1551
|
+
);
|
|
1552
|
+
criterion_main!(benches);
|
|
1553
|
+
```
|
|
1554
|
+
|
|
1555
|
+
## 🚀 Production Deployment
|
|
1556
|
+
|
|
1557
|
+
### 1. Docker Configuration
|
|
1558
|
+
|
|
1559
|
+
```dockerfile
|
|
1560
|
+
# docker/Dockerfile - Generated by DevOps Engineer agent
|
|
1561
|
+
# Multi-stage build for optimal image size
|
|
1562
|
+
FROM rust:1.70-slim as builder
|
|
1563
|
+
|
|
1564
|
+
WORKDIR /app
|
|
1565
|
+
|
|
1566
|
+
# Install build dependencies
|
|
1567
|
+
RUN apt-get update && apt-get install -y \
|
|
1568
|
+
pkg-config \
|
|
1569
|
+
libssl-dev \
|
|
1570
|
+
libpq-dev \
|
|
1571
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
1572
|
+
|
|
1573
|
+
# Copy dependency files
|
|
1574
|
+
COPY Cargo.toml Cargo.lock ./
|
|
1575
|
+
|
|
1576
|
+
# Build dependencies (cached layer)
|
|
1577
|
+
RUN mkdir src && \
|
|
1578
|
+
echo "fn main() {}" > src/main.rs && \
|
|
1579
|
+
cargo build --release && \
|
|
1580
|
+
rm -rf src
|
|
1581
|
+
|
|
1582
|
+
# Copy source code
|
|
1583
|
+
COPY src ./src
|
|
1584
|
+
COPY migrations ./migrations
|
|
1585
|
+
|
|
1586
|
+
# Build application
|
|
1587
|
+
RUN touch src/main.rs && \
|
|
1588
|
+
cargo build --release
|
|
1589
|
+
|
|
1590
|
+
# Runtime stage
|
|
1591
|
+
FROM debian:bookworm-slim
|
|
1592
|
+
|
|
1593
|
+
# Install runtime dependencies
|
|
1594
|
+
RUN apt-get update && apt-get install -y \
|
|
1595
|
+
ca-certificates \
|
|
1596
|
+
libssl3 \
|
|
1597
|
+
libpq5 \
|
|
1598
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
1599
|
+
|
|
1600
|
+
# Create app user
|
|
1601
|
+
RUN useradd -m -u 1001 app
|
|
1602
|
+
|
|
1603
|
+
WORKDIR /app
|
|
1604
|
+
|
|
1605
|
+
# Copy binary and migrations
|
|
1606
|
+
COPY --from=builder /app/target/release/task-management-api .
|
|
1607
|
+
COPY --from=builder /app/migrations ./migrations
|
|
1608
|
+
|
|
1609
|
+
# Create uploads directory
|
|
1610
|
+
RUN mkdir -p uploads && chown app:app uploads
|
|
1611
|
+
|
|
1612
|
+
# Switch to app user
|
|
1613
|
+
USER app
|
|
1614
|
+
|
|
1615
|
+
# Expose port
|
|
1616
|
+
EXPOSE 8080
|
|
1617
|
+
|
|
1618
|
+
# Health check
|
|
1619
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
1620
|
+
CMD curl -f http://localhost:8080/health || exit 1
|
|
1621
|
+
|
|
1622
|
+
# Run the application
|
|
1623
|
+
CMD ["./task-management-api"]
|
|
1624
|
+
```
|
|
1625
|
+
|
|
1626
|
+
**docker/docker-compose.yml:**
|
|
1627
|
+
```yaml
|
|
1628
|
+
# Production-ready Docker Compose setup
|
|
1629
|
+
version: '3.8'
|
|
1630
|
+
|
|
1631
|
+
services:
|
|
1632
|
+
api:
|
|
1633
|
+
build:
|
|
1634
|
+
context: ..
|
|
1635
|
+
dockerfile: docker/Dockerfile
|
|
1636
|
+
environment:
|
|
1637
|
+
APP_DATABASE_URL: postgres://taskmanager:${DB_PASSWORD}@db:5432/taskmanagement
|
|
1638
|
+
APP_REDIS_URL: redis://redis:6379
|
|
1639
|
+
APP_JWT_SECRET: ${JWT_SECRET}
|
|
1640
|
+
APP_SERVER_HOST: 0.0.0.0
|
|
1641
|
+
APP_SERVER_PORT: 8080
|
|
1642
|
+
RUST_LOG: info
|
|
1643
|
+
ports:
|
|
1644
|
+
- "8080:8080"
|
|
1645
|
+
- "9090:9090" # Metrics port
|
|
1646
|
+
depends_on:
|
|
1647
|
+
db:
|
|
1648
|
+
condition: service_healthy
|
|
1649
|
+
redis:
|
|
1650
|
+
condition: service_healthy
|
|
1651
|
+
restart: unless-stopped
|
|
1652
|
+
volumes:
|
|
1653
|
+
- uploads:/app/uploads
|
|
1654
|
+
networks:
|
|
1655
|
+
- app-network
|
|
1656
|
+
|
|
1657
|
+
db:
|
|
1658
|
+
image: postgres:15-alpine
|
|
1659
|
+
environment:
|
|
1660
|
+
POSTGRES_DB: taskmanagement
|
|
1661
|
+
POSTGRES_USER: taskmanager
|
|
1662
|
+
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
1663
|
+
volumes:
|
|
1664
|
+
- postgres_data:/var/lib/postgresql/data
|
|
1665
|
+
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
1666
|
+
healthcheck:
|
|
1667
|
+
test: ["CMD-SHELL", "pg_isready -U taskmanager -d taskmanagement"]
|
|
1668
|
+
interval: 10s
|
|
1669
|
+
timeout: 5s
|
|
1670
|
+
retries: 5
|
|
1671
|
+
restart: unless-stopped
|
|
1672
|
+
networks:
|
|
1673
|
+
- app-network
|
|
1674
|
+
|
|
1675
|
+
redis:
|
|
1676
|
+
image: redis:7-alpine
|
|
1677
|
+
command: redis-server --appendonly yes
|
|
1678
|
+
volumes:
|
|
1679
|
+
- redis_data:/data
|
|
1680
|
+
healthcheck:
|
|
1681
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
1682
|
+
interval: 10s
|
|
1683
|
+
timeout: 3s
|
|
1684
|
+
retries: 5
|
|
1685
|
+
restart: unless-stopped
|
|
1686
|
+
networks:
|
|
1687
|
+
- app-network
|
|
1688
|
+
|
|
1689
|
+
nginx:
|
|
1690
|
+
image: nginx:alpine
|
|
1691
|
+
ports:
|
|
1692
|
+
- "80:80"
|
|
1693
|
+
- "443:443"
|
|
1694
|
+
volumes:
|
|
1695
|
+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
1696
|
+
- ./ssl:/etc/nginx/ssl:ro
|
|
1697
|
+
- uploads:/app/uploads:ro
|
|
1698
|
+
depends_on:
|
|
1699
|
+
- api
|
|
1700
|
+
restart: unless-stopped
|
|
1701
|
+
networks:
|
|
1702
|
+
- app-network
|
|
1703
|
+
|
|
1704
|
+
prometheus:
|
|
1705
|
+
image: prom/prometheus:latest
|
|
1706
|
+
ports:
|
|
1707
|
+
- "9091:9090"
|
|
1708
|
+
volumes:
|
|
1709
|
+
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
1710
|
+
- prometheus_data:/prometheus
|
|
1711
|
+
command:
|
|
1712
|
+
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
1713
|
+
- '--storage.tsdb.path=/prometheus'
|
|
1714
|
+
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
|
1715
|
+
- '--web.console.templates=/etc/prometheus/consoles'
|
|
1716
|
+
restart: unless-stopped
|
|
1717
|
+
networks:
|
|
1718
|
+
- app-network
|
|
1719
|
+
|
|
1720
|
+
grafana:
|
|
1721
|
+
image: grafana/grafana:latest
|
|
1722
|
+
ports:
|
|
1723
|
+
- "3000:3000"
|
|
1724
|
+
environment:
|
|
1725
|
+
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
|
|
1726
|
+
volumes:
|
|
1727
|
+
- grafana_data:/var/lib/grafana
|
|
1728
|
+
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
|
|
1729
|
+
- ./grafana/datasources:/etc/grafana/provisioning/datasources:ro
|
|
1730
|
+
depends_on:
|
|
1731
|
+
- prometheus
|
|
1732
|
+
restart: unless-stopped
|
|
1733
|
+
networks:
|
|
1734
|
+
- app-network
|
|
1735
|
+
|
|
1736
|
+
volumes:
|
|
1737
|
+
postgres_data:
|
|
1738
|
+
redis_data:
|
|
1739
|
+
uploads:
|
|
1740
|
+
prometheus_data:
|
|
1741
|
+
grafana_data:
|
|
1742
|
+
|
|
1743
|
+
networks:
|
|
1744
|
+
app-network:
|
|
1745
|
+
driver: bridge
|
|
1746
|
+
```
|
|
1747
|
+
|
|
1748
|
+
### 2. CI/CD Pipeline
|
|
1749
|
+
|
|
1750
|
+
```yaml
|
|
1751
|
+
# .github/workflows/ci.yml - Generated by DevOps Engineer agent
|
|
1752
|
+
name: CI/CD Pipeline
|
|
1753
|
+
|
|
1754
|
+
on:
|
|
1755
|
+
push:
|
|
1756
|
+
branches: [ main, develop ]
|
|
1757
|
+
pull_request:
|
|
1758
|
+
branches: [ main ]
|
|
1759
|
+
|
|
1760
|
+
env:
|
|
1761
|
+
CARGO_TERM_COLOR: always
|
|
1762
|
+
RUST_BACKTRACE: 1
|
|
1763
|
+
|
|
1764
|
+
jobs:
|
|
1765
|
+
test:
|
|
1766
|
+
name: Test Suite
|
|
1767
|
+
runs-on: ubuntu-latest
|
|
1768
|
+
|
|
1769
|
+
services:
|
|
1770
|
+
postgres:
|
|
1771
|
+
image: postgres:15
|
|
1772
|
+
env:
|
|
1773
|
+
POSTGRES_PASSWORD: postgres
|
|
1774
|
+
POSTGRES_DB: taskmanagement_test
|
|
1775
|
+
options: >-
|
|
1776
|
+
--health-cmd pg_isready
|
|
1777
|
+
--health-interval 10s
|
|
1778
|
+
--health-timeout 5s
|
|
1779
|
+
--health-retries 5
|
|
1780
|
+
|
|
1781
|
+
redis:
|
|
1782
|
+
image: redis:7
|
|
1783
|
+
options: >-
|
|
1784
|
+
--health-cmd "redis-cli ping"
|
|
1785
|
+
--health-interval 10s
|
|
1786
|
+
--health-timeout 5s
|
|
1787
|
+
--health-retries 5
|
|
1788
|
+
|
|
1789
|
+
steps:
|
|
1790
|
+
- uses: actions/checkout@v4
|
|
1791
|
+
|
|
1792
|
+
- name: Install Rust
|
|
1793
|
+
uses: dtolnay/rust-toolchain@stable
|
|
1794
|
+
with:
|
|
1795
|
+
components: rustfmt, clippy
|
|
1796
|
+
|
|
1797
|
+
- name: Cache cargo registry
|
|
1798
|
+
uses: actions/cache@v3
|
|
1799
|
+
with:
|
|
1800
|
+
path: ~/.cargo/registry
|
|
1801
|
+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
1802
|
+
|
|
1803
|
+
- name: Install dependencies
|
|
1804
|
+
run: |
|
|
1805
|
+
sudo apt-get update
|
|
1806
|
+
sudo apt-get install -y libpq-dev
|
|
1807
|
+
|
|
1808
|
+
- name: Run claude-flow quality validation
|
|
1809
|
+
run: |
|
|
1810
|
+
npm install -g claude-flow@alpha
|
|
1811
|
+
npx claude-flow validate rust . --comprehensive
|
|
1812
|
+
|
|
1813
|
+
- name: Run tests
|
|
1814
|
+
env:
|
|
1815
|
+
TEST_DATABASE_URL: postgres://postgres:postgres@localhost/taskmanagement_test
|
|
1816
|
+
TEST_REDIS_URL: redis://localhost:6379
|
|
1817
|
+
run: cargo test --all-features --verbose
|
|
1818
|
+
|
|
1819
|
+
- name: Run integration tests
|
|
1820
|
+
env:
|
|
1821
|
+
TEST_DATABASE_URL: postgres://postgres:postgres@localhost/taskmanagement_test
|
|
1822
|
+
TEST_REDIS_URL: redis://localhost:6379
|
|
1823
|
+
run: cargo test --test integration --all-features
|
|
1824
|
+
|
|
1825
|
+
- name: Generate coverage report
|
|
1826
|
+
run: |
|
|
1827
|
+
cargo install cargo-tarpaulin
|
|
1828
|
+
cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
|
|
1829
|
+
|
|
1830
|
+
- name: Upload coverage to Codecov
|
|
1831
|
+
uses: codecov/codecov-action@v3
|
|
1832
|
+
|
|
1833
|
+
security:
|
|
1834
|
+
name: Security Audit
|
|
1835
|
+
runs-on: ubuntu-latest
|
|
1836
|
+
steps:
|
|
1837
|
+
- uses: actions/checkout@v4
|
|
1838
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
1839
|
+
- name: Security audit
|
|
1840
|
+
run: |
|
|
1841
|
+
cargo install cargo-audit
|
|
1842
|
+
cargo audit
|
|
1843
|
+
|
|
1844
|
+
benchmark:
|
|
1845
|
+
name: Performance Benchmarks
|
|
1846
|
+
runs-on: ubuntu-latest
|
|
1847
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
1848
|
+
|
|
1849
|
+
services:
|
|
1850
|
+
postgres:
|
|
1851
|
+
image: postgres:15
|
|
1852
|
+
env:
|
|
1853
|
+
POSTGRES_PASSWORD: postgres
|
|
1854
|
+
POSTGRES_DB: taskmanagement_bench
|
|
1855
|
+
options: >-
|
|
1856
|
+
--health-cmd pg_isready
|
|
1857
|
+
--health-interval 10s
|
|
1858
|
+
--health-timeout 5s
|
|
1859
|
+
--health-retries 5
|
|
1860
|
+
|
|
1861
|
+
steps:
|
|
1862
|
+
- uses: actions/checkout@v4
|
|
1863
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
1864
|
+
- name: Run benchmarks
|
|
1865
|
+
env:
|
|
1866
|
+
DATABASE_URL: postgres://postgres:postgres@localhost/taskmanagement_bench
|
|
1867
|
+
run: |
|
|
1868
|
+
cargo bench --all-features
|
|
1869
|
+
|
|
1870
|
+
- name: Store benchmark results
|
|
1871
|
+
uses: benchmark-action/github-action-benchmark@v1
|
|
1872
|
+
with:
|
|
1873
|
+
tool: 'cargo'
|
|
1874
|
+
output-file-path: target/criterion/report/benchmark.json
|
|
1875
|
+
|
|
1876
|
+
build-and-deploy:
|
|
1877
|
+
name: Build and Deploy
|
|
1878
|
+
runs-on: ubuntu-latest
|
|
1879
|
+
needs: [test, security]
|
|
1880
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
1881
|
+
|
|
1882
|
+
steps:
|
|
1883
|
+
- uses: actions/checkout@v4
|
|
1884
|
+
|
|
1885
|
+
- name: Set up Docker Buildx
|
|
1886
|
+
uses: docker/setup-buildx-action@v3
|
|
1887
|
+
|
|
1888
|
+
- name: Login to Container Registry
|
|
1889
|
+
uses: docker/login-action@v3
|
|
1890
|
+
with:
|
|
1891
|
+
registry: ghcr.io
|
|
1892
|
+
username: ${{ github.actor }}
|
|
1893
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
1894
|
+
|
|
1895
|
+
- name: Build and push Docker image
|
|
1896
|
+
uses: docker/build-push-action@v5
|
|
1897
|
+
with:
|
|
1898
|
+
context: .
|
|
1899
|
+
file: docker/Dockerfile
|
|
1900
|
+
push: true
|
|
1901
|
+
tags: |
|
|
1902
|
+
ghcr.io/${{ github.repository }}:latest
|
|
1903
|
+
ghcr.io/${{ github.repository }}:${{ github.sha }}
|
|
1904
|
+
cache-from: type=gha
|
|
1905
|
+
cache-to: type=gha,mode=max
|
|
1906
|
+
|
|
1907
|
+
- name: Deploy to staging
|
|
1908
|
+
run: |
|
|
1909
|
+
# Deploy to staging environment
|
|
1910
|
+
echo "Deploying to staging..."
|
|
1911
|
+
# Add deployment scripts here
|
|
1912
|
+
|
|
1913
|
+
- name: Run smoke tests
|
|
1914
|
+
run: |
|
|
1915
|
+
# Run smoke tests against staging
|
|
1916
|
+
npm install -g @apidevtools/swagger-parser
|
|
1917
|
+
npx swagger-parser validate docs/api-spec.yml
|
|
1918
|
+
```
|
|
1919
|
+
|
|
1920
|
+
This comprehensive REST API example demonstrates how claude-flow orchestrates multiple specialized agents to create a production-ready Rust application with real toolchain integration, comprehensive testing, and deployment automation.
|
|
1921
|
+
|
|
1922
|
+
## 🔗 Related Resources
|
|
1923
|
+
|
|
1924
|
+
- [Axum Framework Guide](../web-development/axum.md) - Detailed Axum development
|
|
1925
|
+
- [Quality Validation](../testing/quality-validation.md) - Code quality assurance
|
|
1926
|
+
- [Systems Programming](../workflows/systems-programming.md) - Advanced Rust patterns
|
|
1927
|
+
- [Performance Testing](../testing/performance.md) - Benchmarking and optimization
|