@pcircle/claude-code-buddy-mcp 2.3.1
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/LICENSE +661 -0
- package/README.md +599 -0
- package/README.zh-TW.md +577 -0
- package/dist/__benchmarks__/performance-fixes.bench.d.ts +8 -0
- package/dist/__benchmarks__/performance-fixes.bench.d.ts.map +1 -0
- package/dist/__benchmarks__/performance-fixes.bench.js +213 -0
- package/dist/__benchmarks__/performance-fixes.bench.js.map +1 -0
- package/dist/agents/DevelopmentButler.d.ts +80 -0
- package/dist/agents/DevelopmentButler.d.ts.map +1 -0
- package/dist/agents/DevelopmentButler.js +328 -0
- package/dist/agents/DevelopmentButler.js.map +1 -0
- package/dist/agents/E2EHealingAgent.d.ts +30 -0
- package/dist/agents/E2EHealingAgent.d.ts.map +1 -0
- package/dist/agents/E2EHealingAgent.js +162 -0
- package/dist/agents/E2EHealingAgent.js.map +1 -0
- package/dist/agents/TestWriterAgent.d.ts +26 -0
- package/dist/agents/TestWriterAgent.d.ts.map +1 -0
- package/dist/agents/TestWriterAgent.js +139 -0
- package/dist/agents/TestWriterAgent.js.map +1 -0
- package/dist/agents/base/AgentExecutor.d.ts +7 -0
- package/dist/agents/base/AgentExecutor.d.ts.map +1 -0
- package/dist/agents/base/AgentExecutor.js +13 -0
- package/dist/agents/base/AgentExecutor.js.map +1 -0
- package/dist/agents/base/index.d.ts +2 -0
- package/dist/agents/base/index.d.ts.map +1 -0
- package/dist/agents/base/index.js +2 -0
- package/dist/agents/base/index.js.map +1 -0
- package/dist/agents/e2e-healing/analyzers/EvidenceCollector.d.ts +24 -0
- package/dist/agents/e2e-healing/analyzers/EvidenceCollector.d.ts.map +1 -0
- package/dist/agents/e2e-healing/analyzers/EvidenceCollector.js +55 -0
- package/dist/agents/e2e-healing/analyzers/EvidenceCollector.js.map +1 -0
- package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.d.ts +22 -0
- package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.d.ts.map +1 -0
- package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.js +36 -0
- package/dist/agents/e2e-healing/analyzers/FailureAnalyzer.js.map +1 -0
- package/dist/agents/e2e-healing/config.d.ts +4 -0
- package/dist/agents/e2e-healing/config.d.ts.map +1 -0
- package/dist/agents/e2e-healing/config.js +28 -0
- package/dist/agents/e2e-healing/config.js.map +1 -0
- package/dist/agents/e2e-healing/generators/FixGenerator.d.ts +21 -0
- package/dist/agents/e2e-healing/generators/FixGenerator.d.ts.map +1 -0
- package/dist/agents/e2e-healing/generators/FixGenerator.js +33 -0
- package/dist/agents/e2e-healing/generators/FixGenerator.js.map +1 -0
- package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.d.ts +29 -0
- package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.d.ts.map +1 -0
- package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.js +70 -0
- package/dist/agents/e2e-healing/orchestrator/TestOrchestrator.js.map +1 -0
- package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.d.ts +30 -0
- package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.d.ts.map +1 -0
- package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.js +115 -0
- package/dist/agents/e2e-healing/policy/GraduatedAutonomyPolicy.js.map +1 -0
- package/dist/agents/e2e-healing/runners/PlaywrightRunner.d.ts +19 -0
- package/dist/agents/e2e-healing/runners/PlaywrightRunner.d.ts.map +1 -0
- package/dist/agents/e2e-healing/runners/PlaywrightRunner.js +79 -0
- package/dist/agents/e2e-healing/runners/PlaywrightRunner.js.map +1 -0
- package/dist/agents/e2e-healing/safety/CircuitBreaker.d.ts +26 -0
- package/dist/agents/e2e-healing/safety/CircuitBreaker.d.ts.map +1 -0
- package/dist/agents/e2e-healing/safety/CircuitBreaker.js +75 -0
- package/dist/agents/e2e-healing/safety/CircuitBreaker.js.map +1 -0
- package/dist/agents/e2e-healing/safety/RollbackManager.d.ts +31 -0
- package/dist/agents/e2e-healing/safety/RollbackManager.d.ts.map +1 -0
- package/dist/agents/e2e-healing/safety/RollbackManager.js +130 -0
- package/dist/agents/e2e-healing/safety/RollbackManager.js.map +1 -0
- package/dist/agents/e2e-healing/safety/SafetyGate.d.ts +21 -0
- package/dist/agents/e2e-healing/safety/SafetyGate.d.ts.map +1 -0
- package/dist/agents/e2e-healing/safety/SafetyGate.js +62 -0
- package/dist/agents/e2e-healing/safety/SafetyGate.js.map +1 -0
- package/dist/agents/e2e-healing/safety/ScopeLimiter.d.ts +14 -0
- package/dist/agents/e2e-healing/safety/ScopeLimiter.d.ts.map +1 -0
- package/dist/agents/e2e-healing/safety/ScopeLimiter.js +36 -0
- package/dist/agents/e2e-healing/safety/ScopeLimiter.js.map +1 -0
- package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.d.ts +29 -0
- package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.d.ts.map +1 -0
- package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.js +86 -0
- package/dist/agents/e2e-healing/sdk/AgentSDKAdapter.js.map +1 -0
- package/dist/agents/e2e-healing/types.d.ts +46 -0
- package/dist/agents/e2e-healing/types.d.ts.map +1 -0
- package/dist/agents/e2e-healing/types.js +2 -0
- package/dist/agents/e2e-healing/types.js.map +1 -0
- package/dist/agents/knowledge/KnowledgeGraph.d.ts +26 -0
- package/dist/agents/knowledge/KnowledgeGraph.d.ts.map +1 -0
- package/dist/agents/knowledge/KnowledgeGraph.js +106 -0
- package/dist/agents/knowledge/KnowledgeGraph.js.map +1 -0
- package/dist/agents/knowledge/KnowledgeGraphSQLite.d.ts +42 -0
- package/dist/agents/knowledge/KnowledgeGraphSQLite.d.ts.map +1 -0
- package/dist/agents/knowledge/KnowledgeGraphSQLite.js +349 -0
- package/dist/agents/knowledge/KnowledgeGraphSQLite.js.map +1 -0
- package/dist/agents/knowledge/index.d.ts +94 -0
- package/dist/agents/knowledge/index.d.ts.map +1 -0
- package/dist/agents/knowledge/index.js +296 -0
- package/dist/agents/knowledge/index.js.map +1 -0
- package/dist/agents/knowledge/storage/KnowledgeGraphStore.d.ts +25 -0
- package/dist/agents/knowledge/storage/KnowledgeGraphStore.d.ts.map +1 -0
- package/dist/agents/knowledge/storage/KnowledgeGraphStore.js +342 -0
- package/dist/agents/knowledge/storage/KnowledgeGraphStore.js.map +1 -0
- package/dist/agents/knowledge/types.d.ts +21 -0
- package/dist/agents/knowledge/types.d.ts.map +1 -0
- package/dist/agents/knowledge/types.js +2 -0
- package/dist/agents/knowledge/types.js.map +1 -0
- package/dist/agents/templates/ci-templates.d.ts +8 -0
- package/dist/agents/templates/ci-templates.d.ts.map +1 -0
- package/dist/agents/templates/ci-templates.js +119 -0
- package/dist/agents/templates/ci-templates.js.map +1 -0
- package/dist/agents/templates/test-templates.d.ts +18 -0
- package/dist/agents/templates/test-templates.d.ts.map +1 -0
- package/dist/agents/templates/test-templates.js +22 -0
- package/dist/agents/templates/test-templates.js.map +1 -0
- package/dist/config/index.d.ts +51 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +96 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/models.d.ts +47 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +57 -0
- package/dist/config/models.js.map +1 -0
- package/dist/config/simple-config.d.ts +32 -0
- package/dist/config/simple-config.d.ts.map +1 -0
- package/dist/config/simple-config.js +225 -0
- package/dist/config/simple-config.js.map +1 -0
- package/dist/core/AgentRegistry.d.ts +32 -0
- package/dist/core/AgentRegistry.d.ts.map +1 -0
- package/dist/core/AgentRegistry.js +281 -0
- package/dist/core/AgentRegistry.js.map +1 -0
- package/dist/core/BackgroundExecutor.d.ts +56 -0
- package/dist/core/BackgroundExecutor.d.ts.map +1 -0
- package/dist/core/BackgroundExecutor.js +492 -0
- package/dist/core/BackgroundExecutor.js.map +1 -0
- package/dist/core/BackgroundExecutorConstants.d.ts +8 -0
- package/dist/core/BackgroundExecutorConstants.d.ts.map +1 -0
- package/dist/core/BackgroundExecutorConstants.js +8 -0
- package/dist/core/BackgroundExecutorConstants.js.map +1 -0
- package/dist/core/CheckpointDetector.d.ts +25 -0
- package/dist/core/CheckpointDetector.d.ts.map +1 -0
- package/dist/core/CheckpointDetector.js +67 -0
- package/dist/core/CheckpointDetector.js.map +1 -0
- package/dist/core/ExecutionMonitor.d.ts +29 -0
- package/dist/core/ExecutionMonitor.d.ts.map +1 -0
- package/dist/core/ExecutionMonitor.js +124 -0
- package/dist/core/ExecutionMonitor.js.map +1 -0
- package/dist/core/ExecutionQueue.d.ts +21 -0
- package/dist/core/ExecutionQueue.d.ts.map +1 -0
- package/dist/core/ExecutionQueue.js +104 -0
- package/dist/core/ExecutionQueue.js.map +1 -0
- package/dist/core/HealthCheck.d.ts +39 -0
- package/dist/core/HealthCheck.d.ts.map +1 -0
- package/dist/core/HealthCheck.js +219 -0
- package/dist/core/HealthCheck.js.map +1 -0
- package/dist/core/HookIntegration.d.ts +45 -0
- package/dist/core/HookIntegration.d.ts.map +1 -0
- package/dist/core/HookIntegration.js +241 -0
- package/dist/core/HookIntegration.js.map +1 -0
- package/dist/core/MCPToolInterface.d.ts +120 -0
- package/dist/core/MCPToolInterface.d.ts.map +1 -0
- package/dist/core/MCPToolInterface.js +376 -0
- package/dist/core/MCPToolInterface.js.map +1 -0
- package/dist/core/PromptEnhancer.d.ts +13 -0
- package/dist/core/PromptEnhancer.d.ts.map +1 -0
- package/dist/core/PromptEnhancer.js +112 -0
- package/dist/core/PromptEnhancer.js.map +1 -0
- package/dist/core/ResourceMonitor.d.ts +32 -0
- package/dist/core/ResourceMonitor.d.ts.map +1 -0
- package/dist/core/ResourceMonitor.js +181 -0
- package/dist/core/ResourceMonitor.js.map +1 -0
- package/dist/core/ResultHandler.d.ts +9 -0
- package/dist/core/ResultHandler.d.ts.map +1 -0
- package/dist/core/ResultHandler.js +60 -0
- package/dist/core/ResultHandler.js.map +1 -0
- package/dist/core/ServiceLocator.d.ts +10 -0
- package/dist/core/ServiceLocator.d.ts.map +1 -0
- package/dist/core/ServiceLocator.js +29 -0
- package/dist/core/ServiceLocator.js.map +1 -0
- package/dist/core/SessionContextMonitor.d.ts +41 -0
- package/dist/core/SessionContextMonitor.d.ts.map +1 -0
- package/dist/core/SessionContextMonitor.js +156 -0
- package/dist/core/SessionContextMonitor.js.map +1 -0
- package/dist/core/SessionTokenTracker.d.ts +43 -0
- package/dist/core/SessionTokenTracker.d.ts.map +1 -0
- package/dist/core/SessionTokenTracker.js +76 -0
- package/dist/core/SessionTokenTracker.js.map +1 -0
- package/dist/core/TaskScheduler.d.ts +19 -0
- package/dist/core/TaskScheduler.d.ts.map +1 -0
- package/dist/core/TaskScheduler.js +59 -0
- package/dist/core/TaskScheduler.js.map +1 -0
- package/dist/core/WorkflowGuidanceEngine.d.ts +35 -0
- package/dist/core/WorkflowGuidanceEngine.d.ts.map +1 -0
- package/dist/core/WorkflowGuidanceEngine.js +104 -0
- package/dist/core/WorkflowGuidanceEngine.js.map +1 -0
- package/dist/core/types.d.ts +66 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +11 -0
- package/dist/core/types.js.map +1 -0
- package/dist/db/ConnectionPool.d.ts +47 -0
- package/dist/db/ConnectionPool.d.ts.map +1 -0
- package/dist/db/ConnectionPool.js +432 -0
- package/dist/db/ConnectionPool.js.map +1 -0
- package/dist/db/QueryCache.d.ts +46 -0
- package/dist/db/QueryCache.d.ts.map +1 -0
- package/dist/db/QueryCache.js +229 -0
- package/dist/db/QueryCache.js.map +1 -0
- package/dist/errors/index.d.ts +62 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +124 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/evolution/ABTestManager.d.ts +21 -0
- package/dist/evolution/ABTestManager.d.ts.map +1 -0
- package/dist/evolution/ABTestManager.js +183 -0
- package/dist/evolution/ABTestManager.js.map +1 -0
- package/dist/evolution/AdaptationEngine.d.ts +60 -0
- package/dist/evolution/AdaptationEngine.d.ts.map +1 -0
- package/dist/evolution/AdaptationEngine.js +313 -0
- package/dist/evolution/AdaptationEngine.js.map +1 -0
- package/dist/evolution/AgentEvolutionConfig.d.ts +32 -0
- package/dist/evolution/AgentEvolutionConfig.d.ts.map +1 -0
- package/dist/evolution/AgentEvolutionConfig.js +329 -0
- package/dist/evolution/AgentEvolutionConfig.js.map +1 -0
- package/dist/evolution/ContextMatcher.d.ts +24 -0
- package/dist/evolution/ContextMatcher.d.ts.map +1 -0
- package/dist/evolution/ContextMatcher.js +85 -0
- package/dist/evolution/ContextMatcher.js.map +1 -0
- package/dist/evolution/EvolutionBootstrap.d.ts +69 -0
- package/dist/evolution/EvolutionBootstrap.d.ts.map +1 -0
- package/dist/evolution/EvolutionBootstrap.js +332 -0
- package/dist/evolution/EvolutionBootstrap.js.map +1 -0
- package/dist/evolution/EvolutionMonitor.d.ts +111 -0
- package/dist/evolution/EvolutionMonitor.d.ts.map +1 -0
- package/dist/evolution/EvolutionMonitor.js +540 -0
- package/dist/evolution/EvolutionMonitor.js.map +1 -0
- package/dist/evolution/FeedbackCollector.d.ts +26 -0
- package/dist/evolution/FeedbackCollector.d.ts.map +1 -0
- package/dist/evolution/FeedbackCollector.js +93 -0
- package/dist/evolution/FeedbackCollector.js.map +1 -0
- package/dist/evolution/KnowledgeTransferManager.d.ts +16 -0
- package/dist/evolution/KnowledgeTransferManager.d.ts.map +1 -0
- package/dist/evolution/KnowledgeTransferManager.js +34 -0
- package/dist/evolution/KnowledgeTransferManager.js.map +1 -0
- package/dist/evolution/LearningManager.d.ts +79 -0
- package/dist/evolution/LearningManager.d.ts.map +1 -0
- package/dist/evolution/LearningManager.js +582 -0
- package/dist/evolution/LearningManager.js.map +1 -0
- package/dist/evolution/LearningManagerConstants.d.ts +55 -0
- package/dist/evolution/LearningManagerConstants.d.ts.map +1 -0
- package/dist/evolution/LearningManagerConstants.js +55 -0
- package/dist/evolution/LearningManagerConstants.js.map +1 -0
- package/dist/evolution/MultiObjectiveOptimizer.d.ts +9 -0
- package/dist/evolution/MultiObjectiveOptimizer.d.ts.map +1 -0
- package/dist/evolution/MultiObjectiveOptimizer.js +92 -0
- package/dist/evolution/MultiObjectiveOptimizer.js.map +1 -0
- package/dist/evolution/PatternExplainer.d.ts +14 -0
- package/dist/evolution/PatternExplainer.d.ts.map +1 -0
- package/dist/evolution/PatternExplainer.js +113 -0
- package/dist/evolution/PatternExplainer.js.map +1 -0
- package/dist/evolution/PerformanceTracker.d.ts +43 -0
- package/dist/evolution/PerformanceTracker.d.ts.map +1 -0
- package/dist/evolution/PerformanceTracker.js +453 -0
- package/dist/evolution/PerformanceTracker.js.map +1 -0
- package/dist/evolution/PerformanceTrackerConstants.d.ts +5 -0
- package/dist/evolution/PerformanceTrackerConstants.d.ts.map +1 -0
- package/dist/evolution/PerformanceTrackerConstants.js +5 -0
- package/dist/evolution/PerformanceTrackerConstants.js.map +1 -0
- package/dist/evolution/StatisticalAnalyzer.d.ts +20 -0
- package/dist/evolution/StatisticalAnalyzer.d.ts.map +1 -0
- package/dist/evolution/StatisticalAnalyzer.js +154 -0
- package/dist/evolution/StatisticalAnalyzer.js.map +1 -0
- package/dist/evolution/TransferabilityChecker.d.ts +11 -0
- package/dist/evolution/TransferabilityChecker.d.ts.map +1 -0
- package/dist/evolution/TransferabilityChecker.js +78 -0
- package/dist/evolution/TransferabilityChecker.js.map +1 -0
- package/dist/evolution/index.d.ts +11 -0
- package/dist/evolution/index.d.ts.map +1 -0
- package/dist/evolution/index.js +9 -0
- package/dist/evolution/index.js.map +1 -0
- package/dist/evolution/instrumentation/SpanTracker.d.ts +64 -0
- package/dist/evolution/instrumentation/SpanTracker.d.ts.map +1 -0
- package/dist/evolution/instrumentation/SpanTracker.js +229 -0
- package/dist/evolution/instrumentation/SpanTracker.js.map +1 -0
- package/dist/evolution/instrumentation/withEvolutionTracking.d.ts +19 -0
- package/dist/evolution/instrumentation/withEvolutionTracking.d.ts.map +1 -0
- package/dist/evolution/instrumentation/withEvolutionTracking.js +256 -0
- package/dist/evolution/instrumentation/withEvolutionTracking.js.map +1 -0
- package/dist/evolution/integration-test-scenarios.d.ts +56 -0
- package/dist/evolution/integration-test-scenarios.d.ts.map +1 -0
- package/dist/evolution/integration-test-scenarios.js +131 -0
- package/dist/evolution/integration-test-scenarios.js.map +1 -0
- package/dist/evolution/links/LinkManager.d.ts +17 -0
- package/dist/evolution/links/LinkManager.d.ts.map +1 -0
- package/dist/evolution/links/LinkManager.js +41 -0
- package/dist/evolution/links/LinkManager.js.map +1 -0
- package/dist/evolution/storage/EvolutionStore.d.ts +87 -0
- package/dist/evolution/storage/EvolutionStore.d.ts.map +1 -0
- package/dist/evolution/storage/EvolutionStore.js +2 -0
- package/dist/evolution/storage/EvolutionStore.js.map +1 -0
- package/dist/evolution/storage/IEvolutionStore.d.ts +87 -0
- package/dist/evolution/storage/IEvolutionStore.d.ts.map +1 -0
- package/dist/evolution/storage/IEvolutionStore.js +2 -0
- package/dist/evolution/storage/IEvolutionStore.js.map +1 -0
- package/dist/evolution/storage/SQLiteStore.d.ts +115 -0
- package/dist/evolution/storage/SQLiteStore.d.ts.map +1 -0
- package/dist/evolution/storage/SQLiteStore.enhanced.d.ts +35 -0
- package/dist/evolution/storage/SQLiteStore.enhanced.d.ts.map +1 -0
- package/dist/evolution/storage/SQLiteStore.enhanced.js +514 -0
- package/dist/evolution/storage/SQLiteStore.enhanced.js.map +1 -0
- package/dist/evolution/storage/SQLiteStore.js +915 -0
- package/dist/evolution/storage/SQLiteStore.js.map +1 -0
- package/dist/evolution/storage/deprecated/SQLiteStore.basic.d.ts +109 -0
- package/dist/evolution/storage/deprecated/SQLiteStore.basic.d.ts.map +1 -0
- package/dist/evolution/storage/deprecated/SQLiteStore.basic.js +1033 -0
- package/dist/evolution/storage/deprecated/SQLiteStore.basic.js.map +1 -0
- package/dist/evolution/storage/index.d.ts +6 -0
- package/dist/evolution/storage/index.d.ts.map +1 -0
- package/dist/evolution/storage/index.js +3 -0
- package/dist/evolution/storage/index.js.map +1 -0
- package/dist/evolution/storage/migrations/MigrationManager.d.ts +17 -0
- package/dist/evolution/storage/migrations/MigrationManager.d.ts.map +1 -0
- package/dist/evolution/storage/migrations/MigrationManager.js +242 -0
- package/dist/evolution/storage/migrations/MigrationManager.js.map +1 -0
- package/dist/evolution/storage/repositories/AdaptationRepository.d.ts +17 -0
- package/dist/evolution/storage/repositories/AdaptationRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/AdaptationRepository.js +82 -0
- package/dist/evolution/storage/repositories/AdaptationRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/CostRecordsRepository.d.ts +43 -0
- package/dist/evolution/storage/repositories/CostRecordsRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/CostRecordsRepository.js +157 -0
- package/dist/evolution/storage/repositories/CostRecordsRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/ExecutionRepository.d.ts +12 -0
- package/dist/evolution/storage/repositories/ExecutionRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/ExecutionRepository.js +87 -0
- package/dist/evolution/storage/repositories/ExecutionRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/PatternRepository.d.ts +12 -0
- package/dist/evolution/storage/repositories/PatternRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/PatternRepository.js +150 -0
- package/dist/evolution/storage/repositories/PatternRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/PerformanceMetricsRepository.d.ts +39 -0
- package/dist/evolution/storage/repositories/PerformanceMetricsRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/PerformanceMetricsRepository.js +130 -0
- package/dist/evolution/storage/repositories/PerformanceMetricsRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/RewardRepository.d.ts +17 -0
- package/dist/evolution/storage/repositories/RewardRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/RewardRepository.js +82 -0
- package/dist/evolution/storage/repositories/RewardRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/SpanRepository.d.ts +14 -0
- package/dist/evolution/storage/repositories/SpanRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/SpanRepository.js +191 -0
- package/dist/evolution/storage/repositories/SpanRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/StatsRepository.d.ts +16 -0
- package/dist/evolution/storage/repositories/StatsRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/StatsRepository.js +271 -0
- package/dist/evolution/storage/repositories/StatsRepository.js.map +1 -0
- package/dist/evolution/storage/repositories/TaskRepository.d.ts +16 -0
- package/dist/evolution/storage/repositories/TaskRepository.d.ts.map +1 -0
- package/dist/evolution/storage/repositories/TaskRepository.js +93 -0
- package/dist/evolution/storage/repositories/TaskRepository.js.map +1 -0
- package/dist/evolution/storage/schema.d.ts +81 -0
- package/dist/evolution/storage/schema.d.ts.map +1 -0
- package/dist/evolution/storage/schema.js +241 -0
- package/dist/evolution/storage/schema.js.map +1 -0
- package/dist/evolution/storage/types.d.ts +402 -0
- package/dist/evolution/storage/types.d.ts.map +1 -0
- package/dist/evolution/storage/types.js +2 -0
- package/dist/evolution/storage/types.js.map +1 -0
- package/dist/evolution/storage/validation.d.ts +12 -0
- package/dist/evolution/storage/validation.d.ts.map +1 -0
- package/dist/evolution/storage/validation.js +88 -0
- package/dist/evolution/storage/validation.js.map +1 -0
- package/dist/evolution/types.d.ts +214 -0
- package/dist/evolution/types.d.ts.map +1 -0
- package/dist/evolution/types.js +2 -0
- package/dist/evolution/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge-graph/index.d.ts +27 -0
- package/dist/knowledge-graph/index.d.ts.map +1 -0
- package/dist/knowledge-graph/index.js +353 -0
- package/dist/knowledge-graph/index.js.map +1 -0
- package/dist/knowledge-graph/types.d.ts +37 -0
- package/dist/knowledge-graph/types.d.ts.map +1 -0
- package/dist/knowledge-graph/types.js +2 -0
- package/dist/knowledge-graph/types.js.map +1 -0
- package/dist/management/UninstallManager.d.ts +23 -0
- package/dist/management/UninstallManager.d.ts.map +1 -0
- package/dist/management/UninstallManager.js +186 -0
- package/dist/management/UninstallManager.js.map +1 -0
- package/dist/management/index.d.ts +3 -0
- package/dist/management/index.d.ts.map +1 -0
- package/dist/management/index.js +2 -0
- package/dist/management/index.js.map +1 -0
- package/dist/mcp/BuddyCommands.d.ts +13 -0
- package/dist/mcp/BuddyCommands.d.ts.map +1 -0
- package/dist/mcp/BuddyCommands.js +110 -0
- package/dist/mcp/BuddyCommands.js.map +1 -0
- package/dist/mcp/ClaudeMdReloader.d.ts +37 -0
- package/dist/mcp/ClaudeMdReloader.d.ts.map +1 -0
- package/dist/mcp/ClaudeMdReloader.js +92 -0
- package/dist/mcp/ClaudeMdReloader.js.map +1 -0
- package/dist/mcp/HumanInLoopUI.d.ts +23 -0
- package/dist/mcp/HumanInLoopUI.d.ts.map +1 -0
- package/dist/mcp/HumanInLoopUI.js +92 -0
- package/dist/mcp/HumanInLoopUI.js.map +1 -0
- package/dist/mcp/ServerInitializer.d.ts +47 -0
- package/dist/mcp/ServerInitializer.d.ts.map +1 -0
- package/dist/mcp/ServerInitializer.js +89 -0
- package/dist/mcp/ServerInitializer.js.map +1 -0
- package/dist/mcp/SessionBootstrapper.d.ts +11 -0
- package/dist/mcp/SessionBootstrapper.d.ts.map +1 -0
- package/dist/mcp/SessionBootstrapper.js +67 -0
- package/dist/mcp/SessionBootstrapper.js.map +1 -0
- package/dist/mcp/ToolDefinitions.d.ts +42 -0
- package/dist/mcp/ToolDefinitions.d.ts.map +1 -0
- package/dist/mcp/ToolDefinitions.js +234 -0
- package/dist/mcp/ToolDefinitions.js.map +1 -0
- package/dist/mcp/ToolRouter.d.ts +22 -0
- package/dist/mcp/ToolRouter.d.ts.map +1 -0
- package/dist/mcp/ToolRouter.js +102 -0
- package/dist/mcp/ToolRouter.js.map +1 -0
- package/dist/mcp/handlers/BuddyHandlers.d.ts +14 -0
- package/dist/mcp/handlers/BuddyHandlers.d.ts.map +1 -0
- package/dist/mcp/handlers/BuddyHandlers.js +152 -0
- package/dist/mcp/handlers/BuddyHandlers.js.map +1 -0
- package/dist/mcp/handlers/ResourceHandlers.d.ts +3 -0
- package/dist/mcp/handlers/ResourceHandlers.d.ts.map +1 -0
- package/dist/mcp/handlers/ResourceHandlers.js +86 -0
- package/dist/mcp/handlers/ResourceHandlers.js.map +1 -0
- package/dist/mcp/handlers/ToolHandlers.d.ts +52 -0
- package/dist/mcp/handlers/ToolHandlers.d.ts.map +1 -0
- package/dist/mcp/handlers/ToolHandlers.js +914 -0
- package/dist/mcp/handlers/ToolHandlers.js.map +1 -0
- package/dist/mcp/handlers/index.d.ts +4 -0
- package/dist/mcp/handlers/index.d.ts.map +1 -0
- package/dist/mcp/handlers/index.js +4 -0
- package/dist/mcp/handlers/index.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/schemas/OutputSchemas.d.ts +368 -0
- package/dist/mcp/schemas/OutputSchemas.d.ts.map +1 -0
- package/dist/mcp/schemas/OutputSchemas.js +191 -0
- package/dist/mcp/schemas/OutputSchemas.js.map +1 -0
- package/dist/mcp/server.d.ts +17 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +184 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/add-observations.d.ts +48 -0
- package/dist/mcp/tools/add-observations.d.ts.map +1 -0
- package/dist/mcp/tools/add-observations.js +64 -0
- package/dist/mcp/tools/add-observations.js.map +1 -0
- package/dist/mcp/tools/buddy-do.d.ts +14 -0
- package/dist/mcp/tools/buddy-do.d.ts.map +1 -0
- package/dist/mcp/tools/buddy-do.js +77 -0
- package/dist/mcp/tools/buddy-do.js.map +1 -0
- package/dist/mcp/tools/buddy-help.d.ts +13 -0
- package/dist/mcp/tools/buddy-help.d.ts.map +1 -0
- package/dist/mcp/tools/buddy-help.js +52 -0
- package/dist/mcp/tools/buddy-help.js.map +1 -0
- package/dist/mcp/tools/buddy-remember.d.ts +15 -0
- package/dist/mcp/tools/buddy-remember.d.ts.map +1 -0
- package/dist/mcp/tools/buddy-remember.js +77 -0
- package/dist/mcp/tools/buddy-remember.js.map +1 -0
- package/dist/mcp/tools/create-entities.d.ts +57 -0
- package/dist/mcp/tools/create-entities.d.ts.map +1 -0
- package/dist/mcp/tools/create-entities.js +64 -0
- package/dist/mcp/tools/create-entities.js.map +1 -0
- package/dist/mcp/tools/create-relations.d.ts +60 -0
- package/dist/mcp/tools/create-relations.d.ts.map +1 -0
- package/dist/mcp/tools/create-relations.js +84 -0
- package/dist/mcp/tools/create-relations.js.map +1 -0
- package/dist/mcp/tools/health-check.d.ts +10 -0
- package/dist/mcp/tools/health-check.d.ts.map +1 -0
- package/dist/mcp/tools/health-check.js +37 -0
- package/dist/mcp/tools/health-check.js.map +1 -0
- package/dist/mcp/tools/recall-memory.d.ts +31 -0
- package/dist/mcp/tools/recall-memory.d.ts.map +1 -0
- package/dist/mcp/tools/recall-memory.js +31 -0
- package/dist/mcp/tools/recall-memory.js.map +1 -0
- package/dist/mcp/validation.d.ts +88 -0
- package/dist/mcp/validation.d.ts.map +1 -0
- package/dist/mcp/validation.js +119 -0
- package/dist/mcp/validation.js.map +1 -0
- package/dist/memory/ProjectAutoTracker.d.ts +36 -0
- package/dist/memory/ProjectAutoTracker.d.ts.map +1 -0
- package/dist/memory/ProjectAutoTracker.js +200 -0
- package/dist/memory/ProjectAutoTracker.js.map +1 -0
- package/dist/memory/ProjectMemoryCleanup.d.ts +17 -0
- package/dist/memory/ProjectMemoryCleanup.d.ts.map +1 -0
- package/dist/memory/ProjectMemoryCleanup.js +57 -0
- package/dist/memory/ProjectMemoryCleanup.js.map +1 -0
- package/dist/memory/ProjectMemoryManager.d.ts +15 -0
- package/dist/memory/ProjectMemoryManager.d.ts.map +1 -0
- package/dist/memory/ProjectMemoryManager.js +36 -0
- package/dist/memory/ProjectMemoryManager.js.map +1 -0
- package/dist/orchestrator/AgentRouter.d.ts +20 -0
- package/dist/orchestrator/AgentRouter.d.ts.map +1 -0
- package/dist/orchestrator/AgentRouter.js +274 -0
- package/dist/orchestrator/AgentRouter.js.map +1 -0
- package/dist/orchestrator/CostTracker.d.ts +25 -0
- package/dist/orchestrator/CostTracker.d.ts.map +1 -0
- package/dist/orchestrator/CostTracker.js +199 -0
- package/dist/orchestrator/CostTracker.js.map +1 -0
- package/dist/orchestrator/GlobalResourcePool.d.ts +59 -0
- package/dist/orchestrator/GlobalResourcePool.d.ts.map +1 -0
- package/dist/orchestrator/GlobalResourcePool.js +224 -0
- package/dist/orchestrator/GlobalResourcePool.js.map +1 -0
- package/dist/orchestrator/GlobalResourcePoolConstants.d.ts +22 -0
- package/dist/orchestrator/GlobalResourcePoolConstants.d.ts.map +1 -0
- package/dist/orchestrator/GlobalResourcePoolConstants.js +22 -0
- package/dist/orchestrator/GlobalResourcePoolConstants.js.map +1 -0
- package/dist/orchestrator/TaskAnalyzer.d.ts +15 -0
- package/dist/orchestrator/TaskAnalyzer.d.ts.map +1 -0
- package/dist/orchestrator/TaskAnalyzer.js +234 -0
- package/dist/orchestrator/TaskAnalyzer.js.map +1 -0
- package/dist/orchestrator/TaskAnalyzerConstants.d.ts +16 -0
- package/dist/orchestrator/TaskAnalyzerConstants.d.ts.map +1 -0
- package/dist/orchestrator/TaskAnalyzerConstants.js +16 -0
- package/dist/orchestrator/TaskAnalyzerConstants.js.map +1 -0
- package/dist/orchestrator/example.d.ts +2 -0
- package/dist/orchestrator/example.d.ts.map +1 -0
- package/dist/orchestrator/example.js +118 -0
- package/dist/orchestrator/example.js.map +1 -0
- package/dist/orchestrator/index.d.ts +82 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +364 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/router.d.ts +48 -0
- package/dist/orchestrator/router.d.ts.map +1 -0
- package/dist/orchestrator/router.js +126 -0
- package/dist/orchestrator/router.js.map +1 -0
- package/dist/orchestrator/types.d.ts +60 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +2 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/planning/PlanningEngine.d.ts +52 -0
- package/dist/planning/PlanningEngine.d.ts.map +1 -0
- package/dist/planning/PlanningEngine.js +271 -0
- package/dist/planning/PlanningEngine.js.map +1 -0
- package/dist/planning/TaskDecomposer.d.ts +32 -0
- package/dist/planning/TaskDecomposer.d.ts.map +1 -0
- package/dist/planning/TaskDecomposer.js +152 -0
- package/dist/planning/TaskDecomposer.js.map +1 -0
- package/dist/prompts/templates/PromptTemplates.d.ts +11 -0
- package/dist/prompts/templates/PromptTemplates.d.ts.map +1 -0
- package/dist/prompts/templates/PromptTemplates.js +942 -0
- package/dist/prompts/templates/PromptTemplates.js.map +1 -0
- package/dist/prompts/templates/index.d.ts +2 -0
- package/dist/prompts/templates/index.d.ts.map +1 -0
- package/dist/prompts/templates/index.js +2 -0
- package/dist/prompts/templates/index.js.map +1 -0
- package/dist/skills/SkillManager.d.ts +33 -0
- package/dist/skills/SkillManager.d.ts.map +1 -0
- package/dist/skills/SkillManager.js +153 -0
- package/dist/skills/SkillManager.js.map +1 -0
- package/dist/skills/index.d.ts +3 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +2 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/telemetry/TelemetryCollector.d.ts +19 -0
- package/dist/telemetry/TelemetryCollector.d.ts.map +1 -0
- package/dist/telemetry/TelemetryCollector.js +62 -0
- package/dist/telemetry/TelemetryCollector.js.map +1 -0
- package/dist/telemetry/TelemetryStore.d.ts +20 -0
- package/dist/telemetry/TelemetryStore.d.ts.map +1 -0
- package/dist/telemetry/TelemetryStore.js +126 -0
- package/dist/telemetry/TelemetryStore.js.map +1 -0
- package/dist/telemetry/index.d.ts +8 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +33 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/sanitization.d.ts +6 -0
- package/dist/telemetry/sanitization.d.ts.map +1 -0
- package/dist/telemetry/sanitization.js +180 -0
- package/dist/telemetry/sanitization.js.map +1 -0
- package/dist/telemetry/types.d.ts +73 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/telemetry/types.js +16 -0
- package/dist/telemetry/types.js.map +1 -0
- package/dist/templates/git-education-templates.d.ts +26 -0
- package/dist/templates/git-education-templates.d.ts.map +1 -0
- package/dist/templates/git-education-templates.js +455 -0
- package/dist/templates/git-education-templates.js.map +1 -0
- package/dist/types/AgentClassification.d.ts +6 -0
- package/dist/types/AgentClassification.d.ts.map +1 -0
- package/dist/types/AgentClassification.js +7 -0
- package/dist/types/AgentClassification.js.map +1 -0
- package/dist/types/Checkpoint.d.ts +12 -0
- package/dist/types/Checkpoint.d.ts.map +1 -0
- package/dist/types/Checkpoint.js +13 -0
- package/dist/types/Checkpoint.js.map +1 -0
- package/dist/types/toonify.d.ts +91 -0
- package/dist/types/toonify.d.ts.map +1 -0
- package/dist/types/toonify.js +18 -0
- package/dist/types/toonify.js.map +1 -0
- package/dist/ui/AsciiProgressBar.d.ts +29 -0
- package/dist/ui/AsciiProgressBar.d.ts.map +1 -0
- package/dist/ui/AsciiProgressBar.js +131 -0
- package/dist/ui/AsciiProgressBar.js.map +1 -0
- package/dist/ui/AttributionManager.d.ts +19 -0
- package/dist/ui/AttributionManager.d.ts.map +1 -0
- package/dist/ui/AttributionManager.js +107 -0
- package/dist/ui/AttributionManager.js.map +1 -0
- package/dist/ui/Dashboard.d.ts +24 -0
- package/dist/ui/Dashboard.d.ts.map +1 -0
- package/dist/ui/Dashboard.js +135 -0
- package/dist/ui/Dashboard.js.map +1 -0
- package/dist/ui/LoadingIndicator.d.ts +53 -0
- package/dist/ui/LoadingIndicator.d.ts.map +1 -0
- package/dist/ui/LoadingIndicator.js +174 -0
- package/dist/ui/LoadingIndicator.js.map +1 -0
- package/dist/ui/MetricsStore.d.ts +15 -0
- package/dist/ui/MetricsStore.d.ts.map +1 -0
- package/dist/ui/MetricsStore.js +111 -0
- package/dist/ui/MetricsStore.js.map +1 -0
- package/dist/ui/ProgressRenderer.d.ts +24 -0
- package/dist/ui/ProgressRenderer.d.ts.map +1 -0
- package/dist/ui/ProgressRenderer.js +121 -0
- package/dist/ui/ProgressRenderer.js.map +1 -0
- package/dist/ui/ResponseFormatter.d.ts +42 -0
- package/dist/ui/ResponseFormatter.d.ts.map +1 -0
- package/dist/ui/ResponseFormatter.js +243 -0
- package/dist/ui/ResponseFormatter.js.map +1 -0
- package/dist/ui/UIEventBus.d.ts +38 -0
- package/dist/ui/UIEventBus.d.ts.map +1 -0
- package/dist/ui/UIEventBus.js +173 -0
- package/dist/ui/UIEventBus.js.map +1 -0
- package/dist/ui/index.d.ts +8 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/theme.d.ts +292 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +153 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/types.d.ts +146 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +16 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/utils/ILogger.d.ts +7 -0
- package/dist/utils/ILogger.d.ts.map +1 -0
- package/dist/utils/ILogger.js +2 -0
- package/dist/utils/ILogger.js.map +1 -0
- package/dist/utils/MinHeap.d.ts +15 -0
- package/dist/utils/MinHeap.d.ts.map +1 -0
- package/dist/utils/MinHeap.js +69 -0
- package/dist/utils/MinHeap.js.map +1 -0
- package/dist/utils/RateLimiter.d.ts +28 -0
- package/dist/utils/RateLimiter.d.ts.map +1 -0
- package/dist/utils/RateLimiter.js +115 -0
- package/dist/utils/RateLimiter.js.map +1 -0
- package/dist/utils/SecureKeyStore.d.ts +10 -0
- package/dist/utils/SecureKeyStore.d.ts.map +1 -0
- package/dist/utils/SecureKeyStore.js +32 -0
- package/dist/utils/SecureKeyStore.js.map +1 -0
- package/dist/utils/SystemResources.d.ts +40 -0
- package/dist/utils/SystemResources.d.ts.map +1 -0
- package/dist/utils/SystemResources.js +221 -0
- package/dist/utils/SystemResources.js.map +1 -0
- package/dist/utils/cost-tracker.d.ts +34 -0
- package/dist/utils/cost-tracker.d.ts.map +1 -0
- package/dist/utils/cost-tracker.js +92 -0
- package/dist/utils/cost-tracker.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +28 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +206 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/json.d.ts +13 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +85 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/lru-cache.d.ts +40 -0
- package/dist/utils/lru-cache.d.ts.map +1 -0
- package/dist/utils/lru-cache.js +209 -0
- package/dist/utils/lru-cache.js.map +1 -0
- package/dist/utils/memory.d.ts +20 -0
- package/dist/utils/memory.d.ts.map +1 -0
- package/dist/utils/memory.js +53 -0
- package/dist/utils/memory.js.map +1 -0
- package/dist/utils/money.d.ts +10 -0
- package/dist/utils/money.d.ts.map +1 -0
- package/dist/utils/money.js +25 -0
- package/dist/utils/money.js.map +1 -0
- package/dist/utils/pathValidation.d.ts +2 -0
- package/dist/utils/pathValidation.d.ts.map +1 -0
- package/dist/utils/pathValidation.js +62 -0
- package/dist/utils/pathValidation.js.map +1 -0
- package/dist/utils/paths.d.ts +4 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +28 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/requestId.d.ts +4 -0
- package/dist/utils/requestId.d.ts.map +1 -0
- package/dist/utils/requestId.js +17 -0
- package/dist/utils/requestId.js.map +1 -0
- package/dist/utils/retry.d.ts +20 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +226 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/toonify-adapter.d.ts +77 -0
- package/dist/utils/toonify-adapter.d.ts.map +1 -0
- package/dist/utils/toonify-adapter.js +283 -0
- package/dist/utils/toonify-adapter.js.map +1 -0
- package/dist/utils/validation.d.ts +7 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +62 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +116 -0
- package/plugin.json +21 -0
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ValidationError, OperationError } from '../../errors/index.js';
|
|
3
|
+
import { RateLimiter } from '../../utils/RateLimiter.js';
|
|
4
|
+
import { SimpleConfig } from '../../config/simple-config.js';
|
|
5
|
+
import { recallMemoryTool } from '../tools/recall-memory.js';
|
|
6
|
+
import { createEntitiesTool } from '../tools/create-entities.js';
|
|
7
|
+
import { addObservationsTool } from '../tools/add-observations.js';
|
|
8
|
+
import { createRelationsTool } from '../tools/create-relations.js';
|
|
9
|
+
import { handleError, logError } from '../../utils/errorHandler.js';
|
|
10
|
+
import { ListSkillsInputSchema, UninstallInputSchema, WorkflowGuidanceInputSchema, RecordTokenUsageInputSchema, HookToolUseInputSchema, GenerateSmartPlanInputSchema, RecallMemoryInputSchema, CreateEntitiesInputSchema, AddObservationsInputSchema, CreateRelationsInputSchema, formatValidationError, } from '../validation.js';
|
|
11
|
+
export class ToolHandlers {
|
|
12
|
+
router;
|
|
13
|
+
agentRegistry;
|
|
14
|
+
feedbackCollector;
|
|
15
|
+
performanceTracker;
|
|
16
|
+
learningManager;
|
|
17
|
+
evolutionMonitor;
|
|
18
|
+
skillManager;
|
|
19
|
+
uninstallManager;
|
|
20
|
+
developmentButler;
|
|
21
|
+
checkpointDetector;
|
|
22
|
+
hookIntegration;
|
|
23
|
+
planningEngine;
|
|
24
|
+
projectMemoryManager;
|
|
25
|
+
knowledgeGraph;
|
|
26
|
+
ui;
|
|
27
|
+
memoryRateLimiter;
|
|
28
|
+
constructor(router, agentRegistry, feedbackCollector, performanceTracker, learningManager, evolutionMonitor, skillManager, uninstallManager, developmentButler, checkpointDetector, hookIntegration, planningEngine, projectMemoryManager, knowledgeGraph, ui) {
|
|
29
|
+
this.router = router;
|
|
30
|
+
this.agentRegistry = agentRegistry;
|
|
31
|
+
this.feedbackCollector = feedbackCollector;
|
|
32
|
+
this.performanceTracker = performanceTracker;
|
|
33
|
+
this.learningManager = learningManager;
|
|
34
|
+
this.evolutionMonitor = evolutionMonitor;
|
|
35
|
+
this.skillManager = skillManager;
|
|
36
|
+
this.uninstallManager = uninstallManager;
|
|
37
|
+
this.developmentButler = developmentButler;
|
|
38
|
+
this.checkpointDetector = checkpointDetector;
|
|
39
|
+
this.hookIntegration = hookIntegration;
|
|
40
|
+
this.planningEngine = planningEngine;
|
|
41
|
+
this.projectMemoryManager = projectMemoryManager;
|
|
42
|
+
this.knowledgeGraph = knowledgeGraph;
|
|
43
|
+
this.ui = ui;
|
|
44
|
+
this.memoryRateLimiter = new RateLimiter({ requestsPerMinute: 10 });
|
|
45
|
+
}
|
|
46
|
+
async handleListSkills(args) {
|
|
47
|
+
try {
|
|
48
|
+
let validatedInput;
|
|
49
|
+
try {
|
|
50
|
+
validatedInput = ListSkillsInputSchema.parse(args);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error instanceof z.ZodError) {
|
|
54
|
+
throw new ValidationError(formatValidationError(error), {
|
|
55
|
+
component: 'ToolHandlers',
|
|
56
|
+
method: 'handleListSkills',
|
|
57
|
+
schema: 'ListSkillsInputSchema',
|
|
58
|
+
providedArgs: args,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
const filter = validatedInput.filter || 'all';
|
|
64
|
+
let skills;
|
|
65
|
+
let title;
|
|
66
|
+
switch (filter) {
|
|
67
|
+
case 'claude-code-buddy':
|
|
68
|
+
skills = await this.skillManager.listSmartAgentsSkills();
|
|
69
|
+
title = 'š Claude Code Buddy Skills (sa: prefix)';
|
|
70
|
+
break;
|
|
71
|
+
case 'user':
|
|
72
|
+
skills = await this.skillManager.listUserSkills();
|
|
73
|
+
title = 'š¤ User Skills';
|
|
74
|
+
break;
|
|
75
|
+
case 'all':
|
|
76
|
+
default:
|
|
77
|
+
const allSkillsMetadata = await this.skillManager.listAllSkills();
|
|
78
|
+
skills = allSkillsMetadata.map(s => s.name);
|
|
79
|
+
title = 'š All Skills';
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
let output = `${title}\n`;
|
|
83
|
+
output += 'ā'.repeat(60) + '\n\n';
|
|
84
|
+
if (skills.length === 0) {
|
|
85
|
+
output += ' No skills found.\n\n';
|
|
86
|
+
if (filter === 'claude-code-buddy') {
|
|
87
|
+
output += 'š” Claude Code Buddy can generate skills automatically.\n';
|
|
88
|
+
output += ' Skills will appear here once generated.\n';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
output += `Total: ${skills.length} skill${skills.length === 1 ? '' : 's'}\n\n`;
|
|
93
|
+
const saSkills = skills.filter(s => s.startsWith('sa:'));
|
|
94
|
+
const userSkills = skills.filter(s => !s.startsWith('sa:'));
|
|
95
|
+
if (filter === 'all') {
|
|
96
|
+
if (saSkills.length > 0) {
|
|
97
|
+
output += 'š Claude Code Buddy Skills:\n';
|
|
98
|
+
output += 'ā'.repeat(60) + '\n';
|
|
99
|
+
saSkills.forEach(skill => {
|
|
100
|
+
output += ` ⢠${skill}\n`;
|
|
101
|
+
});
|
|
102
|
+
output += '\n';
|
|
103
|
+
}
|
|
104
|
+
if (userSkills.length > 0) {
|
|
105
|
+
output += 'š¤ User Skills:\n';
|
|
106
|
+
output += 'ā'.repeat(60) + '\n';
|
|
107
|
+
userSkills.forEach(skill => {
|
|
108
|
+
output += ` ⢠${skill}\n`;
|
|
109
|
+
});
|
|
110
|
+
output += '\n';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
skills.forEach(skill => {
|
|
115
|
+
output += ` ⢠${skill}\n`;
|
|
116
|
+
});
|
|
117
|
+
output += '\n';
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
output += 'ā'.repeat(60) + '\n';
|
|
121
|
+
output += '\nš” Usage:\n';
|
|
122
|
+
output += ' ⢠buddy_skills - List all skills\n';
|
|
123
|
+
output += ' ⢠buddy_skills --filter claude-code-buddy - List only sa: skills\n';
|
|
124
|
+
output += ' ⢠buddy_skills --filter user - List only user skills\n';
|
|
125
|
+
output += '\nš Skill Naming Convention:\n';
|
|
126
|
+
output += ' ⢠sa:<name> - Claude Code Buddy generated skills\n';
|
|
127
|
+
output += ' ⢠<name> - User-installed skills\n';
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: 'text',
|
|
132
|
+
text: output,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
logError(error, {
|
|
139
|
+
component: 'ToolHandlers',
|
|
140
|
+
method: 'handleListSkills',
|
|
141
|
+
operation: 'listing skills',
|
|
142
|
+
data: { filter: args?.filter },
|
|
143
|
+
});
|
|
144
|
+
const handled = handleError(error, {
|
|
145
|
+
component: 'ToolHandlers',
|
|
146
|
+
method: 'handleListSkills',
|
|
147
|
+
});
|
|
148
|
+
return {
|
|
149
|
+
content: [
|
|
150
|
+
{
|
|
151
|
+
type: 'text',
|
|
152
|
+
text: `ā List skills failed: ${handled.message}`,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async handleUninstall(args) {
|
|
159
|
+
try {
|
|
160
|
+
let validatedInput;
|
|
161
|
+
try {
|
|
162
|
+
validatedInput = UninstallInputSchema.parse(args);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
if (error instanceof z.ZodError) {
|
|
166
|
+
throw new ValidationError(formatValidationError(error), {
|
|
167
|
+
component: 'ToolHandlers',
|
|
168
|
+
method: 'handleUninstall',
|
|
169
|
+
schema: 'UninstallInputSchema',
|
|
170
|
+
providedArgs: args,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
const report = await this.uninstallManager.uninstall(validatedInput);
|
|
176
|
+
const formattedReport = this.uninstallManager.formatReport(report);
|
|
177
|
+
return {
|
|
178
|
+
content: [
|
|
179
|
+
{
|
|
180
|
+
type: 'text',
|
|
181
|
+
text: formattedReport,
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
logError(error, {
|
|
188
|
+
component: 'ToolHandlers',
|
|
189
|
+
method: 'handleUninstall',
|
|
190
|
+
operation: 'uninstalling Claude Code Buddy',
|
|
191
|
+
data: { options: args },
|
|
192
|
+
});
|
|
193
|
+
const handled = handleError(error, {
|
|
194
|
+
component: 'ToolHandlers',
|
|
195
|
+
method: 'handleUninstall',
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
content: [
|
|
199
|
+
{
|
|
200
|
+
type: 'text',
|
|
201
|
+
text: `ā Uninstall failed: ${handled.message}`,
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async handleGetWorkflowGuidance(args) {
|
|
208
|
+
try {
|
|
209
|
+
let validatedInput;
|
|
210
|
+
try {
|
|
211
|
+
validatedInput = WorkflowGuidanceInputSchema.parse(args);
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
if (error instanceof z.ZodError) {
|
|
215
|
+
throw new ValidationError(formatValidationError(error), {
|
|
216
|
+
component: 'ToolHandlers',
|
|
217
|
+
method: 'handleGetWorkflowGuidance',
|
|
218
|
+
schema: 'WorkflowGuidanceInputSchema',
|
|
219
|
+
providedArgs: args,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
const normalizedPhase = this.normalizeWorkflowPhase(validatedInput.phase);
|
|
225
|
+
if (!normalizedPhase) {
|
|
226
|
+
throw new ValidationError(`Invalid workflow phase: ${validatedInput.phase}`, {
|
|
227
|
+
component: 'ToolHandlers',
|
|
228
|
+
method: 'handleGetWorkflowGuidance',
|
|
229
|
+
validPhases: ['idle', 'code-written', 'test-complete', 'commit-ready', 'committed'],
|
|
230
|
+
providedPhase: validatedInput.phase,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
const result = await this.developmentButler.processCheckpoint(normalizedPhase, {
|
|
234
|
+
...validatedInput,
|
|
235
|
+
phase: normalizedPhase,
|
|
236
|
+
});
|
|
237
|
+
return {
|
|
238
|
+
content: [
|
|
239
|
+
{
|
|
240
|
+
type: 'text',
|
|
241
|
+
text: result.formattedRequest,
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
logError(error, {
|
|
248
|
+
component: 'ToolHandlers',
|
|
249
|
+
method: 'handleGetWorkflowGuidance',
|
|
250
|
+
operation: 'processing workflow checkpoint',
|
|
251
|
+
data: { phase: args?.phase },
|
|
252
|
+
});
|
|
253
|
+
const handled = handleError(error, {
|
|
254
|
+
component: 'ToolHandlers',
|
|
255
|
+
method: 'handleGetWorkflowGuidance',
|
|
256
|
+
});
|
|
257
|
+
return {
|
|
258
|
+
content: [
|
|
259
|
+
{
|
|
260
|
+
type: 'text',
|
|
261
|
+
text: `ā Workflow guidance failed: ${handled.message}`,
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
async handleGetSessionHealth() {
|
|
268
|
+
try {
|
|
269
|
+
const health = this.developmentButler.getContextMonitor().checkSessionHealth();
|
|
270
|
+
return {
|
|
271
|
+
content: [
|
|
272
|
+
{
|
|
273
|
+
type: 'text',
|
|
274
|
+
text: JSON.stringify(health, null, 2),
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
logError(error, {
|
|
281
|
+
component: 'ToolHandlers',
|
|
282
|
+
method: 'handleGetSessionHealth',
|
|
283
|
+
operation: 'checking session health',
|
|
284
|
+
});
|
|
285
|
+
const handled = handleError(error, {
|
|
286
|
+
component: 'ToolHandlers',
|
|
287
|
+
method: 'handleGetSessionHealth',
|
|
288
|
+
});
|
|
289
|
+
return {
|
|
290
|
+
content: [
|
|
291
|
+
{
|
|
292
|
+
type: 'text',
|
|
293
|
+
text: `ā Session health check failed: ${handled.message}`,
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
async handleReloadContext(input) {
|
|
300
|
+
try {
|
|
301
|
+
const requestId = `manual_${Date.now()}`;
|
|
302
|
+
const result = await this.developmentButler.executeContextReload(requestId);
|
|
303
|
+
return {
|
|
304
|
+
content: [
|
|
305
|
+
{
|
|
306
|
+
type: 'text',
|
|
307
|
+
text: JSON.stringify(result, null, 2),
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
logError(error, {
|
|
314
|
+
component: 'ToolHandlers',
|
|
315
|
+
method: 'handleReloadContext',
|
|
316
|
+
operation: 'reloading context',
|
|
317
|
+
data: { reason: input.reason },
|
|
318
|
+
});
|
|
319
|
+
const handled = handleError(error, {
|
|
320
|
+
component: 'ToolHandlers',
|
|
321
|
+
method: 'handleReloadContext',
|
|
322
|
+
});
|
|
323
|
+
return {
|
|
324
|
+
content: [
|
|
325
|
+
{
|
|
326
|
+
type: 'text',
|
|
327
|
+
text: `ā Context reload failed: ${handled.message}`,
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
async handleRecordTokenUsage(args) {
|
|
334
|
+
try {
|
|
335
|
+
let validatedInput;
|
|
336
|
+
try {
|
|
337
|
+
validatedInput = RecordTokenUsageInputSchema.parse(args);
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
if (error instanceof z.ZodError) {
|
|
341
|
+
throw new ValidationError(formatValidationError(error), {
|
|
342
|
+
component: 'ToolHandlers',
|
|
343
|
+
method: 'handleRecordTokenUsage',
|
|
344
|
+
schema: 'RecordTokenUsageInputSchema',
|
|
345
|
+
providedArgs: args,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
throw error;
|
|
349
|
+
}
|
|
350
|
+
this.developmentButler.getTokenTracker().recordUsage({
|
|
351
|
+
inputTokens: validatedInput.inputTokens,
|
|
352
|
+
outputTokens: validatedInput.outputTokens,
|
|
353
|
+
});
|
|
354
|
+
return {
|
|
355
|
+
content: [
|
|
356
|
+
{
|
|
357
|
+
type: 'text',
|
|
358
|
+
text: JSON.stringify({ success: true }, null, 2),
|
|
359
|
+
},
|
|
360
|
+
],
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
catch (error) {
|
|
364
|
+
logError(error, {
|
|
365
|
+
component: 'ToolHandlers',
|
|
366
|
+
method: 'handleRecordTokenUsage',
|
|
367
|
+
operation: 'recording token usage',
|
|
368
|
+
data: { inputTokens: args?.inputTokens, outputTokens: args?.outputTokens },
|
|
369
|
+
});
|
|
370
|
+
const handled = handleError(error, {
|
|
371
|
+
component: 'ToolHandlers',
|
|
372
|
+
method: 'handleRecordTokenUsage',
|
|
373
|
+
});
|
|
374
|
+
return {
|
|
375
|
+
content: [
|
|
376
|
+
{
|
|
377
|
+
type: 'text',
|
|
378
|
+
text: `ā Token usage recording failed: ${handled.message}`,
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
async handleHookToolUse(args) {
|
|
385
|
+
try {
|
|
386
|
+
let validatedInput;
|
|
387
|
+
try {
|
|
388
|
+
validatedInput = HookToolUseInputSchema.parse(args);
|
|
389
|
+
}
|
|
390
|
+
catch (error) {
|
|
391
|
+
if (error instanceof z.ZodError) {
|
|
392
|
+
throw new ValidationError(formatValidationError(error), {
|
|
393
|
+
component: 'ToolHandlers',
|
|
394
|
+
method: 'handleHookToolUse',
|
|
395
|
+
schema: 'HookToolUseInputSchema',
|
|
396
|
+
providedArgs: args,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
throw error;
|
|
400
|
+
}
|
|
401
|
+
await this.hookIntegration.processToolUse({
|
|
402
|
+
toolName: validatedInput.toolName,
|
|
403
|
+
arguments: validatedInput.arguments,
|
|
404
|
+
success: validatedInput.success,
|
|
405
|
+
duration: validatedInput.duration,
|
|
406
|
+
tokensUsed: validatedInput.tokensUsed,
|
|
407
|
+
output: validatedInput.output,
|
|
408
|
+
});
|
|
409
|
+
return {
|
|
410
|
+
content: [
|
|
411
|
+
{
|
|
412
|
+
type: 'text',
|
|
413
|
+
text: JSON.stringify({ success: true }, null, 2),
|
|
414
|
+
},
|
|
415
|
+
],
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
logError(error, {
|
|
420
|
+
component: 'ToolHandlers',
|
|
421
|
+
method: 'handleHookToolUse',
|
|
422
|
+
operation: 'processing hook tool use',
|
|
423
|
+
data: { toolName: args?.toolName },
|
|
424
|
+
});
|
|
425
|
+
const handled = handleError(error, {
|
|
426
|
+
component: 'ToolHandlers',
|
|
427
|
+
method: 'handleHookToolUse',
|
|
428
|
+
});
|
|
429
|
+
return {
|
|
430
|
+
content: [
|
|
431
|
+
{
|
|
432
|
+
type: 'text',
|
|
433
|
+
text: `ā Hook processing failed: ${handled.message}`,
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
async handleGenerateSmartPlan(args) {
|
|
440
|
+
try {
|
|
441
|
+
let validatedInput;
|
|
442
|
+
try {
|
|
443
|
+
validatedInput = GenerateSmartPlanInputSchema.parse(args);
|
|
444
|
+
}
|
|
445
|
+
catch (error) {
|
|
446
|
+
if (error instanceof z.ZodError) {
|
|
447
|
+
throw new ValidationError(formatValidationError(error), {
|
|
448
|
+
component: 'ToolHandlers',
|
|
449
|
+
method: 'handleGenerateSmartPlan',
|
|
450
|
+
schema: 'GenerateSmartPlanInputSchema',
|
|
451
|
+
providedArgs: args,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
throw error;
|
|
455
|
+
}
|
|
456
|
+
const plan = await this.planningEngine.generatePlan({
|
|
457
|
+
featureDescription: validatedInput.featureDescription,
|
|
458
|
+
requirements: validatedInput.requirements,
|
|
459
|
+
constraints: validatedInput.constraints,
|
|
460
|
+
});
|
|
461
|
+
let planText = `# ${plan.title}\n\n`;
|
|
462
|
+
planText += `**Goal**: ${plan.goal}\n\n`;
|
|
463
|
+
planText += `**Architecture**: ${plan.architecture}\n\n`;
|
|
464
|
+
planText += `**Tech Stack**: ${plan.techStack.join(', ')}\n\n`;
|
|
465
|
+
planText += `**Total Estimated Time**: ${plan.totalEstimatedTime}\n\n`;
|
|
466
|
+
planText += `---\n\n`;
|
|
467
|
+
planText += `## Tasks\n\n`;
|
|
468
|
+
for (const task of plan.tasks) {
|
|
469
|
+
planText += `### ${task.id}: ${task.description}\n\n`;
|
|
470
|
+
planText += `- **Priority**: ${task.priority}\n`;
|
|
471
|
+
planText += `- **Estimated Duration**: ${task.estimatedDuration}\n`;
|
|
472
|
+
if (task.suggestedAgent) {
|
|
473
|
+
const capabilityHint = this.describeCapabilities(task.suggestedAgent);
|
|
474
|
+
if (capabilityHint) {
|
|
475
|
+
planText += `- **Suggested Capability**: ${capabilityHint}\n`;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if (task.dependencies.length > 0) {
|
|
479
|
+
planText += `- **Dependencies**: ${task.dependencies.join(', ')}\n`;
|
|
480
|
+
}
|
|
481
|
+
planText += `\n**Steps**:\n`;
|
|
482
|
+
task.steps.forEach((step, index) => {
|
|
483
|
+
planText += `${index + 1}. ${step}\n`;
|
|
484
|
+
});
|
|
485
|
+
if (task.files.create && task.files.create.length > 0) {
|
|
486
|
+
planText += `\n**Files to Create**: ${task.files.create.join(', ')}\n`;
|
|
487
|
+
}
|
|
488
|
+
if (task.files.modify && task.files.modify.length > 0) {
|
|
489
|
+
planText += `**Files to Modify**: ${task.files.modify.join(', ')}\n`;
|
|
490
|
+
}
|
|
491
|
+
if (task.files.test && task.files.test.length > 0) {
|
|
492
|
+
planText += `**Test Files**: ${task.files.test.join(', ')}\n`;
|
|
493
|
+
}
|
|
494
|
+
planText += `\n---\n\n`;
|
|
495
|
+
}
|
|
496
|
+
if (SimpleConfig.EVIDENCE_MODE || SimpleConfig.BEGINNER_MODE) {
|
|
497
|
+
planText += `## Quality Gates (Best Practices)\n\n`;
|
|
498
|
+
planText += `- **Code Review**: Group findings by severity and cite file paths/symbols for each issue.\n`;
|
|
499
|
+
planText += `- **Issue Fixes**: Provide reproduction steps, root cause evidence, minimal fix, and verification steps.\n`;
|
|
500
|
+
planText += `- **E2E Tests**: Run targeted tests and attach logs/screenshots; if not run, state "Not run".\n`;
|
|
501
|
+
planText += `- **Evidence Guard**: Separate facts vs assumptions and request missing inputs explicitly.\n`;
|
|
502
|
+
planText += `- **Release Hygiene**: Run lint/typecheck, update docs if APIs change, and note tests executed.\n\n`;
|
|
503
|
+
}
|
|
504
|
+
return {
|
|
505
|
+
content: [
|
|
506
|
+
{
|
|
507
|
+
type: 'text',
|
|
508
|
+
text: planText,
|
|
509
|
+
},
|
|
510
|
+
],
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
catch (error) {
|
|
514
|
+
logError(error, {
|
|
515
|
+
component: 'ToolHandlers',
|
|
516
|
+
method: 'handleGenerateSmartPlan',
|
|
517
|
+
operation: 'generating smart plan',
|
|
518
|
+
data: { featureDescription: args?.featureDescription },
|
|
519
|
+
});
|
|
520
|
+
const handled = handleError(error, {
|
|
521
|
+
component: 'ToolHandlers',
|
|
522
|
+
method: 'handleGenerateSmartPlan',
|
|
523
|
+
});
|
|
524
|
+
return {
|
|
525
|
+
content: [
|
|
526
|
+
{
|
|
527
|
+
type: 'text',
|
|
528
|
+
text: `ā Smart plan generation failed: ${handled.message}`,
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
async handleRecallMemory(args) {
|
|
535
|
+
if (!this.memoryRateLimiter.consume()) {
|
|
536
|
+
throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
|
|
537
|
+
component: 'ToolHandlers',
|
|
538
|
+
method: 'handleRecallMemory',
|
|
539
|
+
rateLimitStatus: this.memoryRateLimiter.getStatus(),
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
try {
|
|
543
|
+
let validatedInput;
|
|
544
|
+
try {
|
|
545
|
+
validatedInput = RecallMemoryInputSchema.parse(args);
|
|
546
|
+
}
|
|
547
|
+
catch (error) {
|
|
548
|
+
if (error instanceof z.ZodError) {
|
|
549
|
+
throw new ValidationError(formatValidationError(error), {
|
|
550
|
+
component: 'ToolHandlers',
|
|
551
|
+
method: 'handleRecallMemory',
|
|
552
|
+
schema: 'RecallMemoryInputSchema',
|
|
553
|
+
providedArgs: args,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
throw error;
|
|
557
|
+
}
|
|
558
|
+
const result = await recallMemoryTool.handler(validatedInput, this.projectMemoryManager);
|
|
559
|
+
let text = 'š Project Memory Recall\n';
|
|
560
|
+
text += 'ā'.repeat(60) + '\n\n';
|
|
561
|
+
if (result.memories.length === 0) {
|
|
562
|
+
text += 'No memories found.\n\n';
|
|
563
|
+
text += 'š” Memories will be created as you work on the project.\n';
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
text += `Found ${result.memories.length} recent memories:\n\n`;
|
|
567
|
+
result.memories.forEach((memory, index) => {
|
|
568
|
+
text += `${index + 1}. ${memory.type}\n`;
|
|
569
|
+
if (memory.timestamp) {
|
|
570
|
+
text += ` Timestamp: ${memory.timestamp}\n`;
|
|
571
|
+
}
|
|
572
|
+
if (memory.observations && memory.observations.length > 0) {
|
|
573
|
+
text += ' Observations:\n';
|
|
574
|
+
memory.observations.forEach(obs => {
|
|
575
|
+
text += ` - ${obs}\n`;
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
text += '\n';
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
text += 'ā'.repeat(60) + '\n';
|
|
582
|
+
return {
|
|
583
|
+
content: [
|
|
584
|
+
{
|
|
585
|
+
type: 'text',
|
|
586
|
+
text,
|
|
587
|
+
},
|
|
588
|
+
],
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
catch (error) {
|
|
592
|
+
logError(error, {
|
|
593
|
+
component: 'ToolHandlers',
|
|
594
|
+
method: 'handleRecallMemory',
|
|
595
|
+
operation: 'recalling project memory',
|
|
596
|
+
data: { query: args?.query, limit: args?.limit },
|
|
597
|
+
});
|
|
598
|
+
const handled = handleError(error, {
|
|
599
|
+
component: 'ToolHandlers',
|
|
600
|
+
method: 'handleRecallMemory',
|
|
601
|
+
});
|
|
602
|
+
return {
|
|
603
|
+
content: [
|
|
604
|
+
{
|
|
605
|
+
type: 'text',
|
|
606
|
+
text: `ā Failed to recall memory: ${handled.message}`,
|
|
607
|
+
},
|
|
608
|
+
],
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
describeCapabilities(agentName) {
|
|
613
|
+
const agent = this.agentRegistry.getAgent(agentName);
|
|
614
|
+
if (!agent || !agent.capabilities || agent.capabilities.length === 0) {
|
|
615
|
+
return undefined;
|
|
616
|
+
}
|
|
617
|
+
return agent.capabilities.slice(0, 3).join(', ');
|
|
618
|
+
}
|
|
619
|
+
async handleCreateEntities(args) {
|
|
620
|
+
if (!this.memoryRateLimiter.consume()) {
|
|
621
|
+
throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
|
|
622
|
+
component: 'ToolHandlers',
|
|
623
|
+
method: 'handleCreateEntities',
|
|
624
|
+
rateLimitStatus: this.memoryRateLimiter.getStatus(),
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
try {
|
|
628
|
+
let validatedInput;
|
|
629
|
+
try {
|
|
630
|
+
validatedInput = CreateEntitiesInputSchema.parse(args);
|
|
631
|
+
}
|
|
632
|
+
catch (error) {
|
|
633
|
+
if (error instanceof z.ZodError) {
|
|
634
|
+
throw new ValidationError(formatValidationError(error), {
|
|
635
|
+
component: 'ToolHandlers',
|
|
636
|
+
method: 'handleCreateEntities',
|
|
637
|
+
schema: 'CreateEntitiesInputSchema',
|
|
638
|
+
providedArgs: args,
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
throw error;
|
|
642
|
+
}
|
|
643
|
+
const result = await createEntitiesTool.handler(validatedInput, this.knowledgeGraph);
|
|
644
|
+
let text = '⨠Knowledge Graph Entity Creation\n';
|
|
645
|
+
text += 'ā'.repeat(60) + '\n\n';
|
|
646
|
+
if (result.count === 0) {
|
|
647
|
+
text += 'ā ļø No entities were created.\n\n';
|
|
648
|
+
if (result.errors && result.errors.length > 0) {
|
|
649
|
+
text += 'Errors encountered:\n';
|
|
650
|
+
result.errors.forEach(error => {
|
|
651
|
+
text += ` ā ${error.name}: ${error.error}\n`;
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
else {
|
|
656
|
+
text += `ā
Successfully created ${result.count} ${result.count === 1 ? 'entity' : 'entities'}:\n\n`;
|
|
657
|
+
result.created.forEach((name, index) => {
|
|
658
|
+
text += `${index + 1}. ${name}\n`;
|
|
659
|
+
});
|
|
660
|
+
if (result.errors && result.errors.length > 0) {
|
|
661
|
+
text += '\nā ļø Some entities failed:\n';
|
|
662
|
+
result.errors.forEach(error => {
|
|
663
|
+
text += ` ā ${error.name}: ${error.error}\n`;
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
text += '\n' + 'ā'.repeat(60) + '\n';
|
|
668
|
+
return {
|
|
669
|
+
content: [
|
|
670
|
+
{
|
|
671
|
+
type: 'text',
|
|
672
|
+
text,
|
|
673
|
+
},
|
|
674
|
+
],
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
catch (error) {
|
|
678
|
+
logError(error, {
|
|
679
|
+
component: 'ToolHandlers',
|
|
680
|
+
method: 'handleCreateEntities',
|
|
681
|
+
operation: 'creating knowledge graph entities',
|
|
682
|
+
data: { entityCount: args?.entities?.length ?? 0 },
|
|
683
|
+
});
|
|
684
|
+
const handled = handleError(error, {
|
|
685
|
+
component: 'ToolHandlers',
|
|
686
|
+
method: 'handleCreateEntities',
|
|
687
|
+
});
|
|
688
|
+
return {
|
|
689
|
+
content: [
|
|
690
|
+
{
|
|
691
|
+
type: 'text',
|
|
692
|
+
text: `ā Failed to create entities: ${handled.message}`,
|
|
693
|
+
},
|
|
694
|
+
],
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
async handleAddObservations(args) {
|
|
699
|
+
if (!this.memoryRateLimiter.consume()) {
|
|
700
|
+
throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
|
|
701
|
+
component: 'ToolHandlers',
|
|
702
|
+
method: 'handleAddObservations',
|
|
703
|
+
rateLimitStatus: this.memoryRateLimiter.getStatus(),
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
try {
|
|
707
|
+
let validatedInput;
|
|
708
|
+
try {
|
|
709
|
+
validatedInput = AddObservationsInputSchema.parse(args);
|
|
710
|
+
}
|
|
711
|
+
catch (error) {
|
|
712
|
+
if (error instanceof z.ZodError) {
|
|
713
|
+
throw new ValidationError(formatValidationError(error), {
|
|
714
|
+
component: 'ToolHandlers',
|
|
715
|
+
method: 'handleAddObservations',
|
|
716
|
+
schema: 'AddObservationsInputSchema',
|
|
717
|
+
providedArgs: args,
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
throw error;
|
|
721
|
+
}
|
|
722
|
+
const result = await addObservationsTool.handler(validatedInput, this.knowledgeGraph);
|
|
723
|
+
let text = 'š Knowledge Graph Observation Update\n';
|
|
724
|
+
text += 'ā'.repeat(60) + '\n\n';
|
|
725
|
+
if (result.count === 0) {
|
|
726
|
+
text += 'ā ļø No observations were added.\n\n';
|
|
727
|
+
if (result.notFound && result.notFound.length > 0) {
|
|
728
|
+
text += 'Entities not found:\n';
|
|
729
|
+
result.notFound.forEach(name => {
|
|
730
|
+
text += ` ā ${name}\n`;
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
if (result.errors && result.errors.length > 0) {
|
|
734
|
+
text += '\nErrors encountered:\n';
|
|
735
|
+
result.errors.forEach(error => {
|
|
736
|
+
text += ` ā ${error.entityName}: ${error.error}\n`;
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
text += `ā
Successfully updated ${result.count} ${result.count === 1 ? 'entity' : 'entities'}:\n\n`;
|
|
742
|
+
result.updated.forEach((name, index) => {
|
|
743
|
+
text += `${index + 1}. ${name}\n`;
|
|
744
|
+
});
|
|
745
|
+
if (result.notFound && result.notFound.length > 0) {
|
|
746
|
+
text += '\nā ļø Some entities were not found:\n';
|
|
747
|
+
result.notFound.forEach(name => {
|
|
748
|
+
text += ` ā ${name}\n`;
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
if (result.errors && result.errors.length > 0) {
|
|
752
|
+
text += '\nā ļø Some updates failed:\n';
|
|
753
|
+
result.errors.forEach(error => {
|
|
754
|
+
text += ` ā ${error.entityName}: ${error.error}\n`;
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
text += '\n' + 'ā'.repeat(60) + '\n';
|
|
759
|
+
return {
|
|
760
|
+
content: [
|
|
761
|
+
{
|
|
762
|
+
type: 'text',
|
|
763
|
+
text,
|
|
764
|
+
},
|
|
765
|
+
],
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
catch (error) {
|
|
769
|
+
logError(error, {
|
|
770
|
+
component: 'ToolHandlers',
|
|
771
|
+
method: 'handleAddObservations',
|
|
772
|
+
operation: 'adding observations to entities',
|
|
773
|
+
data: { observationCount: args?.observations?.length ?? 0 },
|
|
774
|
+
});
|
|
775
|
+
const handled = handleError(error, {
|
|
776
|
+
component: 'ToolHandlers',
|
|
777
|
+
method: 'handleAddObservations',
|
|
778
|
+
});
|
|
779
|
+
return {
|
|
780
|
+
content: [
|
|
781
|
+
{
|
|
782
|
+
type: 'text',
|
|
783
|
+
text: `ā Failed to add observations: ${handled.message}`,
|
|
784
|
+
},
|
|
785
|
+
],
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
async handleCreateRelations(args) {
|
|
790
|
+
if (!this.memoryRateLimiter.consume()) {
|
|
791
|
+
throw new OperationError('Memory operation rate limit exceeded. Please try again later.', {
|
|
792
|
+
component: 'ToolHandlers',
|
|
793
|
+
method: 'handleCreateRelations',
|
|
794
|
+
rateLimitStatus: this.memoryRateLimiter.getStatus(),
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
try {
|
|
798
|
+
let validatedInput;
|
|
799
|
+
try {
|
|
800
|
+
validatedInput = CreateRelationsInputSchema.parse(args);
|
|
801
|
+
}
|
|
802
|
+
catch (error) {
|
|
803
|
+
if (error instanceof z.ZodError) {
|
|
804
|
+
throw new ValidationError(formatValidationError(error), {
|
|
805
|
+
component: 'ToolHandlers',
|
|
806
|
+
method: 'handleCreateRelations',
|
|
807
|
+
schema: 'CreateRelationsInputSchema',
|
|
808
|
+
providedArgs: args,
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
throw error;
|
|
812
|
+
}
|
|
813
|
+
const result = await createRelationsTool.handler(validatedInput, this.knowledgeGraph);
|
|
814
|
+
let text = 'š Knowledge Graph Relation Creation\n';
|
|
815
|
+
text += 'ā'.repeat(60) + '\n\n';
|
|
816
|
+
if (result.count === 0) {
|
|
817
|
+
text += 'ā ļø No relations were created.\n\n';
|
|
818
|
+
if (result.missingEntities && result.missingEntities.length > 0) {
|
|
819
|
+
text += 'Entities not found:\n';
|
|
820
|
+
result.missingEntities.forEach(name => {
|
|
821
|
+
text += ` ā ${name}\n`;
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
if (result.errors && result.errors.length > 0) {
|
|
825
|
+
text += '\nErrors encountered:\n';
|
|
826
|
+
result.errors.forEach(error => {
|
|
827
|
+
text += ` ā ${error.from} ā ${error.to}: ${error.error}\n`;
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
else {
|
|
832
|
+
text += `ā
Successfully created ${result.count} ${result.count === 1 ? 'relation' : 'relations'}:\n\n`;
|
|
833
|
+
result.created.forEach((rel, index) => {
|
|
834
|
+
text += `${index + 1}. ${rel.from} --[${rel.type}]--> ${rel.to}\n`;
|
|
835
|
+
});
|
|
836
|
+
if (result.missingEntities && result.missingEntities.length > 0) {
|
|
837
|
+
text += '\nā ļø Some entities were not found:\n';
|
|
838
|
+
result.missingEntities.forEach(name => {
|
|
839
|
+
text += ` ā ${name}\n`;
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
if (result.errors && result.errors.length > 0) {
|
|
843
|
+
text += '\nā ļø Some relations failed:\n';
|
|
844
|
+
result.errors.forEach(error => {
|
|
845
|
+
text += ` ā ${error.from} ā ${error.to}: ${error.error}\n`;
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
text += '\n' + 'ā'.repeat(60) + '\n';
|
|
850
|
+
return {
|
|
851
|
+
content: [
|
|
852
|
+
{
|
|
853
|
+
type: 'text',
|
|
854
|
+
text,
|
|
855
|
+
},
|
|
856
|
+
],
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
catch (error) {
|
|
860
|
+
logError(error, {
|
|
861
|
+
component: 'ToolHandlers',
|
|
862
|
+
method: 'handleCreateRelations',
|
|
863
|
+
operation: 'creating entity relations',
|
|
864
|
+
data: { relationCount: args?.relations?.length ?? 0 },
|
|
865
|
+
});
|
|
866
|
+
const handled = handleError(error, {
|
|
867
|
+
component: 'ToolHandlers',
|
|
868
|
+
method: 'handleCreateRelations',
|
|
869
|
+
});
|
|
870
|
+
return {
|
|
871
|
+
content: [
|
|
872
|
+
{
|
|
873
|
+
type: 'text',
|
|
874
|
+
text: `ā Failed to create relations: ${handled.message}`,
|
|
875
|
+
},
|
|
876
|
+
],
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
normalizeWorkflowPhase(phase) {
|
|
881
|
+
const normalized = phase.trim().toLowerCase();
|
|
882
|
+
if (!normalized) {
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
const cleaned = normalized.replace(/[_\s]+/g, '-');
|
|
886
|
+
const direct = new Set(['idle', 'code-written', 'test-complete', 'commit-ready', 'committed']);
|
|
887
|
+
if (direct.has(cleaned)) {
|
|
888
|
+
return cleaned;
|
|
889
|
+
}
|
|
890
|
+
const aliases = {
|
|
891
|
+
planning: 'idle',
|
|
892
|
+
analysis: 'idle',
|
|
893
|
+
start: 'idle',
|
|
894
|
+
'code-analysis': 'code-written',
|
|
895
|
+
implementation: 'code-written',
|
|
896
|
+
coding: 'code-written',
|
|
897
|
+
code: 'code-written',
|
|
898
|
+
'test-analysis': 'test-complete',
|
|
899
|
+
testing: 'test-complete',
|
|
900
|
+
tests: 'test-complete',
|
|
901
|
+
test: 'test-complete',
|
|
902
|
+
'tests-complete': 'test-complete',
|
|
903
|
+
'ready-to-commit': 'commit-ready',
|
|
904
|
+
commit: 'commit-ready',
|
|
905
|
+
'pre-commit': 'commit-ready',
|
|
906
|
+
done: 'committed',
|
|
907
|
+
merged: 'committed',
|
|
908
|
+
shipped: 'committed',
|
|
909
|
+
released: 'committed',
|
|
910
|
+
};
|
|
911
|
+
return aliases[cleaned] || null;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
//# sourceMappingURL=ToolHandlers.js.map
|