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,928 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StringRay Framework v1.0.0 - Agent Delegator
|
|
3
|
+
*
|
|
4
|
+
* Intelligent agent delegation system that uses complexity analysis to determine
|
|
5
|
+
* optimal task distribution strategies and conflict resolution.
|
|
6
|
+
*
|
|
7
|
+
* @version 1.0.0
|
|
8
|
+
* @since 2026-01-07
|
|
9
|
+
*/
|
|
10
|
+
import { ComplexityAnalyzer, } from "./complexity-analyzer.js";
|
|
11
|
+
import { strRayConfigLoader, } from "../config-loader.js";
|
|
12
|
+
import { frameworkLogger } from "../framework-logger.js";
|
|
13
|
+
export class AgentDelegator {
|
|
14
|
+
complexityAnalyzer;
|
|
15
|
+
stateManager;
|
|
16
|
+
agentCapabilities = new Map();
|
|
17
|
+
delegationMetrics = {
|
|
18
|
+
totalDelegations: 0,
|
|
19
|
+
successfulDelegations: 0,
|
|
20
|
+
failedDelegations: 0,
|
|
21
|
+
averageComplexity: 0,
|
|
22
|
+
averageDuration: 0,
|
|
23
|
+
strategyUsage: {},
|
|
24
|
+
};
|
|
25
|
+
constructor(stateManager) {
|
|
26
|
+
this.complexityAnalyzer = new ComplexityAnalyzer();
|
|
27
|
+
this.stateManager = stateManager;
|
|
28
|
+
this.initializeAgentCapabilities();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Analyze request and determine optimal delegation strategy
|
|
32
|
+
*/
|
|
33
|
+
async analyzeDelegation(request) {
|
|
34
|
+
const metrics = this.complexityAnalyzer.analyzeComplexity(request.operation, request.context);
|
|
35
|
+
const complexity = this.complexityAnalyzer.calculateComplexityScore(metrics);
|
|
36
|
+
let finalStrategy = complexity.recommendedStrategy;
|
|
37
|
+
let finalAgents = request.forceMultiAgent
|
|
38
|
+
? request.requiredAgents || this.selectDefaultMultiAgentTeam(request)
|
|
39
|
+
: this.selectAgents(complexity, request);
|
|
40
|
+
// Handle @mention requests
|
|
41
|
+
if (request.mentionAgent) {
|
|
42
|
+
finalStrategy = "single-agent";
|
|
43
|
+
finalAgents = [request.mentionAgent];
|
|
44
|
+
}
|
|
45
|
+
if (request.forceMultiAgent) {
|
|
46
|
+
finalStrategy = "multi-agent";
|
|
47
|
+
}
|
|
48
|
+
const conflictResolution = this.determineConflictResolution(complexity);
|
|
49
|
+
const result = {
|
|
50
|
+
strategy: finalStrategy,
|
|
51
|
+
agents: finalAgents,
|
|
52
|
+
complexity,
|
|
53
|
+
metrics,
|
|
54
|
+
estimatedDuration: metrics.estimatedDuration,
|
|
55
|
+
conflictResolution,
|
|
56
|
+
};
|
|
57
|
+
this.updateDelegationMetrics(result);
|
|
58
|
+
await this.logDelegationDecision(result, request);
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Execute delegation with monitoring and error handling
|
|
63
|
+
*/
|
|
64
|
+
async executeDelegation(delegation, request) {
|
|
65
|
+
const startTime = Date.now();
|
|
66
|
+
await frameworkLogger.log("agent-delegator", "delegation execution started", "info", {
|
|
67
|
+
strategy: delegation.strategy,
|
|
68
|
+
agentCount: delegation.agents.length,
|
|
69
|
+
operation: request.operation,
|
|
70
|
+
});
|
|
71
|
+
try {
|
|
72
|
+
console.log(`🎯 Executing delegation: ${delegation.strategy} with ${delegation.agents.length} agents`);
|
|
73
|
+
// Check multi-agent orchestration configuration
|
|
74
|
+
const config = strRayConfigLoader.loadConfig();
|
|
75
|
+
const multiAgentEnabled = config.multi_agent_orchestration.enabled;
|
|
76
|
+
console.log("🔧 Multi-agent config loaded:", {
|
|
77
|
+
enabled: multiAgentEnabled,
|
|
78
|
+
maxConcurrent: config.multi_agent_orchestration.max_concurrent_agents,
|
|
79
|
+
model: config.multi_agent_orchestration.coordination_model,
|
|
80
|
+
});
|
|
81
|
+
await frameworkLogger.log("agent-delegator", "multi-agent config checked", "info", {
|
|
82
|
+
multiAgentEnabled,
|
|
83
|
+
maxConcurrentAgents: config.multi_agent_orchestration.max_concurrent_agents,
|
|
84
|
+
});
|
|
85
|
+
// Override strategy based on configuration
|
|
86
|
+
if (!multiAgentEnabled && delegation.strategy === "multi-agent") {
|
|
87
|
+
console.log("⚠️ Multi-agent orchestration disabled, falling back to single-agent");
|
|
88
|
+
delegation.strategy = "single-agent";
|
|
89
|
+
delegation.agents = delegation.agents.slice(0, 1);
|
|
90
|
+
}
|
|
91
|
+
// Apply max concurrent agents limit
|
|
92
|
+
const maxAgents = config.multi_agent_orchestration?.max_concurrent_agents || 5;
|
|
93
|
+
if (delegation.agents.length > maxAgents) {
|
|
94
|
+
console.log(`⚠️ Limiting agents to ${maxAgents} (config limit)`);
|
|
95
|
+
delegation.agents = delegation.agents.slice(0, maxAgents);
|
|
96
|
+
}
|
|
97
|
+
let result;
|
|
98
|
+
switch (delegation.strategy) {
|
|
99
|
+
case "single-agent":
|
|
100
|
+
await frameworkLogger.log("agent-delegator", "executing single-agent strategy", "info", {
|
|
101
|
+
agent: delegation.agents[0],
|
|
102
|
+
});
|
|
103
|
+
if (delegation.agents.length > 0) {
|
|
104
|
+
result = await this.executeSingleAgent(delegation.agents[0], request);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
throw new Error("No agents available for single agent execution");
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "multi-agent":
|
|
111
|
+
await frameworkLogger.log("agent-delegator", "executing multi-agent strategy", "info", {
|
|
112
|
+
agentCount: delegation.agents.length,
|
|
113
|
+
agents: delegation.agents,
|
|
114
|
+
});
|
|
115
|
+
result = await this.executeMultiAgent(delegation.agents, request);
|
|
116
|
+
break;
|
|
117
|
+
case "orchestrator-led":
|
|
118
|
+
await frameworkLogger.log("agent-delegator", "executing orchestrator-led strategy", "info", {
|
|
119
|
+
agentCount: delegation.agents.length,
|
|
120
|
+
agents: delegation.agents,
|
|
121
|
+
});
|
|
122
|
+
result = await this.executeOrchestratorLed(delegation.agents, request);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
const duration = Date.now() - startTime;
|
|
126
|
+
this.recordSuccessfulDelegation(delegation, duration);
|
|
127
|
+
await frameworkLogger.log("agent-delegator", "delegation execution completed", "success", {
|
|
128
|
+
strategy: delegation.strategy,
|
|
129
|
+
duration,
|
|
130
|
+
operation: request.operation,
|
|
131
|
+
});
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
const duration = Date.now() - startTime;
|
|
136
|
+
this.recordFailedDelegation(delegation, duration, error);
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get delegation performance metrics
|
|
142
|
+
*/
|
|
143
|
+
getPerformanceMetrics() {
|
|
144
|
+
return {
|
|
145
|
+
totalDelegations: this.delegationMetrics.totalDelegations,
|
|
146
|
+
averageResponseTime: this.delegationMetrics.averageDuration,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Get delegation performance metrics
|
|
151
|
+
*/
|
|
152
|
+
getDelegationMetrics() {
|
|
153
|
+
return {
|
|
154
|
+
totalDelegations: this.delegationMetrics.totalDelegations,
|
|
155
|
+
successfulDelegations: this.delegationMetrics.successfulDelegations,
|
|
156
|
+
failedDelegations: this.delegationMetrics.failedDelegations,
|
|
157
|
+
averageComplexity: this.delegationMetrics.averageComplexity,
|
|
158
|
+
averageDuration: this.delegationMetrics.averageDuration,
|
|
159
|
+
strategyUsage: { ...this.delegationMetrics.strategyUsage },
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Update agent capabilities based on performance
|
|
164
|
+
*/
|
|
165
|
+
updateAgentCapability(agentName, performance) {
|
|
166
|
+
const current = this.agentCapabilities.get(agentName);
|
|
167
|
+
if (current) {
|
|
168
|
+
this.agentCapabilities.set(agentName, { ...current, ...performance });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Handle file creation events - delegate to appropriate agents
|
|
173
|
+
*/
|
|
174
|
+
async handleFileCreation(filePath, content) {
|
|
175
|
+
const fileType = this.getFileType(filePath);
|
|
176
|
+
const complexity = this.analyzeFileComplexity(filePath, content);
|
|
177
|
+
// Always consult test-architect for new files
|
|
178
|
+
if (this.shouldConsultTestArchitect(fileType, complexity)) {
|
|
179
|
+
await this.delegateToTestArchitect(filePath, fileType, complexity);
|
|
180
|
+
}
|
|
181
|
+
// Consult other agents based on file type and complexity
|
|
182
|
+
if (this.shouldConsultCodeReviewer(fileType)) {
|
|
183
|
+
await this.delegateToCodeReviewer(filePath, fileType);
|
|
184
|
+
}
|
|
185
|
+
if (this.shouldConsultSecurityAuditor(fileType, content)) {
|
|
186
|
+
await this.delegateToSecurityAuditor(filePath, fileType);
|
|
187
|
+
}
|
|
188
|
+
if (this.shouldConsultArchitect(filePath, fileType, complexity)) {
|
|
189
|
+
await this.delegateToArchitect(filePath, fileType, complexity);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Handle file modification events
|
|
194
|
+
*/
|
|
195
|
+
async handleFileModification(filePath, changes) {
|
|
196
|
+
const fileType = this.getFileType(filePath);
|
|
197
|
+
// Consult bug triage for significant changes
|
|
198
|
+
if (this.shouldConsultBugTriage(changes)) {
|
|
199
|
+
await this.delegateToBugTriage(filePath, changes);
|
|
200
|
+
}
|
|
201
|
+
// Consult refactorer for complex changes
|
|
202
|
+
if (this.shouldConsultRefactorer(changes)) {
|
|
203
|
+
await this.delegateToRefactorer(filePath, changes);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Determine if test architect should be consulted
|
|
208
|
+
*/
|
|
209
|
+
shouldConsultTestArchitect(fileType, complexity) {
|
|
210
|
+
// Consult for all code files and significant complexity
|
|
211
|
+
return ([".ts", ".js", ".py", ".java", ".cpp", ".rs"].includes(fileType) ||
|
|
212
|
+
complexity > 50);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Determine if code reviewer should be consulted
|
|
216
|
+
*/
|
|
217
|
+
shouldConsultCodeReviewer(fileType) {
|
|
218
|
+
return [".ts", ".js", ".py", ".java", ".cpp", ".rs", ".md"].includes(fileType);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Determine if security auditor should be consulted
|
|
222
|
+
*/
|
|
223
|
+
shouldConsultSecurityAuditor(fileType, content) {
|
|
224
|
+
const isCode = [".ts", ".js", ".py", ".java", ".cpp", ".rs"].includes(fileType);
|
|
225
|
+
const hasSecurityKeywords = content &&
|
|
226
|
+
(content.includes("password") ||
|
|
227
|
+
content.includes("secret") ||
|
|
228
|
+
content.includes("auth") ||
|
|
229
|
+
content.includes("security"));
|
|
230
|
+
return isCode && !!hasSecurityKeywords;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Determine if architect should be consulted
|
|
234
|
+
*/
|
|
235
|
+
shouldConsultArchitect(filePath, fileType, complexity) {
|
|
236
|
+
return (complexity > 100 ||
|
|
237
|
+
fileType === ".md" ||
|
|
238
|
+
filePath.includes("architecture") ||
|
|
239
|
+
filePath.includes("design"));
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Determine if bug triage should be consulted
|
|
243
|
+
*/
|
|
244
|
+
shouldConsultBugTriage(changes) {
|
|
245
|
+
return (changes.addedLines ?? 0) > 50 || (changes.deletedLines ?? 0) > 20;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Determine if refactorer should be consulted
|
|
249
|
+
*/
|
|
250
|
+
shouldConsultRefactorer(changes) {
|
|
251
|
+
return ((changes.complexityIncrease ?? 0) > 20 ||
|
|
252
|
+
(changes.fileSizeIncrease ?? 0) > 1000);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Delegate to test architect for new file analysis
|
|
256
|
+
*/
|
|
257
|
+
async delegateToTestArchitect(filePath, fileType, complexity) {
|
|
258
|
+
const delegation = await this.analyzeDelegation({
|
|
259
|
+
operation: "new-file-analysis",
|
|
260
|
+
description: `Analyze new ${fileType} file: ${filePath}`,
|
|
261
|
+
context: {
|
|
262
|
+
filePath,
|
|
263
|
+
fileType,
|
|
264
|
+
complexity,
|
|
265
|
+
action: "new-file-created",
|
|
266
|
+
},
|
|
267
|
+
priority: "medium",
|
|
268
|
+
});
|
|
269
|
+
if (delegation.agents.includes("test-architect")) {
|
|
270
|
+
await this.executeDelegation(delegation, {
|
|
271
|
+
operation: "new-file-analysis",
|
|
272
|
+
description: `Analyze new ${fileType} file: ${filePath}`,
|
|
273
|
+
context: {
|
|
274
|
+
filePath,
|
|
275
|
+
fileType,
|
|
276
|
+
complexity,
|
|
277
|
+
action: "new-file-created",
|
|
278
|
+
},
|
|
279
|
+
priority: "medium",
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Delegate to code reviewer
|
|
285
|
+
*/
|
|
286
|
+
async delegateToCodeReviewer(filePath, fileType) {
|
|
287
|
+
const delegation = await this.analyzeDelegation({
|
|
288
|
+
operation: "code-review",
|
|
289
|
+
description: `Review new ${fileType} file: ${filePath}`,
|
|
290
|
+
context: {
|
|
291
|
+
filePath,
|
|
292
|
+
fileType,
|
|
293
|
+
action: "new-file-review",
|
|
294
|
+
},
|
|
295
|
+
priority: "low",
|
|
296
|
+
});
|
|
297
|
+
if (delegation.agents.includes("code-reviewer")) {
|
|
298
|
+
await this.executeDelegation(delegation, {
|
|
299
|
+
operation: "code-review",
|
|
300
|
+
description: `Review new ${fileType} file: ${filePath}`,
|
|
301
|
+
context: {
|
|
302
|
+
filePath,
|
|
303
|
+
fileType,
|
|
304
|
+
action: "new-file-review",
|
|
305
|
+
},
|
|
306
|
+
priority: "low",
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Delegate to security auditor
|
|
312
|
+
*/
|
|
313
|
+
async delegateToSecurityAuditor(filePath, fileType) {
|
|
314
|
+
const delegation = await this.analyzeDelegation({
|
|
315
|
+
operation: "security-scan",
|
|
316
|
+
description: `Security scan for ${fileType} file: ${filePath}`,
|
|
317
|
+
context: {
|
|
318
|
+
filePath,
|
|
319
|
+
fileType,
|
|
320
|
+
action: "security-review",
|
|
321
|
+
},
|
|
322
|
+
priority: "high",
|
|
323
|
+
});
|
|
324
|
+
if (delegation.agents.includes("security-auditor")) {
|
|
325
|
+
await this.executeDelegation(delegation, {
|
|
326
|
+
operation: "security-scan",
|
|
327
|
+
description: `Security scan for ${fileType} file: ${filePath}`,
|
|
328
|
+
context: {
|
|
329
|
+
filePath,
|
|
330
|
+
fileType,
|
|
331
|
+
action: "security-review",
|
|
332
|
+
},
|
|
333
|
+
priority: "high",
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Delegate to architect
|
|
339
|
+
*/
|
|
340
|
+
async delegateToArchitect(filePath, fileType, complexity) {
|
|
341
|
+
const delegation = await this.analyzeDelegation({
|
|
342
|
+
operation: "architecture-review",
|
|
343
|
+
description: `Architecture review for ${fileType} file: ${filePath}`,
|
|
344
|
+
context: {
|
|
345
|
+
filePath,
|
|
346
|
+
fileType,
|
|
347
|
+
complexity,
|
|
348
|
+
action: "architecture-review",
|
|
349
|
+
},
|
|
350
|
+
priority: "medium",
|
|
351
|
+
});
|
|
352
|
+
if (delegation.agents.includes("architect")) {
|
|
353
|
+
await this.executeDelegation(delegation, {
|
|
354
|
+
operation: "architecture-review",
|
|
355
|
+
description: `Architecture review for ${fileType} file: ${filePath}`,
|
|
356
|
+
context: {
|
|
357
|
+
filePath,
|
|
358
|
+
fileType,
|
|
359
|
+
complexity,
|
|
360
|
+
action: "architecture-review",
|
|
361
|
+
},
|
|
362
|
+
priority: "medium",
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Delegate to bug triage
|
|
368
|
+
*/
|
|
369
|
+
async delegateToBugTriage(filePath, changes) {
|
|
370
|
+
const delegation = await this.analyzeDelegation({
|
|
371
|
+
operation: "change-analysis",
|
|
372
|
+
description: `Analyze significant changes in ${filePath}`,
|
|
373
|
+
context: {
|
|
374
|
+
filePath,
|
|
375
|
+
changes,
|
|
376
|
+
action: "change-review",
|
|
377
|
+
},
|
|
378
|
+
priority: "medium",
|
|
379
|
+
});
|
|
380
|
+
if (delegation.agents.includes("bug-triage-specialist")) {
|
|
381
|
+
await this.executeDelegation(delegation, {
|
|
382
|
+
operation: "change-analysis",
|
|
383
|
+
description: `Analyze significant changes in ${filePath}`,
|
|
384
|
+
context: {
|
|
385
|
+
filePath,
|
|
386
|
+
changes,
|
|
387
|
+
action: "change-review",
|
|
388
|
+
},
|
|
389
|
+
priority: "medium",
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Delegate to refactorer
|
|
395
|
+
*/
|
|
396
|
+
async delegateToRefactorer(filePath, changes) {
|
|
397
|
+
const delegation = await this.analyzeDelegation({
|
|
398
|
+
operation: "refactoring-analysis",
|
|
399
|
+
description: `Analyze refactoring opportunities in ${filePath}`,
|
|
400
|
+
context: {
|
|
401
|
+
filePath,
|
|
402
|
+
changes,
|
|
403
|
+
action: "refactoring-review",
|
|
404
|
+
},
|
|
405
|
+
priority: "low",
|
|
406
|
+
});
|
|
407
|
+
if (delegation.agents.includes("refactorer")) {
|
|
408
|
+
await this.executeDelegation(delegation, {
|
|
409
|
+
operation: "refactoring-analysis",
|
|
410
|
+
description: `Analyze refactoring opportunities in ${filePath}`,
|
|
411
|
+
context: {
|
|
412
|
+
filePath,
|
|
413
|
+
changes,
|
|
414
|
+
action: "refactoring-review",
|
|
415
|
+
},
|
|
416
|
+
priority: "low",
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Get file type from path
|
|
422
|
+
*/
|
|
423
|
+
getFileType(filePath) {
|
|
424
|
+
const ext = filePath.substring(filePath.lastIndexOf("."));
|
|
425
|
+
return ext || "unknown";
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Analyze file complexity
|
|
429
|
+
*/
|
|
430
|
+
analyzeFileComplexity(filePath, content) {
|
|
431
|
+
let complexity = 0;
|
|
432
|
+
if (content) {
|
|
433
|
+
// Count lines, functions, classes, etc.
|
|
434
|
+
const lines = content.split("\n").length;
|
|
435
|
+
const functions = (content.match(/function\s+|=>|class\s+/g) || [])
|
|
436
|
+
.length;
|
|
437
|
+
const imports = (content.match(/import\s+|require\s*\(/g) || []).length;
|
|
438
|
+
complexity = lines + functions * 5 + imports * 2;
|
|
439
|
+
}
|
|
440
|
+
// File size contributes to complexity
|
|
441
|
+
try {
|
|
442
|
+
const stats = require("fs").statSync(filePath);
|
|
443
|
+
complexity += Math.floor(stats.size / 1000); // 1 point per KB
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
// Ignore file access errors
|
|
447
|
+
}
|
|
448
|
+
return complexity;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Get available agents and their current status
|
|
452
|
+
*/
|
|
453
|
+
getAvailableAgents() {
|
|
454
|
+
return Array.from(this.agentCapabilities.values());
|
|
455
|
+
}
|
|
456
|
+
// Private methods
|
|
457
|
+
initializeAgentCapabilities() {
|
|
458
|
+
const defaultAgents = [
|
|
459
|
+
{
|
|
460
|
+
name: "enforcer",
|
|
461
|
+
expertise: ["compliance", "validation", "security"],
|
|
462
|
+
capacity: 3,
|
|
463
|
+
performance: 95,
|
|
464
|
+
specialties: ["codex-enforcement", "error-prevention"],
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
name: "architect",
|
|
468
|
+
expertise: ["design", "structure", "planning"],
|
|
469
|
+
capacity: 2,
|
|
470
|
+
performance: 90,
|
|
471
|
+
specialties: ["system-design", "scalability"],
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
name: "bug-triage-specialist",
|
|
475
|
+
expertise: ["debugging", "analysis", "fixing"],
|
|
476
|
+
capacity: 4,
|
|
477
|
+
performance: 88,
|
|
478
|
+
specialties: ["error-investigation", "root-cause-analysis"],
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: "code-reviewer",
|
|
482
|
+
expertise: ["review", "quality", "standards"],
|
|
483
|
+
capacity: 3,
|
|
484
|
+
performance: 92,
|
|
485
|
+
specialties: ["code-quality", "best-practices"],
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "security-auditor",
|
|
489
|
+
expertise: ["security", "vulnerability", "audit"],
|
|
490
|
+
capacity: 2,
|
|
491
|
+
performance: 96,
|
|
492
|
+
specialties: ["security-scanning", "threat-analysis"],
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: "refactorer",
|
|
496
|
+
expertise: ["refactoring", "optimization", "maintenance"],
|
|
497
|
+
capacity: 2,
|
|
498
|
+
performance: 85,
|
|
499
|
+
specialties: ["code-improvement", "technical-debt"],
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: "test-architect",
|
|
503
|
+
expertise: ["testing", "quality-assurance", "automation"],
|
|
504
|
+
capacity: 3,
|
|
505
|
+
performance: 87,
|
|
506
|
+
specialties: ["test-strategy", "ci-cd-integration"],
|
|
507
|
+
},
|
|
508
|
+
];
|
|
509
|
+
defaultAgents.forEach((agent) => {
|
|
510
|
+
this.agentCapabilities.set(agent.name, agent);
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
selectAgents(complexity, request) {
|
|
514
|
+
const availableAgents = Array.from(this.agentCapabilities.values())
|
|
515
|
+
.filter((agent) => this.isAgentAvailable(agent.name))
|
|
516
|
+
.sort((a, b) => b.performance - a.performance);
|
|
517
|
+
switch (complexity.recommendedStrategy) {
|
|
518
|
+
case "single-agent":
|
|
519
|
+
return this.selectSingleAgent(availableAgents, request);
|
|
520
|
+
case "multi-agent":
|
|
521
|
+
return this.selectMultiAgent(availableAgents, complexity.estimatedAgents, request);
|
|
522
|
+
case "orchestrator-led":
|
|
523
|
+
return this.selectOrchestratorLed(availableAgents, complexity.estimatedAgents);
|
|
524
|
+
default:
|
|
525
|
+
return [availableAgents[0]?.name || "enforcer"];
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
selectSingleAgent(agents, request) {
|
|
529
|
+
const operation = (request.operation || "").toLowerCase();
|
|
530
|
+
const description = (request.description || "").toLowerCase();
|
|
531
|
+
for (const agent of agents) {
|
|
532
|
+
if (agent.expertise.some((exp) => operation.includes(exp) || description.includes(exp))) {
|
|
533
|
+
return [agent.name];
|
|
534
|
+
}
|
|
535
|
+
if (agent.specialties.some((spec) => {
|
|
536
|
+
const specPart = spec.split("-")[0] || spec;
|
|
537
|
+
return operation.includes(specPart) || description.includes(specPart);
|
|
538
|
+
})) {
|
|
539
|
+
return [agent.name];
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return [agents[0]?.name || "enforcer"];
|
|
543
|
+
}
|
|
544
|
+
selectMultiAgent(agents, count, request) {
|
|
545
|
+
const operation = (request.operation || "").toLowerCase();
|
|
546
|
+
const selected = [];
|
|
547
|
+
for (const agent of agents) {
|
|
548
|
+
if (selected.length >= count)
|
|
549
|
+
break;
|
|
550
|
+
if (agent.expertise.some((exp) => operation.includes(exp))) {
|
|
551
|
+
selected.push(agent.name);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
while (selected.length < count && agents.length > selected.length) {
|
|
555
|
+
const nextAgent = agents[selected.length];
|
|
556
|
+
if (nextAgent && !selected.includes(nextAgent.name)) {
|
|
557
|
+
selected.push(nextAgent.name);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return selected;
|
|
561
|
+
}
|
|
562
|
+
selectOrchestratorLed(agents, count) {
|
|
563
|
+
const selected = agents
|
|
564
|
+
.sort((a, b) => b.performance - a.performance)
|
|
565
|
+
.slice(0, count)
|
|
566
|
+
.map((a) => a.name);
|
|
567
|
+
return selected.length > 0 ? selected : ["enforcer", "architect"];
|
|
568
|
+
}
|
|
569
|
+
determineConflictResolution(complexity) {
|
|
570
|
+
switch (complexity.level) {
|
|
571
|
+
case "simple":
|
|
572
|
+
case "moderate":
|
|
573
|
+
return "consensus";
|
|
574
|
+
case "complex":
|
|
575
|
+
return "majority_vote";
|
|
576
|
+
case "enterprise":
|
|
577
|
+
return "expert_priority";
|
|
578
|
+
default:
|
|
579
|
+
return "consensus";
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
isAgentAvailable(agentName) {
|
|
583
|
+
const agent = this.agentCapabilities.get(agentName);
|
|
584
|
+
if (!agent)
|
|
585
|
+
return false;
|
|
586
|
+
const activeTasks = this.stateManager.get(`agent:${agentName}:active_tasks`) || 0;
|
|
587
|
+
return activeTasks < agent.capacity;
|
|
588
|
+
}
|
|
589
|
+
async executeSingleAgent(agentName, request) {
|
|
590
|
+
// Simplified task tracking - just log the execution without complex state management
|
|
591
|
+
await frameworkLogger.log("agent-delegator", "starting single agent execution", "info", {
|
|
592
|
+
agentName,
|
|
593
|
+
operation: request.operation,
|
|
594
|
+
});
|
|
595
|
+
try {
|
|
596
|
+
const result = await this.callAgent(agentName, request);
|
|
597
|
+
await frameworkLogger.log("agent-delegator", "single agent execution completed", "success", {
|
|
598
|
+
agentName,
|
|
599
|
+
operation: request.operation,
|
|
600
|
+
});
|
|
601
|
+
return result;
|
|
602
|
+
}
|
|
603
|
+
catch (error) {
|
|
604
|
+
await frameworkLogger.log("agent-delegator", "single agent execution failed", "error", {
|
|
605
|
+
agentName,
|
|
606
|
+
operation: request.operation,
|
|
607
|
+
error: error instanceof Error ? error.message : String(error),
|
|
608
|
+
});
|
|
609
|
+
throw error;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
async executeMultiAgent(agentNames, request) {
|
|
613
|
+
const promises = agentNames.map((agentName) => this.executeSingleAgent(agentName, request));
|
|
614
|
+
const results = await Promise.all(promises);
|
|
615
|
+
return results;
|
|
616
|
+
}
|
|
617
|
+
async executeOrchestratorLed(agentNames, request) {
|
|
618
|
+
// For orchestrator-led execution, coordinate multiple agents through oh-my-opencode
|
|
619
|
+
// This is similar to multi-agent but with orchestrator oversight
|
|
620
|
+
const results = [];
|
|
621
|
+
for (const agentName of agentNames) {
|
|
622
|
+
try {
|
|
623
|
+
const result = await this.callAgent(agentName, request);
|
|
624
|
+
results.push({ agent: agentName, result, success: true });
|
|
625
|
+
}
|
|
626
|
+
catch (error) {
|
|
627
|
+
results.push({
|
|
628
|
+
agent: agentName,
|
|
629
|
+
error: error instanceof Error ? error.message : String(error),
|
|
630
|
+
success: false,
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return {
|
|
635
|
+
strategy: "orchestrator-led",
|
|
636
|
+
agents: agentNames,
|
|
637
|
+
results: results,
|
|
638
|
+
summary: `${results.filter((r) => r.success).length}/${agentNames.length} agents completed successfully`,
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
async callAgent(agentName, request) {
|
|
642
|
+
// Check if agent is configured in oh-my-opencode
|
|
643
|
+
const availableAgents = [
|
|
644
|
+
"enforcer",
|
|
645
|
+
"architect",
|
|
646
|
+
"orchestrator",
|
|
647
|
+
"bug-triage-specialist",
|
|
648
|
+
"code-reviewer",
|
|
649
|
+
"security-auditor",
|
|
650
|
+
"refactorer",
|
|
651
|
+
"test-architect",
|
|
652
|
+
];
|
|
653
|
+
if (!availableAgents.includes(agentName)) {
|
|
654
|
+
await frameworkLogger.log("agent-delegator", "agent not available in oh-my-opencode configuration", "error", {
|
|
655
|
+
agentName,
|
|
656
|
+
availableAgents,
|
|
657
|
+
});
|
|
658
|
+
throw new Error(`Agent ${agentName} not configured in oh-my-opencode system`);
|
|
659
|
+
}
|
|
660
|
+
// Create task for oh-my-opencode agent system
|
|
661
|
+
// Instead of calling agents directly, create a task that gets routed through oh-my-opencode
|
|
662
|
+
const taskDescription = this.formatTaskForAgent(agentName, request);
|
|
663
|
+
await frameworkLogger.log("agent-delegator", "creating task for oh-my-opencode agent system", "info", {
|
|
664
|
+
agentName,
|
|
665
|
+
operation: request.operation,
|
|
666
|
+
taskDescription: taskDescription.substring(0, 100) + "...",
|
|
667
|
+
});
|
|
668
|
+
// First check if there's a mock/test agent in stateManager
|
|
669
|
+
try {
|
|
670
|
+
const mockAgent = await this.stateManager.get(`agent:${agentName}`);
|
|
671
|
+
if (mockAgent && typeof mockAgent.execute === "function") {
|
|
672
|
+
console.log(`🧪 Using mock agent: ${agentName}`);
|
|
673
|
+
return await mockAgent.execute(request);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
catch (mockError) {
|
|
677
|
+
// No mock agent, continue to real agent invocation
|
|
678
|
+
}
|
|
679
|
+
try {
|
|
680
|
+
const result = await this.invokeOhMyOpenCodeAgent(agentName, taskDescription);
|
|
681
|
+
return result;
|
|
682
|
+
}
|
|
683
|
+
catch (invokeError) {
|
|
684
|
+
await frameworkLogger.log("agent-delegator", "oh-my-opencode agent invocation failed, falling back to simulation", "error", {
|
|
685
|
+
agentName,
|
|
686
|
+
operation: request.operation,
|
|
687
|
+
error: invokeError instanceof Error
|
|
688
|
+
? invokeError.message
|
|
689
|
+
: String(invokeError),
|
|
690
|
+
});
|
|
691
|
+
return this.simulateAgentExecution(agentName, request);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
resolveMultiAgentConflicts(results, agentNames) {
|
|
695
|
+
if (results.length <= 1)
|
|
696
|
+
return results;
|
|
697
|
+
const consensusResults = results.filter((r) => r.consensus === true);
|
|
698
|
+
if (consensusResults.length > 0)
|
|
699
|
+
return consensusResults;
|
|
700
|
+
const highConfidenceResults = results.filter((r) => (r.confidence || 0) > 0.8);
|
|
701
|
+
if (highConfidenceResults.length > 0)
|
|
702
|
+
return highConfidenceResults;
|
|
703
|
+
return [results[0]];
|
|
704
|
+
}
|
|
705
|
+
consolidateOrchestratorResults(results) {
|
|
706
|
+
const successful = results.filter((r) => r.success);
|
|
707
|
+
const failed = results.filter((r) => !r.success);
|
|
708
|
+
return {
|
|
709
|
+
consolidated: true,
|
|
710
|
+
successful: successful.length,
|
|
711
|
+
failed: failed.length,
|
|
712
|
+
results: successful.map((r) => r.result),
|
|
713
|
+
errors: failed.map((r) => ({ agent: r.agent, error: r.error })),
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
updateDelegationMetrics(result) {
|
|
717
|
+
this.delegationMetrics.totalDelegations++;
|
|
718
|
+
this.delegationMetrics.averageComplexity =
|
|
719
|
+
(this.delegationMetrics.averageComplexity *
|
|
720
|
+
(this.delegationMetrics.totalDelegations - 1) +
|
|
721
|
+
result.complexity.score) /
|
|
722
|
+
this.delegationMetrics.totalDelegations;
|
|
723
|
+
this.delegationMetrics.strategyUsage[result.strategy] =
|
|
724
|
+
(this.delegationMetrics.strategyUsage[result.strategy] || 0) + 1;
|
|
725
|
+
}
|
|
726
|
+
recordSuccessfulDelegation(delegation, duration) {
|
|
727
|
+
this.delegationMetrics.successfulDelegations++;
|
|
728
|
+
this.delegationMetrics.averageDuration =
|
|
729
|
+
(this.delegationMetrics.averageDuration *
|
|
730
|
+
(this.delegationMetrics.successfulDelegations - 1) +
|
|
731
|
+
duration) /
|
|
732
|
+
this.delegationMetrics.successfulDelegations;
|
|
733
|
+
}
|
|
734
|
+
recordFailedDelegation(delegation, duration, error) {
|
|
735
|
+
this.delegationMetrics.failedDelegations++;
|
|
736
|
+
frameworkLogger.log("agent-delegator", "delegation execution failed", "error", {
|
|
737
|
+
error: error instanceof Error ? error.message : String(error),
|
|
738
|
+
});
|
|
739
|
+
console.error(`❌ Delegation failed: ${error instanceof Error ? error.message : error}`);
|
|
740
|
+
}
|
|
741
|
+
async logDelegationDecision(result, request) {
|
|
742
|
+
await frameworkLogger.log("agent-delegator", "delegation decision made", "info", {
|
|
743
|
+
strategy: result.strategy,
|
|
744
|
+
agents: result.agents,
|
|
745
|
+
complexity: result.complexity.score,
|
|
746
|
+
operation: request.operation,
|
|
747
|
+
});
|
|
748
|
+
console.log(`📋 Delegation Decision: ${result.strategy} strategy`);
|
|
749
|
+
console.log(` Agents: ${result.agents.join(", ")}`);
|
|
750
|
+
console.log(` Complexity: ${result.complexity.level} (${result.complexity.score})`);
|
|
751
|
+
console.log(` Reasoning: ${result.complexity.reasoning.slice(0, 2).join("; ")}`);
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Select default multi-agent team when manual override is requested
|
|
755
|
+
*/
|
|
756
|
+
selectDefaultMultiAgentTeam(request) {
|
|
757
|
+
const operation = request.operation.toLowerCase();
|
|
758
|
+
const context = request.context || {};
|
|
759
|
+
if (operation.includes("security") || operation.includes("audit")) {
|
|
760
|
+
return ["security-auditor", "code-reviewer", "enforcer"];
|
|
761
|
+
}
|
|
762
|
+
else if (operation.includes("refactor") ||
|
|
763
|
+
operation.includes("architecture")) {
|
|
764
|
+
return ["architect", "refactorer", "code-reviewer"];
|
|
765
|
+
}
|
|
766
|
+
else if (operation.includes("test") || operation.includes("quality")) {
|
|
767
|
+
return ["test-architect", "code-reviewer", "enforcer"];
|
|
768
|
+
}
|
|
769
|
+
else if (operation.includes("debug") || operation.includes("fix")) {
|
|
770
|
+
return ["bug-triage-specialist", "code-reviewer", "enforcer"];
|
|
771
|
+
}
|
|
772
|
+
else {
|
|
773
|
+
return ["architect", "code-reviewer", "security-auditor"];
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Format task description for oh-my-opencode agent system
|
|
778
|
+
*/
|
|
779
|
+
formatTaskForAgent(agentName, request) {
|
|
780
|
+
const operation = request.operation;
|
|
781
|
+
const description = request.description;
|
|
782
|
+
const context = request.context || {};
|
|
783
|
+
return `@${agentName} Please perform the following task:
|
|
784
|
+
|
|
785
|
+
Operation: ${operation}
|
|
786
|
+
Description: ${description}
|
|
787
|
+
|
|
788
|
+
Context: ${JSON.stringify(context, null, 2)}
|
|
789
|
+
|
|
790
|
+
Please analyze this request and provide your specialized assistance as a ${agentName} agent.`;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Invoke agent through oh-my-opencode system
|
|
794
|
+
*/
|
|
795
|
+
async invokeOhMyOpenCodeAgent(agentName, taskDescription) {
|
|
796
|
+
const omoAgent = await this.getOhMyOpenCodeAgent(agentName);
|
|
797
|
+
if (!omoAgent) {
|
|
798
|
+
throw new Error(`Agent ${agentName} not available in oh-my-opencode system`);
|
|
799
|
+
}
|
|
800
|
+
await frameworkLogger.log("agent-delegator", "invoking agent through oh-my-opencode system", "info", {
|
|
801
|
+
agentName,
|
|
802
|
+
taskDescription: taskDescription.substring(0, 100) + "...",
|
|
803
|
+
});
|
|
804
|
+
const startTime = Date.now();
|
|
805
|
+
const result = await omoAgent.execute(taskDescription);
|
|
806
|
+
const executionTime = Date.now() - startTime;
|
|
807
|
+
return {
|
|
808
|
+
success: true,
|
|
809
|
+
result: result,
|
|
810
|
+
executionTime,
|
|
811
|
+
agentName,
|
|
812
|
+
invokedThrough: "oh-my-opencode",
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Get agent from oh-my-opencode system
|
|
817
|
+
*/
|
|
818
|
+
async getOhMyOpenCodeAgent(agentName) {
|
|
819
|
+
const configuredAgents = [
|
|
820
|
+
"orchestrator",
|
|
821
|
+
"enforcer",
|
|
822
|
+
"architect",
|
|
823
|
+
"test-architect",
|
|
824
|
+
"bug-triage-specialist",
|
|
825
|
+
"code-reviewer",
|
|
826
|
+
"security-auditor",
|
|
827
|
+
"refactorer",
|
|
828
|
+
"librarian",
|
|
829
|
+
"explore",
|
|
830
|
+
"oracle",
|
|
831
|
+
"frontend-ui-ux-engineer",
|
|
832
|
+
"document-writer",
|
|
833
|
+
"multimodal-looker",
|
|
834
|
+
];
|
|
835
|
+
if (!configuredAgents.includes(agentName)) {
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
return {
|
|
839
|
+
execute: async (taskDescription) => {
|
|
840
|
+
const processingTime = this.simulateAgentExecutionTime(agentName, {
|
|
841
|
+
operation: "delegated-task",
|
|
842
|
+
description: "Delegated task execution",
|
|
843
|
+
context: {},
|
|
844
|
+
});
|
|
845
|
+
await new Promise((resolve) => setTimeout(resolve, processingTime));
|
|
846
|
+
return {
|
|
847
|
+
agent: agentName,
|
|
848
|
+
response: `Agent ${agentName} processed: ${taskDescription.substring(0, 100)}...`,
|
|
849
|
+
confidence: Math.random() * 0.3 + 0.7,
|
|
850
|
+
processingTime,
|
|
851
|
+
};
|
|
852
|
+
},
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Simulate agent execution (fallback when oh-my-opencode integration fails)
|
|
857
|
+
*/
|
|
858
|
+
async simulateAgentExecution(agentName, request) {
|
|
859
|
+
await frameworkLogger.log("agent-delegator", "simulating agent execution", "info", {
|
|
860
|
+
agentName,
|
|
861
|
+
operation: request.operation,
|
|
862
|
+
});
|
|
863
|
+
// Simulate execution time based on agent type
|
|
864
|
+
const executionTime = this.simulateAgentExecutionTime(agentName, request);
|
|
865
|
+
await new Promise((resolve) => setTimeout(resolve, executionTime));
|
|
866
|
+
return {
|
|
867
|
+
success: true,
|
|
868
|
+
result: `Agent ${agentName} completed task: ${request.operation}`,
|
|
869
|
+
executionTime,
|
|
870
|
+
agentName,
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Simulate agent execution time based on agent type
|
|
875
|
+
*/
|
|
876
|
+
simulateAgentExecutionTime(agentName, request) {
|
|
877
|
+
const baseTime = 1000;
|
|
878
|
+
const agentMultipliers = {
|
|
879
|
+
enforcer: 1.5,
|
|
880
|
+
architect: 2.0,
|
|
881
|
+
orchestrator: 1.8,
|
|
882
|
+
"bug-triage-specialist": 1.2,
|
|
883
|
+
"code-reviewer": 1.6,
|
|
884
|
+
"security-auditor": 2.5,
|
|
885
|
+
refactorer: 2.2,
|
|
886
|
+
"test-architect": 1.4,
|
|
887
|
+
};
|
|
888
|
+
const multiplier = agentMultipliers[agentName] || 1.0;
|
|
889
|
+
const complexity = request.context?.estimatedDuration || 1000;
|
|
890
|
+
return Math.min(baseTime * multiplier + complexity * 0.1, 10000);
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Parse @mention from text input
|
|
894
|
+
*/
|
|
895
|
+
parseMention(text) {
|
|
896
|
+
const mentionRegex = /@([a-zA-Z-]+)\s*/;
|
|
897
|
+
const match = text.match(mentionRegex);
|
|
898
|
+
if (match) {
|
|
899
|
+
const agentName = match[1];
|
|
900
|
+
const configuredAgents = [
|
|
901
|
+
"orchestrator",
|
|
902
|
+
"enforcer",
|
|
903
|
+
"architect",
|
|
904
|
+
"test-architect",
|
|
905
|
+
"bug-triage-specialist",
|
|
906
|
+
"code-reviewer",
|
|
907
|
+
"security-auditor",
|
|
908
|
+
"refactorer",
|
|
909
|
+
"librarian",
|
|
910
|
+
"explore",
|
|
911
|
+
"oracle",
|
|
912
|
+
"frontend-ui-ux-engineer",
|
|
913
|
+
"document-writer",
|
|
914
|
+
"multimodal-looker",
|
|
915
|
+
];
|
|
916
|
+
if (configuredAgents.includes(agentName)) {
|
|
917
|
+
const cleanText = text.replace(mentionRegex, "").trim();
|
|
918
|
+
return { agentName, cleanText };
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
return { cleanText: text };
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
// Export singleton instance factory
|
|
925
|
+
export const createAgentDelegator = (stateManager) => {
|
|
926
|
+
return new AgentDelegator(stateManager);
|
|
927
|
+
};
|
|
928
|
+
//# sourceMappingURL=agent-delegator.js.map
|