stringray-ai 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/.mcp.json +68 -0
- package/LICENSE +21 -0
- package/README.md +618 -0
- package/dist/agents/architect.d.ts +3 -0
- package/dist/agents/architect.d.ts.map +1 -0
- package/dist/agents/architect.js +84 -0
- package/dist/agents/architect.js.map +1 -0
- package/dist/agents/bug-triage-specialist.d.ts +3 -0
- package/dist/agents/bug-triage-specialist.d.ts.map +1 -0
- package/dist/agents/bug-triage-specialist.js +66 -0
- package/dist/agents/bug-triage-specialist.js.map +1 -0
- package/dist/agents/code-reviewer.d.ts +3 -0
- package/dist/agents/code-reviewer.d.ts.map +1 -0
- package/dist/agents/code-reviewer.js +66 -0
- package/dist/agents/code-reviewer.js.map +1 -0
- package/dist/agents/enforcer.d.ts +3 -0
- package/dist/agents/enforcer.d.ts.map +1 -0
- package/dist/agents/enforcer.js +109 -0
- package/dist/agents/enforcer.js.map +1 -0
- package/dist/agents/index.d.ts +15 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +26 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/librarian.d.ts +3 -0
- package/dist/agents/librarian.d.ts.map +1 -0
- package/dist/agents/librarian.js +70 -0
- package/dist/agents/librarian.js.map +1 -0
- package/dist/agents/log-monitor.d.ts +3 -0
- package/dist/agents/log-monitor.d.ts.map +1 -0
- package/dist/agents/log-monitor.js +102 -0
- package/dist/agents/log-monitor.js.map +1 -0
- package/dist/agents/orchestrator.d.ts +3 -0
- package/dist/agents/orchestrator.d.ts.map +1 -0
- package/dist/agents/orchestrator.js +85 -0
- package/dist/agents/orchestrator.js.map +1 -0
- package/dist/agents/refactorer.d.ts +3 -0
- package/dist/agents/refactorer.d.ts.map +1 -0
- package/dist/agents/refactorer.js +67 -0
- package/dist/agents/refactorer.js.map +1 -0
- package/dist/agents/security-auditor.d.ts +3 -0
- package/dist/agents/security-auditor.d.ts.map +1 -0
- package/dist/agents/security-auditor.js +66 -0
- package/dist/agents/security-auditor.js.map +1 -0
- package/dist/agents/sisyphus.d.ts +3 -0
- package/dist/agents/sisyphus.d.ts.map +1 -0
- package/dist/agents/sisyphus.js +53 -0
- package/dist/agents/sisyphus.js.map +1 -0
- package/dist/agents/test-architect.d.ts +3 -0
- package/dist/agents/test-architect.d.ts.map +1 -0
- package/dist/agents/test-architect.js +81 -0
- package/dist/agents/test-architect.js.map +1 -0
- package/dist/agents/types.d.ts +29 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/mcps/architect-tools.server.d.ts +40 -0
- package/dist/mcps/architect-tools.server.d.ts.map +1 -0
- package/dist/mcps/architect-tools.server.js +563 -0
- package/dist/mcps/architect-tools.server.js.map +1 -0
- package/dist/mcps/auto-format.server.d.ts +20 -0
- package/dist/mcps/auto-format.server.d.ts.map +1 -0
- package/dist/mcps/auto-format.server.js +391 -0
- package/dist/mcps/auto-format.server.js.map +1 -0
- package/dist/mcps/boot-orchestrator.server.d.ts +50 -0
- package/dist/mcps/boot-orchestrator.server.d.ts.map +1 -0
- package/dist/mcps/boot-orchestrator.server.js +871 -0
- package/dist/mcps/boot-orchestrator.server.js.map +1 -0
- package/dist/mcps/enforcer-tools.server.d.ts +26 -0
- package/dist/mcps/enforcer-tools.server.d.ts.map +1 -0
- package/dist/mcps/enforcer-tools.server.js +627 -0
- package/dist/mcps/enforcer-tools.server.js.map +1 -0
- package/dist/mcps/enhanced-orchestrator.server.d.ts +14 -0
- package/dist/mcps/enhanced-orchestrator.server.d.ts.map +1 -0
- package/dist/mcps/enhanced-orchestrator.server.js +250 -0
- package/dist/mcps/enhanced-orchestrator.server.js.map +1 -0
- package/dist/mcps/framework-compliance-audit.server.d.ts +23 -0
- package/dist/mcps/framework-compliance-audit.server.d.ts.map +1 -0
- package/dist/mcps/framework-compliance-audit.server.js +511 -0
- package/dist/mcps/framework-compliance-audit.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/api-design.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/api-design.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/api-design.server.js +120 -0
- package/dist/mcps/knowledge-skills/api-design.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js +110 -0
- package/dist/mcps/knowledge-skills/architecture-patterns.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/code-review.server.d.ts +32 -0
- package/dist/mcps/knowledge-skills/code-review.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/code-review.server.js +777 -0
- package/dist/mcps/knowledge-skills/code-review.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/database-design.server.d.ts +44 -0
- package/dist/mcps/knowledge-skills/database-design.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/database-design.server.js +818 -0
- package/dist/mcps/knowledge-skills/database-design.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts +44 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.js +1178 -0
- package/dist/mcps/knowledge-skills/devops-deployment.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.d.ts +48 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.js +1188 -0
- package/dist/mcps/knowledge-skills/documentation-generation.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.js +112 -0
- package/dist/mcps/knowledge-skills/git-workflow.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts +16 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.js +108 -0
- package/dist/mcps/knowledge-skills/performance-optimization.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts +34 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.js +710 -0
- package/dist/mcps/knowledge-skills/project-analysis.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts +34 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js +794 -0
- package/dist/mcps/knowledge-skills/refactoring-strategies.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts +34 -0
- package/dist/mcps/knowledge-skills/security-audit.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/security-audit.server.js +769 -0
- package/dist/mcps/knowledge-skills/security-audit.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts +37 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js +865 -0
- package/dist/mcps/knowledge-skills/testing-best-practices.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts +47 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.js +672 -0
- package/dist/mcps/knowledge-skills/testing-strategy.server.js.map +1 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts +42 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.d.ts.map +1 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js +1016 -0
- package/dist/mcps/knowledge-skills/ui-ux-design.server.js.map +1 -0
- package/dist/mcps/lint.server.d.ts +18 -0
- package/dist/mcps/lint.server.d.ts.map +1 -0
- package/dist/mcps/lint.server.js +334 -0
- package/dist/mcps/lint.server.js.map +1 -0
- package/dist/mcps/model-health-check.server.d.ts +17 -0
- package/dist/mcps/model-health-check.server.d.ts.map +1 -0
- package/dist/mcps/model-health-check.server.js +226 -0
- package/dist/mcps/model-health-check.server.js.map +1 -0
- package/dist/mcps/orchestrator.server.d.ts +39 -0
- package/dist/mcps/orchestrator.server.d.ts.map +1 -0
- package/dist/mcps/orchestrator.server.js +908 -0
- package/dist/mcps/orchestrator.server.js.map +1 -0
- package/dist/mcps/performance-analysis.server.d.ts +28 -0
- package/dist/mcps/performance-analysis.server.d.ts.map +1 -0
- package/dist/mcps/performance-analysis.server.js +514 -0
- package/dist/mcps/performance-analysis.server.js.map +1 -0
- package/dist/mcps/processor-pipeline.server.d.ts +29 -0
- package/dist/mcps/processor-pipeline.server.d.ts.map +1 -0
- package/dist/mcps/processor-pipeline.server.js +520 -0
- package/dist/mcps/processor-pipeline.server.js.map +1 -0
- package/dist/mcps/security-scan.server.d.ts +20 -0
- package/dist/mcps/security-scan.server.d.ts.map +1 -0
- package/dist/mcps/security-scan.server.js +404 -0
- package/dist/mcps/security-scan.server.js.map +1 -0
- package/dist/mcps/state-manager.server.d.ts +29 -0
- package/dist/mcps/state-manager.server.d.ts.map +1 -0
- package/dist/mcps/state-manager.server.js +620 -0
- package/dist/mcps/state-manager.server.js.map +1 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts +109 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js +337 -0
- package/dist/orchestrator/enhanced-multi-agent-orchestrator.js.map +1 -0
- package/dist/orchestrator/intelligent-commit-batcher.d.ts +112 -0
- package/dist/orchestrator/intelligent-commit-batcher.d.ts.map +1 -0
- package/dist/orchestrator/intelligent-commit-batcher.js +330 -0
- package/dist/orchestrator/intelligent-commit-batcher.js.map +1 -0
- package/dist/plugin/agents/architect.d.ts +3 -0
- package/dist/plugin/agents/architect.d.ts.map +1 -0
- package/dist/plugin/agents/architect.js +84 -0
- package/dist/plugin/agents/architect.js.map +1 -0
- package/dist/plugin/agents/bug-triage-specialist.d.ts +3 -0
- package/dist/plugin/agents/bug-triage-specialist.d.ts.map +1 -0
- package/dist/plugin/agents/bug-triage-specialist.js +66 -0
- package/dist/plugin/agents/bug-triage-specialist.js.map +1 -0
- package/dist/plugin/agents/code-reviewer.d.ts +3 -0
- package/dist/plugin/agents/code-reviewer.d.ts.map +1 -0
- package/dist/plugin/agents/code-reviewer.js +66 -0
- package/dist/plugin/agents/code-reviewer.js.map +1 -0
- package/dist/plugin/agents/enforcer.d.ts +3 -0
- package/dist/plugin/agents/enforcer.d.ts.map +1 -0
- package/dist/plugin/agents/enforcer.js +109 -0
- package/dist/plugin/agents/enforcer.js.map +1 -0
- package/dist/plugin/agents/index.d.ts +15 -0
- package/dist/plugin/agents/index.d.ts.map +1 -0
- package/dist/plugin/agents/index.js +26 -0
- package/dist/plugin/agents/index.js.map +1 -0
- package/dist/plugin/agents/librarian.d.ts +3 -0
- package/dist/plugin/agents/librarian.d.ts.map +1 -0
- package/dist/plugin/agents/librarian.js +70 -0
- package/dist/plugin/agents/librarian.js.map +1 -0
- package/dist/plugin/agents/log-monitor.d.ts +3 -0
- package/dist/plugin/agents/log-monitor.d.ts.map +1 -0
- package/dist/plugin/agents/log-monitor.js +102 -0
- package/dist/plugin/agents/log-monitor.js.map +1 -0
- package/dist/plugin/agents/orchestrator.d.ts +3 -0
- package/dist/plugin/agents/orchestrator.d.ts.map +1 -0
- package/dist/plugin/agents/orchestrator.js +85 -0
- package/dist/plugin/agents/orchestrator.js.map +1 -0
- package/dist/plugin/agents/refactorer.d.ts +3 -0
- package/dist/plugin/agents/refactorer.d.ts.map +1 -0
- package/dist/plugin/agents/refactorer.js +67 -0
- package/dist/plugin/agents/refactorer.js.map +1 -0
- package/dist/plugin/agents/security-auditor.d.ts +3 -0
- package/dist/plugin/agents/security-auditor.d.ts.map +1 -0
- package/dist/plugin/agents/security-auditor.js +66 -0
- package/dist/plugin/agents/security-auditor.js.map +1 -0
- package/dist/plugin/agents/sisyphus.d.ts +3 -0
- package/dist/plugin/agents/sisyphus.d.ts.map +1 -0
- package/dist/plugin/agents/sisyphus.js +53 -0
- package/dist/plugin/agents/sisyphus.js.map +1 -0
- package/dist/plugin/agents/test-architect.d.ts +3 -0
- package/dist/plugin/agents/test-architect.d.ts.map +1 -0
- package/dist/plugin/agents/test-architect.js +81 -0
- package/dist/plugin/agents/test-architect.js.map +1 -0
- package/dist/plugin/agents/types.d.ts +29 -0
- package/dist/plugin/agents/types.d.ts.map +1 -0
- package/dist/plugin/agents/types.js +2 -0
- package/dist/plugin/agents/types.js.map +1 -0
- package/dist/plugin/config-loader.d.ts +67 -0
- package/dist/plugin/config-loader.d.ts.map +1 -0
- package/dist/plugin/config-loader.js +125 -0
- package/dist/plugin/config-loader.js.map +1 -0
- package/dist/plugin/context-loader.d.ts +122 -0
- package/dist/plugin/context-loader.d.ts.map +1 -0
- package/dist/plugin/context-loader.js +273 -0
- package/dist/plugin/context-loader.js.map +1 -0
- package/dist/plugin/delegation/agent-delegator.d.ts +217 -0
- package/dist/plugin/delegation/agent-delegator.d.ts.map +1 -0
- package/dist/plugin/delegation/agent-delegator.js +928 -0
- package/dist/plugin/delegation/agent-delegator.js.map +1 -0
- package/dist/plugin/delegation/codebase-context-analyzer.d.ts +157 -0
- package/dist/plugin/delegation/codebase-context-analyzer.d.ts.map +1 -0
- package/dist/plugin/delegation/codebase-context-analyzer.js +1029 -0
- package/dist/plugin/delegation/codebase-context-analyzer.js.map +1 -0
- package/dist/plugin/delegation/complexity-analyzer.d.ts +61 -0
- package/dist/plugin/delegation/complexity-analyzer.d.ts.map +1 -0
- package/dist/plugin/delegation/complexity-analyzer.js +253 -0
- package/dist/plugin/delegation/complexity-analyzer.js.map +1 -0
- package/dist/plugin/enforcement/enforcer-tools.d.ts +62 -0
- package/dist/plugin/enforcement/enforcer-tools.d.ts.map +1 -0
- package/dist/plugin/enforcement/enforcer-tools.js +407 -0
- package/dist/plugin/enforcement/enforcer-tools.js.map +1 -0
- package/dist/plugin/enforcement/rule-enforcer.d.ts +171 -0
- package/dist/plugin/enforcement/rule-enforcer.d.ts.map +1 -0
- package/dist/plugin/enforcement/rule-enforcer.js +1342 -0
- package/dist/plugin/enforcement/rule-enforcer.js.map +1 -0
- package/dist/plugin/enforcement/test-auto-healing.d.ts +78 -0
- package/dist/plugin/enforcement/test-auto-healing.d.ts.map +1 -0
- package/dist/plugin/enforcement/test-auto-healing.js +318 -0
- package/dist/plugin/enforcement/test-auto-healing.js.map +1 -0
- package/dist/plugin/framework-logger.d.ts +20 -0
- package/dist/plugin/framework-logger.d.ts.map +1 -0
- package/dist/plugin/framework-logger.js +79 -0
- package/dist/plugin/framework-logger.js.map +1 -0
- package/dist/plugin/logging-config.d.ts +11 -0
- package/dist/plugin/logging-config.d.ts.map +1 -0
- package/dist/plugin/logging-config.js +44 -0
- package/dist/plugin/logging-config.js.map +1 -0
- package/dist/plugin/mcps/architect-tools.server.d.ts +40 -0
- package/dist/plugin/mcps/architect-tools.server.d.ts.map +1 -0
- package/dist/plugin/mcps/architect-tools.server.js +563 -0
- package/dist/plugin/mcps/architect-tools.server.js.map +1 -0
- package/dist/plugin/mcps/auto-format.server.d.ts +20 -0
- package/dist/plugin/mcps/auto-format.server.d.ts.map +1 -0
- package/dist/plugin/mcps/auto-format.server.js +391 -0
- package/dist/plugin/mcps/auto-format.server.js.map +1 -0
- package/dist/plugin/mcps/boot-orchestrator.server.d.ts +50 -0
- package/dist/plugin/mcps/boot-orchestrator.server.d.ts.map +1 -0
- package/dist/plugin/mcps/boot-orchestrator.server.js +871 -0
- package/dist/plugin/mcps/boot-orchestrator.server.js.map +1 -0
- package/dist/plugin/mcps/enforcer-tools.server.d.ts +26 -0
- package/dist/plugin/mcps/enforcer-tools.server.d.ts.map +1 -0
- package/dist/plugin/mcps/enforcer-tools.server.js +627 -0
- package/dist/plugin/mcps/enforcer-tools.server.js.map +1 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.d.ts +14 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.d.ts.map +1 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.js +250 -0
- package/dist/plugin/mcps/enhanced-orchestrator.server.js.map +1 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.d.ts +23 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.d.ts.map +1 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.js +511 -0
- package/dist/plugin/mcps/framework-compliance-audit.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.js +120 -0
- package/dist/plugin/mcps/knowledge-skills/api-design.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.js +110 -0
- package/dist/plugin/mcps/knowledge-skills/architecture-patterns.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.d.ts +32 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.js +777 -0
- package/dist/plugin/mcps/knowledge-skills/code-review.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.d.ts +44 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.js +818 -0
- package/dist/plugin/mcps/knowledge-skills/database-design.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.d.ts +44 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.js +1178 -0
- package/dist/plugin/mcps/knowledge-skills/devops-deployment.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.d.ts +48 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.js +1188 -0
- package/dist/plugin/mcps/knowledge-skills/documentation-generation.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.js +112 -0
- package/dist/plugin/mcps/knowledge-skills/git-workflow.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.d.ts +16 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.js +108 -0
- package/dist/plugin/mcps/knowledge-skills/performance-optimization.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.d.ts +34 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.js +710 -0
- package/dist/plugin/mcps/knowledge-skills/project-analysis.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.d.ts +34 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.js +794 -0
- package/dist/plugin/mcps/knowledge-skills/refactoring-strategies.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.d.ts +34 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.js +769 -0
- package/dist/plugin/mcps/knowledge-skills/security-audit.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.d.ts +37 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.js +865 -0
- package/dist/plugin/mcps/knowledge-skills/testing-best-practices.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.d.ts +47 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.js +672 -0
- package/dist/plugin/mcps/knowledge-skills/testing-strategy.server.js.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.d.ts +42 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.d.ts.map +1 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.js +1016 -0
- package/dist/plugin/mcps/knowledge-skills/ui-ux-design.server.js.map +1 -0
- package/dist/plugin/mcps/lint.server.d.ts +18 -0
- package/dist/plugin/mcps/lint.server.d.ts.map +1 -0
- package/dist/plugin/mcps/lint.server.js +334 -0
- package/dist/plugin/mcps/lint.server.js.map +1 -0
- package/dist/plugin/mcps/model-health-check.server.d.ts +17 -0
- package/dist/plugin/mcps/model-health-check.server.d.ts.map +1 -0
- package/dist/plugin/mcps/model-health-check.server.js +226 -0
- package/dist/plugin/mcps/model-health-check.server.js.map +1 -0
- package/dist/plugin/mcps/orchestrator.server.d.ts +39 -0
- package/dist/plugin/mcps/orchestrator.server.d.ts.map +1 -0
- package/dist/plugin/mcps/orchestrator.server.js +908 -0
- package/dist/plugin/mcps/orchestrator.server.js.map +1 -0
- package/dist/plugin/mcps/performance-analysis.server.d.ts +28 -0
- package/dist/plugin/mcps/performance-analysis.server.d.ts.map +1 -0
- package/dist/plugin/mcps/performance-analysis.server.js +514 -0
- package/dist/plugin/mcps/performance-analysis.server.js.map +1 -0
- package/dist/plugin/mcps/processor-pipeline.server.d.ts +29 -0
- package/dist/plugin/mcps/processor-pipeline.server.d.ts.map +1 -0
- package/dist/plugin/mcps/processor-pipeline.server.js +520 -0
- package/dist/plugin/mcps/processor-pipeline.server.js.map +1 -0
- package/dist/plugin/mcps/security-scan.server.d.ts +20 -0
- package/dist/plugin/mcps/security-scan.server.d.ts.map +1 -0
- package/dist/plugin/mcps/security-scan.server.js +404 -0
- package/dist/plugin/mcps/security-scan.server.js.map +1 -0
- package/dist/plugin/mcps/state-manager.server.d.ts +29 -0
- package/dist/plugin/mcps/state-manager.server.d.ts.map +1 -0
- package/dist/plugin/mcps/state-manager.server.js +620 -0
- package/dist/plugin/mcps/state-manager.server.js.map +1 -0
- package/dist/plugin/monitoring/advanced-profiler.d.ts +48 -0
- package/dist/plugin/monitoring/advanced-profiler.d.ts.map +1 -0
- package/dist/plugin/monitoring/advanced-profiler.js +216 -0
- package/dist/plugin/monitoring/advanced-profiler.js.map +1 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.d.ts +331 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.d.ts.map +1 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.js +797 -0
- package/dist/plugin/monitoring/enterprise-monitoring-system.js.map +1 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.d.ts +111 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.d.ts.map +1 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.js +339 -0
- package/dist/plugin/orchestrator/enhanced-multi-agent-orchestrator.js.map +1 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.d.ts +112 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.d.ts.map +1 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.js +330 -0
- package/dist/plugin/orchestrator/intelligent-commit-batcher.js.map +1 -0
- package/dist/plugin/orchestrator.d.ts +91 -0
- package/dist/plugin/orchestrator.d.ts.map +1 -0
- package/dist/plugin/orchestrator.js +444 -0
- package/dist/plugin/orchestrator.js.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.d.ts +108 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.d.ts.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.js +620 -0
- package/dist/plugin/plugins/marketplace/marketplace-service.js.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.d.ts +468 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.d.ts.map +1 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.js +11 -0
- package/dist/plugin/plugins/marketplace/marketplace-types.js.map +1 -0
- package/dist/plugin/plugins/plugin-system.d.ts +152 -0
- package/dist/plugin/plugins/plugin-system.d.ts.map +1 -0
- package/dist/plugin/plugins/plugin-system.js +405 -0
- package/dist/plugin/plugins/plugin-system.js.map +1 -0
- package/dist/plugin/plugins/stringray-codex-injection.d.ts +68 -0
- package/dist/plugin/plugins/stringray-codex-injection.d.ts.map +1 -0
- package/dist/plugin/plugins/stringray-codex-injection.js +225 -0
- package/dist/plugin/plugins/stringray-codex-injection.js.map +1 -0
- package/dist/plugin/plugins/strray-codex-injection.d.ts +68 -0
- package/dist/plugin/plugins/strray-codex-injection.d.ts.map +1 -0
- package/dist/plugin/plugins/strray-codex-injection.js +225 -0
- package/dist/plugin/plugins/strray-codex-injection.js.map +1 -0
- package/dist/plugin/processors/index.d.ts +12 -0
- package/dist/plugin/processors/index.d.ts.map +1 -0
- package/dist/plugin/processors/index.js +12 -0
- package/dist/plugin/processors/index.js.map +1 -0
- package/dist/plugin/processors/processor-manager.d.ts +113 -0
- package/dist/plugin/processors/processor-manager.d.ts.map +1 -0
- package/dist/plugin/processors/processor-manager.js +498 -0
- package/dist/plugin/processors/processor-manager.js.map +1 -0
- package/dist/plugin/processors/processor-types.d.ts +50 -0
- package/dist/plugin/processors/processor-types.d.ts.map +1 -0
- package/dist/plugin/processors/processor-types.js +10 -0
- package/dist/plugin/processors/processor-types.js.map +1 -0
- package/dist/plugin/processors/refactoring-logging-processor.d.ts +61 -0
- package/dist/plugin/processors/refactoring-logging-processor.d.ts.map +1 -0
- package/dist/plugin/processors/refactoring-logging-processor.js +257 -0
- package/dist/plugin/processors/refactoring-logging-processor.js.map +1 -0
- package/dist/plugin/reporting/framework-reporting-system.d.ts +157 -0
- package/dist/plugin/reporting/framework-reporting-system.d.ts.map +1 -0
- package/dist/plugin/reporting/framework-reporting-system.js +783 -0
- package/dist/plugin/reporting/framework-reporting-system.js.map +1 -0
- package/dist/plugin/security/security-hardening-system.d.ts +220 -0
- package/dist/plugin/security/security-hardening-system.d.ts.map +1 -0
- package/dist/plugin/security/security-hardening-system.js +605 -0
- package/dist/plugin/security/security-hardening-system.js.map +1 -0
- package/dist/plugin/state/context-providers.d.ts +5 -0
- package/dist/plugin/state/context-providers.d.ts.map +1 -0
- package/dist/plugin/state/context-providers.js +2 -0
- package/dist/plugin/state/context-providers.js.map +1 -0
- package/dist/plugin/state/index.d.ts +5 -0
- package/dist/plugin/state/index.d.ts.map +1 -0
- package/dist/plugin/state/index.js +8 -0
- package/dist/plugin/state/index.js.map +1 -0
- package/dist/plugin/state/state-manager.d.ts +29 -0
- package/dist/plugin/state/state-manager.d.ts.map +1 -0
- package/dist/plugin/state/state-manager.js +153 -0
- package/dist/plugin/state/state-manager.js.map +1 -0
- package/dist/plugin/state/state-types.d.ts +6 -0
- package/dist/plugin/state/state-types.d.ts.map +1 -0
- package/dist/plugin/state/state-types.js +2 -0
- package/dist/plugin/state/state-types.js.map +1 -0
- package/dist/plugin/utils/codex-parser.d.ts +62 -0
- package/dist/plugin/utils/codex-parser.d.ts.map +1 -0
- package/dist/plugin/utils/codex-parser.js +396 -0
- package/dist/plugin/utils/codex-parser.js.map +1 -0
- package/dist/plugin/utils/command-runner.d.ts +24 -0
- package/dist/plugin/utils/command-runner.d.ts.map +1 -0
- package/dist/plugin/utils/command-runner.js +44 -0
- package/dist/plugin/utils/command-runner.js.map +1 -0
- package/dist/plugin/utils/import-resolver.d.ts +55 -0
- package/dist/plugin/utils/import-resolver.d.ts.map +1 -0
- package/dist/plugin/utils/import-resolver.js +198 -0
- package/dist/plugin/utils/import-resolver.js.map +1 -0
- package/dist/plugin/utils/memory-pool.d.ts +90 -0
- package/dist/plugin/utils/memory-pool.d.ts.map +1 -0
- package/dist/plugin/utils/memory-pool.js +245 -0
- package/dist/plugin/utils/memory-pool.js.map +1 -0
- package/dist/plugin/utils/path-resolver.d.ts +49 -0
- package/dist/plugin/utils/path-resolver.d.ts.map +1 -0
- package/dist/plugin/utils/path-resolver.js +126 -0
- package/dist/plugin/utils/path-resolver.js.map +1 -0
- package/dist/plugin/utils/test-template-generator.d.ts +26 -0
- package/dist/plugin/utils/test-template-generator.d.ts.map +1 -0
- package/dist/plugin/utils/test-template-generator.js +178 -0
- package/dist/plugin/utils/test-template-generator.js.map +1 -0
- package/dist/processors/index.d.ts +12 -0
- package/dist/processors/index.d.ts.map +1 -0
- package/dist/processors/index.js +12 -0
- package/dist/processors/index.js.map +1 -0
- package/dist/processors/processor-manager.d.ts +113 -0
- package/dist/processors/processor-manager.d.ts.map +1 -0
- package/dist/processors/processor-manager.js +498 -0
- package/dist/processors/processor-manager.js.map +1 -0
- package/dist/processors/processor-types.d.ts +50 -0
- package/dist/processors/processor-types.d.ts.map +1 -0
- package/dist/processors/processor-types.js +10 -0
- package/dist/processors/processor-types.js.map +1 -0
- package/dist/processors/refactoring-logging-processor.d.ts +61 -0
- package/dist/processors/refactoring-logging-processor.d.ts.map +1 -0
- package/dist/processors/refactoring-logging-processor.js +257 -0
- package/dist/processors/refactoring-logging-processor.js.map +1 -0
- package/dist/state/context-providers.d.ts +5 -0
- package/dist/state/context-providers.d.ts.map +1 -0
- package/dist/state/context-providers.js +2 -0
- package/dist/state/context-providers.js.map +1 -0
- package/dist/state/index.d.ts +5 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +8 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/state-manager.d.ts +29 -0
- package/dist/state/state-manager.d.ts.map +1 -0
- package/dist/state/state-manager.js +153 -0
- package/dist/state/state-manager.js.map +1 -0
- package/dist/state/state-types.d.ts +6 -0
- package/dist/state/state-types.d.ts.map +1 -0
- package/dist/state/state-types.js +2 -0
- package/dist/state/state-types.js.map +1 -0
- package/dist/utils/codex-parser.d.ts +62 -0
- package/dist/utils/codex-parser.d.ts.map +1 -0
- package/dist/utils/codex-parser.js +396 -0
- package/dist/utils/codex-parser.js.map +1 -0
- package/dist/utils/command-runner.d.ts +24 -0
- package/dist/utils/command-runner.d.ts.map +1 -0
- package/dist/utils/command-runner.js +44 -0
- package/dist/utils/command-runner.js.map +1 -0
- package/dist/utils/import-resolver.d.ts +55 -0
- package/dist/utils/import-resolver.d.ts.map +1 -0
- package/dist/utils/import-resolver.js +198 -0
- package/dist/utils/import-resolver.js.map +1 -0
- package/dist/utils/memory-pool.d.ts +90 -0
- package/dist/utils/memory-pool.d.ts.map +1 -0
- package/dist/utils/memory-pool.js +245 -0
- package/dist/utils/memory-pool.js.map +1 -0
- package/dist/utils/path-resolver.d.ts +49 -0
- package/dist/utils/path-resolver.d.ts.map +1 -0
- package/dist/utils/path-resolver.js +126 -0
- package/dist/utils/path-resolver.js.map +1 -0
- package/dist/utils/test-template-generator.d.ts +26 -0
- package/dist/utils/test-template-generator.d.ts.map +1 -0
- package/dist/utils/test-template-generator.js +178 -0
- package/dist/utils/test-template-generator.js.map +1 -0
- package/package.json +138 -0
- package/scripts/analysis/analyze-context-awareness.ts +219 -0
- package/scripts/analysis/analyze-framework-usage.ts +208 -0
- package/scripts/analysis/analyzer-agent-runner.js +328 -0
- package/scripts/analysis/context-awareness-report.ts +250 -0
- package/scripts/analyze-imports.mjs +147 -0
- package/scripts/basic-security-audit.cjs +261 -0
- package/scripts/boot-check.cjs +188 -0
- package/scripts/build/check-syntax.sh +1 -0
- package/scripts/build/check-tsc.sh +1 -0
- package/scripts/build/check-types.sh +1 -0
- package/scripts/build/compile-single.sh +1 -0
- package/scripts/build/copy-plugin.sh +1 -0
- package/scripts/build/manual-build.sh +1 -0
- package/scripts/build/run-build-after-copy.sh +1 -0
- package/scripts/build/run-build-attempt.sh +1 -0
- package/scripts/build/run-build-errors-grep.sh +1 -0
- package/scripts/build/run-build-errors.sh +1 -0
- package/scripts/build/run-build-limited.sh +1 -0
- package/scripts/build/run-build-list.sh +1 -0
- package/scripts/build/run-build.sh +1 -0
- package/scripts/build/run-limited.sh +1 -0
- package/scripts/build/run-tsc-direct.sh +1 -0
- package/scripts/build/run-type-check.sh +1 -0
- package/scripts/build/run-typecheck.sh +1 -0
- package/scripts/build/test-build.sh +1 -0
- package/scripts/check-logs.sh +62 -0
- package/scripts/debug/debug-context-enhancement.ts +116 -0
- package/scripts/debug/debug-rules.mjs +23 -0
- package/scripts/demo/demo-clickable-monitoring.mjs +116 -0
- package/scripts/demo/profiling-demo.js +108 -0
- package/scripts/demo/profiling-demo.ts +126 -0
- package/scripts/demo/reporting-demonstration.ts +184 -0
- package/scripts/demo/reporting-examples.ts +105 -0
- package/scripts/dependency-scan.cjs +111 -0
- package/scripts/deploy-stringray-plugin.sh +323 -0
- package/scripts/disable-logging.sh +20 -0
- package/scripts/extract-framework.sh +405 -0
- package/scripts/fix-mcp-capabilities.js +83 -0
- package/scripts/framework/advanced-profiling-integration.sh +384 -0
- package/scripts/framework/check-agent-orchestration-health.sh +113 -0
- package/scripts/framework/enterprise-analysis-test.sh +174 -0
- package/scripts/framework/implement-analyzer-agent.sh +393 -0
- package/scripts/framework/merge-mcp-configs.sh +201 -0
- package/scripts/framework/validate-multi-agent-orchestration.sh +195 -0
- package/scripts/framework/validate-profiling.sh +64 -0
- package/scripts/github-actions-monitor.cjs +289 -0
- package/scripts/init.ts +121 -0
- package/scripts/monitoring/initialize-monitoring-pipeline.sh +89 -0
- package/scripts/monitoring/memory-dashboard.sh +52 -0
- package/scripts/monitoring/monitoring-daemon.mjs +67 -0
- package/scripts/monitoring/monitoring-daemon.sh +190 -0
- package/scripts/monitoring/profiling-dashboard.sh +69 -0
- package/scripts/performance-report.js +56 -0
- package/scripts/postinstall.cjs +240 -0
- package/scripts/profile-performance.sh +263 -0
- package/scripts/register-mcp-servers-fixed.sh +74 -0
- package/scripts/register-mcp-servers.sh +96 -0
- package/scripts/reporting/generate-phase1-report.js +28 -0
- package/scripts/reporting/run-postprocessor.js +59 -0
- package/scripts/reporting/trigger-report.js +15 -0
- package/scripts/run-simulations.mjs +29 -0
- package/scripts/scenario-data-processor.py +122 -0
- package/scripts/scenarios/scenario-security-check.ts +60 -0
- package/scripts/scenarios/scenario-user-management.ts +123 -0
- package/scripts/setup.cjs +128 -0
- package/scripts/simulation/run-simulations.js +84 -0
- package/scripts/simulation/simulate-full-orchestrator.ts +239 -0
- package/scripts/strray-triage.sh +349 -0
- package/scripts/test/run-memory-regression.sh +45 -0
- package/scripts/test/run-test.sh +2 -0
- package/scripts/test/test-deployment.sh +552 -0
- package/scripts/test/test-enhanced-report.ts +24 -0
- package/scripts/test/test-graceful-shutdown.sh +35 -0
- package/scripts/test/test-integration.mjs +79 -0
- package/scripts/test/test-manual-orchestration.sh +168 -0
- package/scripts/test/test-max-agents.sh +70 -0
- package/scripts/test/test-memory-monitor.sh +40 -0
- package/scripts/test/test-memory-pools.sh +58 -0
- package/scripts/test/test-module.ts +1 -0
- package/scripts/test/test-multi-agent-trigger.sh +251 -0
- package/scripts/test/test-orchestrator.txt +1 -0
- package/scripts/test/test-postinstall.js +1 -0
- package/scripts/test/test-security-module.ts +27 -0
- package/scripts/test/test-session-management.js +135 -0
- package/scripts/test/test-simulation.mjs +14 -0
- package/scripts/test/test-user-service.ts +111 -0
- package/scripts/test-comprehensive-path-resolution.mjs +62 -0
- package/scripts/test-data-processor.py +51 -0
- package/scripts/test-enforcement-e2e.mjs +127 -0
- package/scripts/test-full-plugin-no-timeout.sh +30 -0
- package/scripts/test-path-resolver.mjs +32 -0
- package/scripts/test-rules.mjs +128 -0
- package/scripts/test-stringray-plugin.mjs +66 -0
- package/scripts/test-utils/smart-test-runner.mjs +609 -0
- package/scripts/test-utils/test-quarantine.mjs +246 -0
- package/scripts/validate-codex.js +60 -0
- package/scripts/validate-phase1.mjs +189 -0
- package/scripts/validation/run-validators.js +114 -0
- package/scripts/validation/validate-external-processes.js +240 -0
- package/scripts/validation/validate-mcp-connectivity.js +165 -0
- package/scripts/validation/validate-oh-my-opencode-integration.js +200 -0
- package/scripts/validation/validate-reports.ts +114 -0
- package/scripts/verify-phase1.js +144 -0
|
@@ -0,0 +1,908 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StrRay Orchestrator MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Enterprise-grade orchestration with advanced task management and agent coordination
|
|
5
|
+
*/
|
|
6
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
7
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
8
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
+
class StrRayOrchestratorServer {
|
|
10
|
+
server;
|
|
11
|
+
activeTasks = new Map();
|
|
12
|
+
taskHistory = [];
|
|
13
|
+
agentCapabilities = new Map();
|
|
14
|
+
constructor() {
|
|
15
|
+
this.server = new Server({
|
|
16
|
+
name: "strray-orchestrator",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
}, {
|
|
19
|
+
capabilities: {
|
|
20
|
+
tools: {},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
this.initializeAgentCapabilities();
|
|
24
|
+
this.setupToolHandlers();
|
|
25
|
+
console.log("StringRay Orchestrator MCP Server initialized");
|
|
26
|
+
}
|
|
27
|
+
initializeAgentCapabilities() {
|
|
28
|
+
// Initialize agent capabilities for orchestration decisions
|
|
29
|
+
this.agentCapabilities.set("enforcer", {
|
|
30
|
+
capabilities: ["validation", "security", "compliance"],
|
|
31
|
+
complexityThreshold: 25,
|
|
32
|
+
concurrentTasks: 3,
|
|
33
|
+
});
|
|
34
|
+
this.agentCapabilities.set("architect", {
|
|
35
|
+
capabilities: ["design", "planning", "system-thinking"],
|
|
36
|
+
complexityThreshold: 50,
|
|
37
|
+
concurrentTasks: 2,
|
|
38
|
+
});
|
|
39
|
+
this.agentCapabilities.set("code-reviewer", {
|
|
40
|
+
capabilities: ["analysis", "quality", "validation"],
|
|
41
|
+
complexityThreshold: 30,
|
|
42
|
+
concurrentTasks: 4,
|
|
43
|
+
});
|
|
44
|
+
this.agentCapabilities.set("orchestrator", {
|
|
45
|
+
capabilities: ["coordination", "management", "optimization"],
|
|
46
|
+
complexityThreshold: 95,
|
|
47
|
+
concurrentTasks: 1,
|
|
48
|
+
});
|
|
49
|
+
this.agentCapabilities.set("bug-triage-specialist", {
|
|
50
|
+
capabilities: ["debugging", "investigation", "fixing"],
|
|
51
|
+
complexityThreshold: 40,
|
|
52
|
+
concurrentTasks: 2,
|
|
53
|
+
});
|
|
54
|
+
this.agentCapabilities.set("security-auditor", {
|
|
55
|
+
capabilities: ["security", "vulnerability", "audit"],
|
|
56
|
+
complexityThreshold: 35,
|
|
57
|
+
concurrentTasks: 2,
|
|
58
|
+
});
|
|
59
|
+
this.agentCapabilities.set("refactorer", {
|
|
60
|
+
capabilities: ["optimization", "maintenance", "improvement"],
|
|
61
|
+
complexityThreshold: 45,
|
|
62
|
+
concurrentTasks: 1,
|
|
63
|
+
});
|
|
64
|
+
this.agentCapabilities.set("test-architect", {
|
|
65
|
+
capabilities: ["testing", "coverage", "validation"],
|
|
66
|
+
complexityThreshold: 38,
|
|
67
|
+
concurrentTasks: 3,
|
|
68
|
+
});
|
|
69
|
+
this.agentCapabilities.set("log-monitor", {
|
|
70
|
+
capabilities: ["monitoring", "analysis", "alerting"],
|
|
71
|
+
complexityThreshold: 20,
|
|
72
|
+
concurrentTasks: 5,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
setupToolHandlers() {
|
|
76
|
+
// List available tools
|
|
77
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
78
|
+
return {
|
|
79
|
+
tools: [
|
|
80
|
+
{
|
|
81
|
+
name: "orchestrate-task",
|
|
82
|
+
description: "Execute complex multi-step tasks with intelligent agent delegation and progress tracking",
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
description: { type: "string" },
|
|
87
|
+
tasks: {
|
|
88
|
+
type: "array",
|
|
89
|
+
items: {
|
|
90
|
+
type: "object",
|
|
91
|
+
properties: {
|
|
92
|
+
id: { type: "string" },
|
|
93
|
+
description: { type: "string" },
|
|
94
|
+
type: { type: "string" },
|
|
95
|
+
priority: {
|
|
96
|
+
type: "string",
|
|
97
|
+
enum: ["critical", "high", "medium", "low"],
|
|
98
|
+
default: "medium",
|
|
99
|
+
},
|
|
100
|
+
dependencies: {
|
|
101
|
+
type: "array",
|
|
102
|
+
items: { type: "string" },
|
|
103
|
+
},
|
|
104
|
+
estimatedComplexity: {
|
|
105
|
+
type: "number",
|
|
106
|
+
minimum: 1,
|
|
107
|
+
maximum: 100,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
required: ["id", "description", "type"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
sessionId: { type: "string" },
|
|
114
|
+
executionMode: {
|
|
115
|
+
type: "string",
|
|
116
|
+
enum: ["parallel", "sequential", "optimized"],
|
|
117
|
+
default: "optimized",
|
|
118
|
+
},
|
|
119
|
+
timeout: { type: "number", default: 300000 }, // 5 minutes
|
|
120
|
+
},
|
|
121
|
+
required: ["description", "tasks"],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "analyze-complexity",
|
|
126
|
+
description: "Analyze task complexity and recommend optimal orchestration strategy",
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: {
|
|
130
|
+
tasks: {
|
|
131
|
+
type: "array",
|
|
132
|
+
items: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
description: { type: "string" },
|
|
136
|
+
type: { type: "string" },
|
|
137
|
+
files: { type: "array", items: { type: "string" } },
|
|
138
|
+
dependencies: { type: "number" },
|
|
139
|
+
riskLevel: {
|
|
140
|
+
type: "string",
|
|
141
|
+
enum: ["low", "medium", "high", "critical"],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
required: ["tasks"],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "get-orchestration-status",
|
|
152
|
+
description: "Get comprehensive status of active orchestrations and agent utilization",
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {
|
|
156
|
+
sessionId: { type: "string" },
|
|
157
|
+
detailed: { type: "boolean", default: false },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "cancel-orchestration",
|
|
163
|
+
description: "Cancel active orchestration tasks with cleanup",
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {
|
|
167
|
+
sessionId: { type: "string" },
|
|
168
|
+
taskId: { type: "string" },
|
|
169
|
+
force: { type: "boolean", default: false },
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "optimize-orchestration",
|
|
175
|
+
description: "Analyze and optimize orchestration patterns for better performance",
|
|
176
|
+
inputSchema: {
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
history: { type: "boolean", default: true },
|
|
180
|
+
recommendations: { type: "boolean", default: true },
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
// Handle tool calls
|
|
188
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
189
|
+
const { name, arguments: args } = request.params;
|
|
190
|
+
switch (name) {
|
|
191
|
+
case "orchestrate-task":
|
|
192
|
+
return await this.handleOrchestrateTask(args);
|
|
193
|
+
case "analyze-complexity":
|
|
194
|
+
return await this.handleAnalyzeComplexity(args);
|
|
195
|
+
case "get-orchestration-status":
|
|
196
|
+
return await this.handleGetOrchestrationStatus(args);
|
|
197
|
+
case "cancel-orchestration":
|
|
198
|
+
return await this.handleCancelOrchestration(args);
|
|
199
|
+
case "optimize-orchestration":
|
|
200
|
+
return await this.handleOptimizeOrchestration(args);
|
|
201
|
+
default:
|
|
202
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
async handleOrchestrateTask(args) {
|
|
207
|
+
const description = args.description;
|
|
208
|
+
const tasks = args.tasks || [];
|
|
209
|
+
const sessionId = args.sessionId || `session_${Date.now()}`;
|
|
210
|
+
const executionMode = args.executionMode || "optimized";
|
|
211
|
+
const timeout = args.timeout || 300000;
|
|
212
|
+
console.log("🎯 MCP: Orchestrating complex task:", {
|
|
213
|
+
description,
|
|
214
|
+
taskCount: tasks.length,
|
|
215
|
+
sessionId,
|
|
216
|
+
executionMode,
|
|
217
|
+
});
|
|
218
|
+
const orchestrationResult = {
|
|
219
|
+
sessionId,
|
|
220
|
+
success: false,
|
|
221
|
+
completedTasks: 0,
|
|
222
|
+
failedTasks: 0,
|
|
223
|
+
duration: 0,
|
|
224
|
+
agentUtilization: {},
|
|
225
|
+
bottlenecks: [],
|
|
226
|
+
recommendations: [],
|
|
227
|
+
};
|
|
228
|
+
const startTime = Date.now();
|
|
229
|
+
try {
|
|
230
|
+
// Validate tasks
|
|
231
|
+
const validation = this.validateTasks(tasks);
|
|
232
|
+
if (!validation.valid) {
|
|
233
|
+
throw new Error(`Task validation failed: ${validation.errors.join(", ")}`);
|
|
234
|
+
}
|
|
235
|
+
// Analyze complexity and create execution plan
|
|
236
|
+
const executionPlan = await this.createExecutionPlan(tasks, executionMode);
|
|
237
|
+
// Execute orchestration
|
|
238
|
+
const results = await this.executeOrchestrationPlan(executionPlan, sessionId, timeout);
|
|
239
|
+
// Update result
|
|
240
|
+
orchestrationResult.success = results.success;
|
|
241
|
+
orchestrationResult.completedTasks = results.completedTasks;
|
|
242
|
+
orchestrationResult.failedTasks = results.failedTasks;
|
|
243
|
+
orchestrationResult.agentUtilization = results.agentUtilization;
|
|
244
|
+
orchestrationResult.bottlenecks = results.bottlenecks;
|
|
245
|
+
orchestrationResult.recommendations = results.recommendations;
|
|
246
|
+
// Store in history
|
|
247
|
+
this.taskHistory.push({
|
|
248
|
+
sessionId,
|
|
249
|
+
description,
|
|
250
|
+
tasks: tasks.length,
|
|
251
|
+
result: orchestrationResult,
|
|
252
|
+
timestamp: new Date().toISOString(),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
orchestrationResult.recommendations.push(`Orchestration error: ${error instanceof Error ? error.message : String(error)}`);
|
|
257
|
+
}
|
|
258
|
+
orchestrationResult.duration = Date.now() - startTime;
|
|
259
|
+
const response = `🎯 Orchestration Complete: "${description}"
|
|
260
|
+
|
|
261
|
+
**Session ID:** ${sessionId}
|
|
262
|
+
**Success:** ${orchestrationResult.success ? "✅ COMPLETED" : "❌ FAILED"}
|
|
263
|
+
**Duration:** ${orchestrationResult.duration}ms
|
|
264
|
+
**Tasks:** ${orchestrationResult.completedTasks + orchestrationResult.failedTasks} total
|
|
265
|
+
- ✅ Completed: ${orchestrationResult.completedTasks}
|
|
266
|
+
- ❌ Failed: ${orchestrationResult.failedTasks}
|
|
267
|
+
|
|
268
|
+
**Agent Utilization:**
|
|
269
|
+
${Object.entries(orchestrationResult.agentUtilization)
|
|
270
|
+
.map(([agent, count]) => `• ${agent}: ${count} tasks`)
|
|
271
|
+
.join("\n")}
|
|
272
|
+
|
|
273
|
+
${orchestrationResult.bottlenecks.length > 0 ? `**Bottlenecks Detected:**\n${orchestrationResult.bottlenecks.map((b) => `• 🚧 ${b}`).join("\n")}\n` : ""}
|
|
274
|
+
**Recommendations:**
|
|
275
|
+
${orchestrationResult.recommendations.length > 0 ? orchestrationResult.recommendations.map((r) => `• 💡 ${r}`).join("\n") : "No recommendations"}
|
|
276
|
+
|
|
277
|
+
**Execution Mode:** ${executionMode}
|
|
278
|
+
**Status:** ${orchestrationResult.success ? "🟢 SUCCESS" : "🔴 ISSUES DETECTED"}`;
|
|
279
|
+
return {
|
|
280
|
+
content: [{ type: "text", text: response }],
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
async handleAnalyzeComplexity(args) {
|
|
284
|
+
const tasks = args.tasks || [];
|
|
285
|
+
console.log("🔍 MCP: Analyzing task complexity:", {
|
|
286
|
+
taskCount: tasks.length,
|
|
287
|
+
});
|
|
288
|
+
try {
|
|
289
|
+
const analysis = await this.analyzeTaskComplexity(tasks);
|
|
290
|
+
const recommendations = this.generateComplexityRecommendations(analysis);
|
|
291
|
+
return {
|
|
292
|
+
content: [
|
|
293
|
+
{
|
|
294
|
+
type: "text",
|
|
295
|
+
text: `🔍 Complexity Analysis Results
|
|
296
|
+
|
|
297
|
+
**Tasks Analyzed:** ${tasks.length}
|
|
298
|
+
**Overall Complexity:** ${analysis.overallComplexity}/100
|
|
299
|
+
**Recommended Strategy:** ${analysis.recommendedStrategy}
|
|
300
|
+
|
|
301
|
+
**Complexity Breakdown:**
|
|
302
|
+
${analysis.taskComplexity
|
|
303
|
+
.map((task, index) => `• Task ${index + 1}: ${task.complexity}/100 (${task.category})`)
|
|
304
|
+
.join("\n")}
|
|
305
|
+
|
|
306
|
+
**Agent Assignments:**
|
|
307
|
+
${analysis.agentAssignments
|
|
308
|
+
.map((assignment) => `• ${assignment.agent}: ${assignment.taskCount} tasks (${assignment.utilization}%)`)
|
|
309
|
+
.join("\n")}
|
|
310
|
+
|
|
311
|
+
**Recommendations:**
|
|
312
|
+
${recommendations.map((r) => `• 💡 ${r}`).join("\n")}
|
|
313
|
+
|
|
314
|
+
**Execution Estimate:** ${analysis.estimatedDuration}ms
|
|
315
|
+
**Parallel Potential:** ${Math.round(analysis.parallelPotential * 100)}%`,
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
return {
|
|
322
|
+
content: [
|
|
323
|
+
{
|
|
324
|
+
type: "text",
|
|
325
|
+
text: `❌ Complexity analysis failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
async handleGetOrchestrationStatus(args) {
|
|
332
|
+
const sessionId = args.sessionId;
|
|
333
|
+
const detailed = args.detailed || false;
|
|
334
|
+
console.log("📊 MCP: Getting orchestration status:", {
|
|
335
|
+
sessionId,
|
|
336
|
+
detailed,
|
|
337
|
+
});
|
|
338
|
+
try {
|
|
339
|
+
let status;
|
|
340
|
+
if (sessionId) {
|
|
341
|
+
status = this.activeTasks.get(sessionId);
|
|
342
|
+
if (!status) {
|
|
343
|
+
// Check history
|
|
344
|
+
const historyItem = this.taskHistory.find((h) => h.sessionId === sessionId);
|
|
345
|
+
if (historyItem) {
|
|
346
|
+
status = { completed: true, ...historyItem.result };
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
return {
|
|
350
|
+
content: [
|
|
351
|
+
{
|
|
352
|
+
type: "text",
|
|
353
|
+
text: `❌ Session not found: ${sessionId}`,
|
|
354
|
+
},
|
|
355
|
+
],
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
// Overall status
|
|
362
|
+
status = this.getOverallOrchestrationStatus();
|
|
363
|
+
}
|
|
364
|
+
const response = this.formatOrchestrationStatus(status, detailed);
|
|
365
|
+
return {
|
|
366
|
+
content: [{ type: "text", text: response }],
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
return {
|
|
371
|
+
content: [
|
|
372
|
+
{
|
|
373
|
+
type: "text",
|
|
374
|
+
text: `❌ Status check failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
375
|
+
},
|
|
376
|
+
],
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
async handleCancelOrchestration(args) {
|
|
381
|
+
const sessionId = args.sessionId;
|
|
382
|
+
const taskId = args.taskId;
|
|
383
|
+
const force = args.force || false;
|
|
384
|
+
console.log("🛑 MCP: Cancelling orchestration:", {
|
|
385
|
+
sessionId,
|
|
386
|
+
taskId,
|
|
387
|
+
force,
|
|
388
|
+
});
|
|
389
|
+
try {
|
|
390
|
+
let cancelled = false;
|
|
391
|
+
let cleanupResults = "";
|
|
392
|
+
if (sessionId && taskId) {
|
|
393
|
+
// Cancel specific task
|
|
394
|
+
const session = this.activeTasks.get(sessionId);
|
|
395
|
+
if (session && session.tasks[taskId]) {
|
|
396
|
+
cancelled = await this.cancelSpecificTask(sessionId, taskId, force);
|
|
397
|
+
cleanupResults = `Task ${taskId} cancelled`;
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
return {
|
|
401
|
+
content: [
|
|
402
|
+
{
|
|
403
|
+
type: "text",
|
|
404
|
+
text: `❌ Task not found: ${sessionId}/${taskId}`,
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
else if (sessionId) {
|
|
411
|
+
// Cancel entire session
|
|
412
|
+
cancelled = await this.cancelSession(sessionId, force);
|
|
413
|
+
cleanupResults = `Session ${sessionId} cancelled`;
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
return {
|
|
417
|
+
content: [
|
|
418
|
+
{
|
|
419
|
+
type: "text",
|
|
420
|
+
text: `❌ Must specify either sessionId or both sessionId and taskId`,
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
if (!cancelled && !force) {
|
|
426
|
+
return {
|
|
427
|
+
content: [
|
|
428
|
+
{
|
|
429
|
+
type: "text",
|
|
430
|
+
text: `⚠️ Cancellation blocked - use force=true to override`,
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
content: [
|
|
437
|
+
{
|
|
438
|
+
type: "text",
|
|
439
|
+
text: `🛑 Orchestration Cancelled\n**Status:** ${cancelled ? "✅ SUCCESS" : "❌ FAILED"}\n**Cleanup:** ${cleanupResults}\n**Force Used:** ${force}`,
|
|
440
|
+
},
|
|
441
|
+
],
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
return {
|
|
446
|
+
content: [
|
|
447
|
+
{
|
|
448
|
+
type: "text",
|
|
449
|
+
text: `❌ Cancellation failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
async handleOptimizeOrchestration(args) {
|
|
456
|
+
const includeHistory = args.history !== false;
|
|
457
|
+
const includeRecommendations = args.recommendations !== false;
|
|
458
|
+
console.log("⚡ MCP: Optimizing orchestration patterns:", {
|
|
459
|
+
includeHistory,
|
|
460
|
+
includeRecommendations,
|
|
461
|
+
});
|
|
462
|
+
try {
|
|
463
|
+
const optimizationResults = await this.analyzeOrchestrationPatterns(includeHistory);
|
|
464
|
+
let response = `⚡ Orchestration Optimization Analysis
|
|
465
|
+
|
|
466
|
+
**Analysis Period:** ${includeHistory ? "Full History" : "Current Session"}
|
|
467
|
+
**Total Orchestrations:** ${optimizationResults.totalOrchestrations}
|
|
468
|
+
**Average Success Rate:** ${optimizationResults.averageSuccessRate}%
|
|
469
|
+
|
|
470
|
+
**Performance Metrics:**
|
|
471
|
+
• Average Duration: ${optimizationResults.averageDuration}ms
|
|
472
|
+
• Peak Agent Utilization: ${optimizationResults.peakUtilization}%
|
|
473
|
+
• Bottleneck Frequency: ${optimizationResults.bottleneckFrequency}%
|
|
474
|
+
|
|
475
|
+
**Common Patterns:**
|
|
476
|
+
${optimizationResults.commonPatterns.map((p) => `• ${p.pattern}: ${p.frequency}%`).join("\n")}
|
|
477
|
+
|
|
478
|
+
**Agent Efficiency:**
|
|
479
|
+
${optimizationResults.agentEfficiency.map((a) => `• ${a.agent}: ${a.efficiency}% (${a.taskCount} tasks)`).join("\n")}`;
|
|
480
|
+
if (includeRecommendations) {
|
|
481
|
+
response += `\n\n**Optimization Recommendations:**
|
|
482
|
+
${optimizationResults.recommendations.map((r) => `• 💡 ${r}`).join("\n")}
|
|
483
|
+
|
|
484
|
+
**Predicted Improvements:**
|
|
485
|
+
${optimizationResults.predictedImprovements.map((i) => `• 📈 ${i.metric}: ${i.improvement}%`).join("\n")}`;
|
|
486
|
+
}
|
|
487
|
+
return {
|
|
488
|
+
content: [{ type: "text", text: response }],
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
catch (error) {
|
|
492
|
+
return {
|
|
493
|
+
content: [
|
|
494
|
+
{
|
|
495
|
+
type: "text",
|
|
496
|
+
text: `❌ Optimization analysis failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
validateTasks(tasks) {
|
|
503
|
+
const errors = [];
|
|
504
|
+
if (!Array.isArray(tasks) || tasks.length === 0) {
|
|
505
|
+
errors.push("Tasks must be a non-empty array");
|
|
506
|
+
return { valid: false, errors };
|
|
507
|
+
}
|
|
508
|
+
for (let i = 0; i < tasks.length; i++) {
|
|
509
|
+
const task = tasks[i];
|
|
510
|
+
if (!task.id || !task.description || !task.type) {
|
|
511
|
+
errors.push(`Task ${i + 1}: missing required fields (id, description, type)`);
|
|
512
|
+
}
|
|
513
|
+
if (task.dependencies && !Array.isArray(task.dependencies)) {
|
|
514
|
+
errors.push(`Task ${i + 1}: dependencies must be an array`);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return { valid: errors.length === 0, errors };
|
|
518
|
+
}
|
|
519
|
+
async createExecutionPlan(tasks, executionMode) {
|
|
520
|
+
const plan = {
|
|
521
|
+
mode: executionMode,
|
|
522
|
+
phases: [],
|
|
523
|
+
agentAssignments: {},
|
|
524
|
+
estimatedDuration: 0,
|
|
525
|
+
resourceRequirements: {},
|
|
526
|
+
};
|
|
527
|
+
// Analyze task dependencies and create phases
|
|
528
|
+
const taskMap = new Map(tasks.map((t) => [t.id, t]));
|
|
529
|
+
const completed = new Set();
|
|
530
|
+
const phases = [];
|
|
531
|
+
while (completed.size < tasks.length) {
|
|
532
|
+
const phase = [];
|
|
533
|
+
for (const task of tasks) {
|
|
534
|
+
if (completed.has(task.id))
|
|
535
|
+
continue;
|
|
536
|
+
const dependencies = task.dependencies || [];
|
|
537
|
+
if (dependencies.every((dep) => completed.has(dep))) {
|
|
538
|
+
phase.push(task);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (phase.length === 0) {
|
|
542
|
+
throw new Error("Circular dependency detected in tasks");
|
|
543
|
+
}
|
|
544
|
+
phases.push(phase);
|
|
545
|
+
phase.forEach((t) => completed.add(t.id));
|
|
546
|
+
}
|
|
547
|
+
plan.phases = phases;
|
|
548
|
+
// Assign agents based on task types and complexity
|
|
549
|
+
for (const phase of phases) {
|
|
550
|
+
for (const task of phase) {
|
|
551
|
+
const agent = this.selectAgentForTask(task);
|
|
552
|
+
if (!plan.agentAssignments[agent]) {
|
|
553
|
+
plan.agentAssignments[agent] = [];
|
|
554
|
+
}
|
|
555
|
+
plan.agentAssignments[agent].push(task);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
// Calculate resource requirements
|
|
559
|
+
for (const [agent, agentTasks] of Object.entries(plan.agentAssignments)) {
|
|
560
|
+
const capability = this.agentCapabilities.get(agent);
|
|
561
|
+
plan.resourceRequirements[agent] = Math.min(agentTasks.length, capability?.concurrentTasks || 1);
|
|
562
|
+
}
|
|
563
|
+
// Estimate duration
|
|
564
|
+
plan.estimatedDuration = this.estimateExecutionDuration(plan);
|
|
565
|
+
return plan;
|
|
566
|
+
}
|
|
567
|
+
selectAgentForTask(task) {
|
|
568
|
+
// Simple agent selection based on task type
|
|
569
|
+
const typeMappings = {
|
|
570
|
+
validation: ["enforcer", "code-reviewer"],
|
|
571
|
+
security: ["security-auditor", "enforcer"],
|
|
572
|
+
design: ["architect"],
|
|
573
|
+
testing: ["test-architect"],
|
|
574
|
+
debugging: ["bug-triage-specialist"],
|
|
575
|
+
optimization: ["refactorer"],
|
|
576
|
+
monitoring: ["log-monitor"],
|
|
577
|
+
coordination: ["orchestrator"],
|
|
578
|
+
};
|
|
579
|
+
const candidates = typeMappings[task.type] || ["enforcer"];
|
|
580
|
+
const complexity = task.estimatedComplexity || 25;
|
|
581
|
+
// Select agent with appropriate complexity threshold
|
|
582
|
+
for (const candidate of candidates) {
|
|
583
|
+
const capability = this.agentCapabilities.get(candidate);
|
|
584
|
+
if (capability && complexity <= capability.complexityThreshold) {
|
|
585
|
+
return candidate;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return candidates[0] || "enforcer";
|
|
589
|
+
}
|
|
590
|
+
async executeOrchestrationPlan(plan, sessionId, timeout) {
|
|
591
|
+
const results = {
|
|
592
|
+
success: true,
|
|
593
|
+
completedTasks: 0,
|
|
594
|
+
failedTasks: 0,
|
|
595
|
+
agentUtilization: {},
|
|
596
|
+
bottlenecks: [],
|
|
597
|
+
recommendations: [],
|
|
598
|
+
};
|
|
599
|
+
const session = {
|
|
600
|
+
sessionId,
|
|
601
|
+
plan,
|
|
602
|
+
startTime: Date.now(),
|
|
603
|
+
tasks: {},
|
|
604
|
+
status: "running",
|
|
605
|
+
endTime: undefined,
|
|
606
|
+
};
|
|
607
|
+
this.activeTasks.set(sessionId, session);
|
|
608
|
+
try {
|
|
609
|
+
// Execute phases
|
|
610
|
+
for (let i = 0; i < plan.phases.length; i++) {
|
|
611
|
+
const phase = plan.phases[i];
|
|
612
|
+
console.log(`Executing phase ${i + 1}/${plan.phases.length} with ${phase.length} tasks`);
|
|
613
|
+
// Execute tasks in phase (simplified - in real implementation would coordinate actual agents)
|
|
614
|
+
for (const task of phase) {
|
|
615
|
+
try {
|
|
616
|
+
await this.simulateTaskExecution(task);
|
|
617
|
+
results.completedTasks++;
|
|
618
|
+
// Track agent utilization
|
|
619
|
+
const agent = this.selectAgentForTask(task);
|
|
620
|
+
results.agentUtilization[agent] =
|
|
621
|
+
(results.agentUtilization[agent] || 0) + 1;
|
|
622
|
+
}
|
|
623
|
+
catch (error) {
|
|
624
|
+
results.failedTasks++;
|
|
625
|
+
results.success = false;
|
|
626
|
+
results.bottlenecks.push(`Task ${task.id} failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
// Analyze bottlenecks
|
|
631
|
+
const utilization = Object.values(results.agentUtilization);
|
|
632
|
+
const avgUtilization = utilization.reduce((a, b) => a + b, 0) / utilization.length;
|
|
633
|
+
if (avgUtilization > 5) {
|
|
634
|
+
results.bottlenecks.push("High agent utilization detected");
|
|
635
|
+
results.recommendations.push("Consider increasing agent concurrency limits");
|
|
636
|
+
}
|
|
637
|
+
if (results.failedTasks > 0) {
|
|
638
|
+
results.recommendations.push("Review failed tasks and error patterns");
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
finally {
|
|
642
|
+
session.status = results.success ? "completed" : "failed";
|
|
643
|
+
session.endTime = Date.now();
|
|
644
|
+
}
|
|
645
|
+
return results;
|
|
646
|
+
}
|
|
647
|
+
async simulateTaskExecution(task) {
|
|
648
|
+
// Simulate task execution with random duration and occasional failures
|
|
649
|
+
const duration = Math.random() * 2000 + 500; // 500-2500ms
|
|
650
|
+
await new Promise((resolve) => setTimeout(resolve, duration));
|
|
651
|
+
// 10% chance of failure for demo purposes
|
|
652
|
+
if (Math.random() < 0.1) {
|
|
653
|
+
throw new Error(`Simulated failure for task ${task.id}`);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
async analyzeTaskComplexity(tasks) {
|
|
657
|
+
const analysis = {
|
|
658
|
+
overallComplexity: 0,
|
|
659
|
+
taskComplexity: [],
|
|
660
|
+
recommendedStrategy: "single-agent",
|
|
661
|
+
agentAssignments: [],
|
|
662
|
+
estimatedDuration: 0,
|
|
663
|
+
parallelPotential: 0,
|
|
664
|
+
};
|
|
665
|
+
let totalComplexity = 0;
|
|
666
|
+
for (const task of tasks) {
|
|
667
|
+
const complexity = this.calculateTaskComplexity(task);
|
|
668
|
+
analysis.taskComplexity.push({
|
|
669
|
+
id: task.id,
|
|
670
|
+
complexity: complexity.score,
|
|
671
|
+
category: complexity.category,
|
|
672
|
+
});
|
|
673
|
+
totalComplexity += complexity.score;
|
|
674
|
+
}
|
|
675
|
+
analysis.overallComplexity = Math.min(100, totalComplexity / tasks.length);
|
|
676
|
+
// Determine strategy
|
|
677
|
+
if (analysis.overallComplexity > 95) {
|
|
678
|
+
analysis.recommendedStrategy = "orchestrator-led";
|
|
679
|
+
}
|
|
680
|
+
else if (analysis.overallComplexity > 50) {
|
|
681
|
+
analysis.recommendedStrategy = "multi-agent";
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
analysis.recommendedStrategy = "single-agent";
|
|
685
|
+
}
|
|
686
|
+
// Calculate agent assignments
|
|
687
|
+
const agentCounts = {};
|
|
688
|
+
for (const task of tasks) {
|
|
689
|
+
const agent = this.selectAgentForTask(task);
|
|
690
|
+
agentCounts[agent] = (agentCounts[agent] || 0) + 1;
|
|
691
|
+
}
|
|
692
|
+
analysis.agentAssignments = Object.entries(agentCounts).map(([agent, count]) => ({
|
|
693
|
+
agent,
|
|
694
|
+
taskCount: count,
|
|
695
|
+
utilization: Math.round((count / tasks.length) * 100),
|
|
696
|
+
}));
|
|
697
|
+
// Estimate duration and parallel potential
|
|
698
|
+
analysis.estimatedDuration = this.estimateExecutionDuration({
|
|
699
|
+
agentAssignments: agentCounts,
|
|
700
|
+
});
|
|
701
|
+
analysis.parallelPotential = this.calculateParallelPotential(tasks);
|
|
702
|
+
return analysis;
|
|
703
|
+
}
|
|
704
|
+
calculateTaskComplexity(task) {
|
|
705
|
+
let score = 25; // Base complexity
|
|
706
|
+
// Factor in file count
|
|
707
|
+
const fileCount = task.files?.length || 1;
|
|
708
|
+
score += Math.min(fileCount * 2, 20);
|
|
709
|
+
// Factor in dependencies
|
|
710
|
+
const dependencies = task.dependencies || 0;
|
|
711
|
+
score += Math.min(dependencies * 3, 15);
|
|
712
|
+
// Factor in risk level
|
|
713
|
+
const riskMultiplier = { low: 0.8, medium: 1.0, high: 1.3, critical: 1.6 };
|
|
714
|
+
score *=
|
|
715
|
+
riskMultiplier[task.riskLevel || "medium"];
|
|
716
|
+
// Determine category
|
|
717
|
+
let category = "simple";
|
|
718
|
+
if (score > 80)
|
|
719
|
+
category = "enterprise";
|
|
720
|
+
else if (score > 50)
|
|
721
|
+
category = "complex";
|
|
722
|
+
else if (score > 25)
|
|
723
|
+
category = "moderate";
|
|
724
|
+
return { score: Math.round(score), category };
|
|
725
|
+
}
|
|
726
|
+
estimateExecutionDuration(plan) {
|
|
727
|
+
let totalDuration = 0;
|
|
728
|
+
for (const [agent, tasks] of Object.entries(plan.agentAssignments || {})) {
|
|
729
|
+
const capability = this.agentCapabilities.get(agent);
|
|
730
|
+
const concurrentTasks = capability?.concurrentTasks || 1;
|
|
731
|
+
const taskCount = Array.isArray(tasks)
|
|
732
|
+
? tasks.length
|
|
733
|
+
: typeof tasks === "number"
|
|
734
|
+
? tasks
|
|
735
|
+
: 0;
|
|
736
|
+
// Estimate time per task (simplified)
|
|
737
|
+
const avgTaskTime = 1500; // 1.5 seconds average
|
|
738
|
+
const agentTime = Math.ceil(taskCount / concurrentTasks) * avgTaskTime;
|
|
739
|
+
totalDuration = Math.max(totalDuration, agentTime);
|
|
740
|
+
}
|
|
741
|
+
return totalDuration;
|
|
742
|
+
}
|
|
743
|
+
calculateParallelPotential(tasks) {
|
|
744
|
+
// Calculate how much parallelism is possible based on dependencies
|
|
745
|
+
const independentTasks = tasks.filter((task) => !task.dependencies || task.dependencies.length === 0).length;
|
|
746
|
+
return independentTasks / tasks.length;
|
|
747
|
+
}
|
|
748
|
+
generateComplexityRecommendations(analysis) {
|
|
749
|
+
const recommendations = [];
|
|
750
|
+
if (analysis.recommendedStrategy === "orchestrator-led") {
|
|
751
|
+
recommendations.push("Use enterprise orchestrator for complex multi-agent coordination");
|
|
752
|
+
}
|
|
753
|
+
else if (analysis.recommendedStrategy === "multi-agent") {
|
|
754
|
+
recommendations.push("Leverage multi-agent parallelism for improved efficiency");
|
|
755
|
+
}
|
|
756
|
+
if (analysis.parallelPotential > 0.7) {
|
|
757
|
+
recommendations.push("High parallel potential - consider parallel execution");
|
|
758
|
+
}
|
|
759
|
+
const overloadedAgents = analysis.agentAssignments.filter((a) => a.utilization > 80);
|
|
760
|
+
if (overloadedAgents.length > 0) {
|
|
761
|
+
recommendations.push(`Consider load balancing for overloaded agents: ${overloadedAgents.map((a) => a.agent).join(", ")}`);
|
|
762
|
+
}
|
|
763
|
+
return recommendations;
|
|
764
|
+
}
|
|
765
|
+
getOverallOrchestrationStatus() {
|
|
766
|
+
const activeCount = this.activeTasks.size;
|
|
767
|
+
const completedCount = this.taskHistory.length;
|
|
768
|
+
const agentUtilization = this.calculateAgentUtilization();
|
|
769
|
+
return {
|
|
770
|
+
activeSessions: activeCount,
|
|
771
|
+
completedSessions: completedCount,
|
|
772
|
+
totalSessions: activeCount + completedCount,
|
|
773
|
+
agentUtilization,
|
|
774
|
+
systemLoad: this.calculateSystemLoad(),
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
calculateAgentUtilization() {
|
|
778
|
+
const utilization = {};
|
|
779
|
+
for (const session of this.activeTasks.values()) {
|
|
780
|
+
for (const [agent, tasks] of Object.entries(session.plan?.agentAssignments || {})) {
|
|
781
|
+
utilization[agent] =
|
|
782
|
+
(utilization[agent] || 0) +
|
|
783
|
+
(Array.isArray(tasks)
|
|
784
|
+
? tasks.length
|
|
785
|
+
: typeof tasks === "number"
|
|
786
|
+
? tasks
|
|
787
|
+
: 0);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
return utilization;
|
|
791
|
+
}
|
|
792
|
+
calculateSystemLoad() {
|
|
793
|
+
const activeTasks = Array.from(this.activeTasks.values());
|
|
794
|
+
const totalTasks = activeTasks.reduce((sum, session) => {
|
|
795
|
+
return sum + (session.plan?.phases?.flat().length || 0);
|
|
796
|
+
}, 0);
|
|
797
|
+
// Simple load calculation (0-100)
|
|
798
|
+
return Math.min(100, totalTasks * 10);
|
|
799
|
+
}
|
|
800
|
+
async cancelSession(sessionId, force) {
|
|
801
|
+
const session = this.activeTasks.get(sessionId);
|
|
802
|
+
if (!session)
|
|
803
|
+
return false;
|
|
804
|
+
// In a real implementation, this would send cancellation signals to running agents
|
|
805
|
+
this.activeTasks.delete(sessionId);
|
|
806
|
+
return true;
|
|
807
|
+
}
|
|
808
|
+
async cancelSpecificTask(sessionId, taskId, force) {
|
|
809
|
+
const session = this.activeTasks.get(sessionId);
|
|
810
|
+
if (!session || !session.tasks[taskId])
|
|
811
|
+
return false;
|
|
812
|
+
// In a real implementation, this would cancel the specific task
|
|
813
|
+
delete session.tasks[taskId];
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
async analyzeOrchestrationPatterns(includeHistory) {
|
|
817
|
+
const data = includeHistory
|
|
818
|
+
? this.taskHistory
|
|
819
|
+
: [this.getOverallOrchestrationStatus()];
|
|
820
|
+
const results = {
|
|
821
|
+
totalOrchestrations: data.length,
|
|
822
|
+
averageSuccessRate: 0,
|
|
823
|
+
averageDuration: 0,
|
|
824
|
+
peakUtilization: 0,
|
|
825
|
+
bottleneckFrequency: 0,
|
|
826
|
+
commonPatterns: [],
|
|
827
|
+
agentEfficiency: [],
|
|
828
|
+
recommendations: [],
|
|
829
|
+
predictedImprovements: [],
|
|
830
|
+
};
|
|
831
|
+
if (data.length === 0)
|
|
832
|
+
return results;
|
|
833
|
+
// Calculate metrics
|
|
834
|
+
let totalSuccess = 0;
|
|
835
|
+
let totalDuration = 0;
|
|
836
|
+
const agentTaskCounts = {};
|
|
837
|
+
for (const item of data) {
|
|
838
|
+
if (item.result?.success)
|
|
839
|
+
totalSuccess++;
|
|
840
|
+
if (item.result?.duration)
|
|
841
|
+
totalDuration += item.result.duration;
|
|
842
|
+
// Count agent usage
|
|
843
|
+
for (const [agent, count] of Object.entries(item.result?.agentUtilization || {})) {
|
|
844
|
+
agentTaskCounts[agent] =
|
|
845
|
+
(agentTaskCounts[agent] || 0) +
|
|
846
|
+
(typeof count === "number" ? count : 0);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
results.averageSuccessRate = Math.round((totalSuccess / data.length) * 100);
|
|
850
|
+
results.averageDuration = Math.round(totalDuration / data.length);
|
|
851
|
+
// Calculate agent efficiency
|
|
852
|
+
results.agentEfficiency = Object.entries(agentTaskCounts).map(([agent, tasks]) => ({
|
|
853
|
+
agent,
|
|
854
|
+
taskCount: tasks,
|
|
855
|
+
efficiency: Math.round((tasks / data.length) * 100),
|
|
856
|
+
}));
|
|
857
|
+
// Generate recommendations
|
|
858
|
+
if (results.averageSuccessRate < 80) {
|
|
859
|
+
results.recommendations.push("Review orchestration strategies to improve success rates");
|
|
860
|
+
}
|
|
861
|
+
if (results.averageDuration > 60000) {
|
|
862
|
+
// 1 minute
|
|
863
|
+
results.recommendations.push("Consider parallel execution optimizations for long-running orchestrations");
|
|
864
|
+
}
|
|
865
|
+
// Predicted improvements
|
|
866
|
+
results.predictedImprovements = [
|
|
867
|
+
{ metric: "Success Rate", improvement: 15 },
|
|
868
|
+
{ metric: "Execution Time", improvement: -25 },
|
|
869
|
+
{ metric: "Agent Utilization", improvement: 20 },
|
|
870
|
+
];
|
|
871
|
+
return results;
|
|
872
|
+
}
|
|
873
|
+
formatOrchestrationStatus(status, detailed) {
|
|
874
|
+
if (status.completed !== undefined) {
|
|
875
|
+
// Completed session
|
|
876
|
+
return `📊 Completed Orchestration
|
|
877
|
+
**Session:** ${status.sessionId}
|
|
878
|
+
**Tasks:** ${status.completedTasks + status.failedTasks}
|
|
879
|
+
**Success:** ${status.success ? "✅ Yes" : "❌ No"}
|
|
880
|
+
**Duration:** ${status.duration}ms
|
|
881
|
+
**Agent Utilization:** ${Object.entries(status.agentUtilization || {})
|
|
882
|
+
.map(([a, c]) => `${a}:${c}`)
|
|
883
|
+
.join(", ")}`;
|
|
884
|
+
}
|
|
885
|
+
else {
|
|
886
|
+
// Overall status
|
|
887
|
+
return `📊 Orchestration System Status
|
|
888
|
+
**Active Sessions:** ${status.activeSessions}
|
|
889
|
+
**Completed Sessions:** ${status.completedSessions}
|
|
890
|
+
**System Load:** ${status.systemLoad}%
|
|
891
|
+
**Agent Utilization:** ${Object.entries(status.agentUtilization || {})
|
|
892
|
+
.map(([a, c]) => `${a}:${c}`)
|
|
893
|
+
.join(", ")}`;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
async run() {
|
|
897
|
+
const transport = new StdioServerTransport();
|
|
898
|
+
await this.server.connect(transport);
|
|
899
|
+
console.log("StrRay Orchestrator MCP Server started");
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
// Start the server if run directly
|
|
903
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
904
|
+
const server = new StrRayOrchestratorServer();
|
|
905
|
+
server.run().catch(console.error);
|
|
906
|
+
}
|
|
907
|
+
export { StrRayOrchestratorServer };
|
|
908
|
+
//# sourceMappingURL=orchestrator.server.js.map
|