@mxf-dev/core 2.0.5 → 3.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/dist/config/ModelContextLimits.d.ts.map +1 -1
- package/dist/config/ModelContextLimits.js +7 -1
- package/dist/config/ModelContextLimits.js.map +1 -1
- package/dist/constants/CoreTools.d.ts +6 -5
- package/dist/constants/CoreTools.d.ts.map +1 -1
- package/dist/constants/CoreTools.js +6 -5
- package/dist/constants/CoreTools.js.map +1 -1
- package/dist/constants/DefaultPhaseProfiles.d.ts.map +1 -1
- package/dist/constants/DefaultPhaseProfiles.js +29 -0
- package/dist/constants/DefaultPhaseProfiles.js.map +1 -1
- package/dist/constants/ReservedIdentities.d.ts +14 -0
- package/dist/constants/ReservedIdentities.d.ts.map +1 -0
- package/dist/constants/ReservedIdentities.js +42 -0
- package/dist/constants/ReservedIdentities.js.map +1 -0
- package/dist/database/adapters/mongodb/MongoKnowledgeGraphRepository.d.ts +16 -16
- package/dist/database/adapters/mongodb/MongoKnowledgeGraphRepository.d.ts.map +1 -1
- package/dist/database/adapters/mongodb/MongoKnowledgeGraphRepository.js +98 -36
- package/dist/database/adapters/mongodb/MongoKnowledgeGraphRepository.js.map +1 -1
- package/dist/events/ClientEventBus.d.ts +28 -0
- package/dist/events/ClientEventBus.d.ts.map +1 -1
- package/dist/events/ClientEventBus.js +87 -40
- package/dist/events/ClientEventBus.js.map +1 -1
- package/dist/events/EventBus.d.ts +19 -1
- package/dist/events/EventBus.d.ts.map +1 -1
- package/dist/events/EventBus.js +23 -0
- package/dist/events/EventBus.js.map +1 -1
- package/dist/events/EventBusBase.d.ts +37 -6
- package/dist/events/EventBusBase.d.ts.map +1 -1
- package/dist/events/EventBusBase.js +75 -27
- package/dist/events/EventBusBase.js.map +1 -1
- package/dist/events/EventNames.d.ts +49 -36
- package/dist/events/EventNames.d.ts.map +1 -1
- package/dist/events/EventNames.js +38 -36
- package/dist/events/EventNames.js.map +1 -1
- package/dist/events/PublicEvents.d.ts +5 -1
- package/dist/events/PublicEvents.d.ts.map +1 -1
- package/dist/events/PublicEvents.js +7 -0
- package/dist/events/PublicEvents.js.map +1 -1
- package/dist/events/ServerEventBus.d.ts +7 -54
- package/dist/events/ServerEventBus.d.ts.map +1 -1
- package/dist/events/ServerEventBus.js +10 -96
- package/dist/events/ServerEventBus.js.map +1 -1
- package/dist/events/event-definitions/ControlLoopEvents.d.ts +35 -0
- package/dist/events/event-definitions/ControlLoopEvents.d.ts.map +1 -1
- package/dist/events/event-definitions/ControlLoopEvents.js +6 -0
- package/dist/events/event-definitions/ControlLoopEvents.js.map +1 -1
- package/dist/events/event-definitions/SdkEvents.d.ts +55 -0
- package/dist/events/event-definitions/SdkEvents.d.ts.map +1 -0
- package/dist/events/event-definitions/SdkEvents.js +36 -0
- package/dist/events/event-definitions/SdkEvents.js.map +1 -0
- package/dist/events/event-definitions/TaskEvents.d.ts +2 -7
- package/dist/events/event-definitions/TaskEvents.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/AgentInterfaces.d.ts +5 -0
- package/dist/interfaces/AgentInterfaces.d.ts.map +1 -1
- package/dist/interfaces/ChannelConfig.d.ts +2 -2
- package/dist/interfaces/ChannelConfig.d.ts.map +1 -1
- package/dist/interfaces/ConversationMessage.d.ts +1 -1
- package/dist/interfaces/ConversationMessage.d.ts.map +1 -1
- package/dist/interfaces/IMemoryPersistence.d.ts +47 -1
- package/dist/interfaces/IMemoryPersistence.d.ts.map +1 -1
- package/dist/interfaces/SocketServiceInterface.d.ts +3 -2
- package/dist/interfaces/SocketServiceInterface.d.ts.map +1 -1
- package/dist/interfaces/TaskInterfaces.d.ts +14 -1
- package/dist/interfaces/TaskInterfaces.d.ts.map +1 -1
- package/dist/models/agent.d.ts +0 -1
- package/dist/models/agent.d.ts.map +1 -1
- package/dist/models/agent.js +0 -5
- package/dist/models/agent.js.map +1 -1
- package/dist/models/agentIdentityReservation.d.ts +42 -0
- package/dist/models/agentIdentityReservation.d.ts.map +1 -0
- package/dist/models/agentIdentityReservation.js +52 -0
- package/dist/models/agentIdentityReservation.js.map +1 -0
- package/dist/models/channel.d.ts +2 -0
- package/dist/models/channel.d.ts.map +1 -1
- package/dist/models/channel.js.map +1 -1
- package/dist/models/channelKey.d.ts +1 -0
- package/dist/models/channelKey.d.ts.map +1 -1
- package/dist/models/channelKey.js +5 -0
- package/dist/models/channelKey.js.map +1 -1
- package/dist/models/memory.d.ts +1 -1
- package/dist/models/memory.d.ts.map +1 -1
- package/dist/models/memory.js +9 -12
- package/dist/models/memory.js.map +1 -1
- package/dist/models/memoryStrata.d.ts +3 -16
- package/dist/models/memoryStrata.d.ts.map +1 -1
- package/dist/models/memoryStrata.js +3 -5
- package/dist/models/memoryStrata.js.map +1 -1
- package/dist/models/plan.d.ts +2 -2
- package/dist/models/plan.d.ts.map +1 -1
- package/dist/models/plan.js +1 -1
- package/dist/models/plan.js.map +1 -1
- package/dist/models/taskEffectiveness.d.ts +1 -0
- package/dist/models/taskEffectiveness.d.ts.map +1 -1
- package/dist/models/taskEffectiveness.js +7 -1
- package/dist/models/taskEffectiveness.js.map +1 -1
- package/dist/models/user.d.ts +4 -0
- package/dist/models/user.d.ts.map +1 -1
- package/dist/models/user.js +8 -0
- package/dist/models/user.js.map +1 -1
- package/dist/protocols/mcp/LlmTestEnvironmentGuard.d.ts +16 -0
- package/dist/protocols/mcp/LlmTestEnvironmentGuard.d.ts.map +1 -0
- package/dist/protocols/mcp/LlmTestEnvironmentGuard.js +25 -0
- package/dist/protocols/mcp/LlmTestEnvironmentGuard.js.map +1 -0
- package/dist/protocols/mcp/McpServerTypes.d.ts +9 -0
- package/dist/protocols/mcp/McpServerTypes.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/AnthropicMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/AnthropicMcpClient.js +1 -0
- package/dist/protocols/mcp/providers/AnthropicMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/AzureOpenAiMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/AzureOpenAiMcpClient.js +1 -0
- package/dist/protocols/mcp/providers/AzureOpenAiMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/BaseMcpClient.d.ts +4 -0
- package/dist/protocols/mcp/providers/BaseMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/BaseMcpClient.js +10 -0
- package/dist/protocols/mcp/providers/BaseMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/CustomMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/CustomMcpClient.js +7 -0
- package/dist/protocols/mcp/providers/CustomMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/GeminiMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/GeminiMcpClient.js +1 -0
- package/dist/protocols/mcp/providers/GeminiMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/OllamaMcpClient.d.ts +1 -0
- package/dist/protocols/mcp/providers/OllamaMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/OllamaMcpClient.js +1 -0
- package/dist/protocols/mcp/providers/OllamaMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/OpenAiMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/OpenAiMcpClient.js +1 -0
- package/dist/protocols/mcp/providers/OpenAiMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/OpenRouterMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/OpenRouterMcpClient.js +2 -0
- package/dist/protocols/mcp/providers/OpenRouterMcpClient.js.map +1 -1
- package/dist/protocols/mcp/providers/XaiMcpClient.d.ts.map +1 -1
- package/dist/protocols/mcp/providers/XaiMcpClient.js +1 -0
- package/dist/protocols/mcp/providers/XaiMcpClient.js.map +1 -1
- package/dist/protocols/mcp/security/BrowserTargetGuard.d.ts +14 -0
- package/dist/protocols/mcp/security/BrowserTargetGuard.d.ts.map +1 -0
- package/dist/protocols/mcp/security/BrowserTargetGuard.js +55 -0
- package/dist/protocols/mcp/security/BrowserTargetGuard.js.map +1 -0
- package/dist/protocols/mcp/security/ExternalMcpRegistrationPolicy.d.ts +24 -0
- package/dist/protocols/mcp/security/ExternalMcpRegistrationPolicy.d.ts.map +1 -0
- package/dist/protocols/mcp/security/ExternalMcpRegistrationPolicy.js +33 -0
- package/dist/protocols/mcp/security/ExternalMcpRegistrationPolicy.js.map +1 -0
- package/dist/protocols/mcp/security/HttpTargetGuard.d.ts.map +1 -1
- package/dist/protocols/mcp/security/HttpTargetGuard.js +68 -6
- package/dist/protocols/mcp/security/HttpTargetGuard.js.map +1 -1
- package/dist/protocols/mcp/security/McpSecurityGuard.d.ts.map +1 -1
- package/dist/protocols/mcp/security/McpSecurityGuard.js +7 -5
- package/dist/protocols/mcp/security/McpSecurityGuard.js.map +1 -1
- package/dist/protocols/mcp/security/McpToolPolicy.d.ts +18 -0
- package/dist/protocols/mcp/security/McpToolPolicy.d.ts.map +1 -1
- package/dist/protocols/mcp/security/McpToolPolicy.js +60 -0
- package/dist/protocols/mcp/security/McpToolPolicy.js.map +1 -1
- package/dist/protocols/mcp/services/ExternalMcpServerManager.d.ts +25 -0
- package/dist/protocols/mcp/services/ExternalMcpServerManager.d.ts.map +1 -1
- package/dist/protocols/mcp/services/ExternalMcpServerManager.js +93 -17
- package/dist/protocols/mcp/services/ExternalMcpServerManager.js.map +1 -1
- package/dist/protocols/mcp/services/ExternalServerConfigs.d.ts +2 -2
- package/dist/protocols/mcp/services/ExternalServerConfigs.d.ts.map +1 -1
- package/dist/protocols/mcp/services/ExternalServerConfigs.js +25 -8
- package/dist/protocols/mcp/services/ExternalServerConfigs.js.map +1 -1
- package/dist/protocols/mcp/tools/AnalyticsTools.d.ts +3 -37
- package/dist/protocols/mcp/tools/AnalyticsTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/AnalyticsTools.js +134 -614
- package/dist/protocols/mcp/tools/AnalyticsTools.js.map +1 -1
- package/dist/protocols/mcp/tools/CodeAnalysisTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/CodeAnalysisTools.js +16 -13
- package/dist/protocols/mcp/tools/CodeAnalysisTools.js.map +1 -1
- package/dist/protocols/mcp/tools/EffectivenessTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/EffectivenessTools.js +94 -30
- package/dist/protocols/mcp/tools/EffectivenessTools.js.map +1 -1
- package/dist/protocols/mcp/tools/GitTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/GitTools.js +9 -5
- package/dist/protocols/mcp/tools/GitTools.js.map +1 -1
- package/dist/protocols/mcp/tools/InfrastructureTools.d.ts +10 -40
- package/dist/protocols/mcp/tools/InfrastructureTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/InfrastructureTools.js +29 -70
- package/dist/protocols/mcp/tools/InfrastructureTools.js.map +1 -1
- package/dist/protocols/mcp/tools/JsonTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/JsonTools.js +4 -4
- package/dist/protocols/mcp/tools/JsonTools.js.map +1 -1
- package/dist/protocols/mcp/tools/KnowledgeGraphTools.d.ts +55 -592
- package/dist/protocols/mcp/tools/KnowledgeGraphTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/KnowledgeGraphTools.js +169 -119
- package/dist/protocols/mcp/tools/KnowledgeGraphTools.js.map +1 -1
- package/dist/protocols/mcp/tools/MemorySearchTools.d.ts +6 -6
- package/dist/protocols/mcp/tools/MemorySearchTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/MemorySearchTools.js +107 -39
- package/dist/protocols/mcp/tools/MemorySearchTools.js.map +1 -1
- package/dist/protocols/mcp/tools/MemoryUtilityTools.d.ts +4 -5
- package/dist/protocols/mcp/tools/MemoryUtilityTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/MemoryUtilityTools.js +59 -208
- package/dist/protocols/mcp/tools/MemoryUtilityTools.js.map +1 -1
- package/dist/protocols/mcp/tools/PlanningTools.d.ts +2 -1
- package/dist/protocols/mcp/tools/PlanningTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/PlanningTools.js +111 -49
- package/dist/protocols/mcp/tools/PlanningTools.js.map +1 -1
- package/dist/protocols/mcp/tools/ProjectContextTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/ProjectContextTools.js +18 -12
- package/dist/protocols/mcp/tools/ProjectContextTools.js.map +1 -1
- package/dist/protocols/mcp/tools/SafetyTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/SafetyTools.js +16 -13
- package/dist/protocols/mcp/tools/SafetyTools.js.map +1 -1
- package/dist/protocols/mcp/tools/SearchProjectTools.d.ts +24 -7
- package/dist/protocols/mcp/tools/SearchProjectTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/SearchProjectTools.js +226 -126
- package/dist/protocols/mcp/tools/SearchProjectTools.js.map +1 -1
- package/dist/protocols/mcp/tools/TaskPlanningTools.d.ts +0 -32
- package/dist/protocols/mcp/tools/TaskPlanningTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/TaskPlanningTools.js +363 -450
- package/dist/protocols/mcp/tools/TaskPlanningTools.js.map +1 -1
- package/dist/protocols/mcp/tools/TestTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/TestTools.js +18 -11
- package/dist/protocols/mcp/tools/TestTools.js.map +1 -1
- package/dist/protocols/mcp/tools/TypeScriptTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/TypeScriptTools.js +22 -12
- package/dist/protocols/mcp/tools/TypeScriptTools.js.map +1 -1
- package/dist/protocols/mcp/tools/UserInputTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/UserInputTools.js +14 -1
- package/dist/protocols/mcp/tools/UserInputTools.js.map +1 -1
- package/dist/protocols/mcp/tools/UserMemoryTools.d.ts +3 -1
- package/dist/protocols/mcp/tools/UserMemoryTools.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/UserMemoryTools.js +27 -62
- package/dist/protocols/mcp/tools/UserMemoryTools.js.map +1 -1
- package/dist/protocols/mcp/tools/shell/ShellExecuteHandler.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/shell/ShellExecuteHandler.js +14 -60
- package/dist/protocols/mcp/tools/shell/ShellExecuteHandler.js.map +1 -1
- package/dist/protocols/mcp/tools/shell/ShellSandbox.d.ts.map +1 -1
- package/dist/protocols/mcp/tools/shell/ShellSandbox.js +9 -27
- package/dist/protocols/mcp/tools/shell/ShellSandbox.js.map +1 -1
- package/dist/repositories/interfaces/IKnowledgeGraphRepository.d.ts +40 -30
- package/dist/repositories/interfaces/IKnowledgeGraphRepository.d.ts.map +1 -1
- package/dist/schemas/EventPayloadSchema.d.ts +28 -0
- package/dist/schemas/EventPayloadSchema.d.ts.map +1 -1
- package/dist/schemas/EventPayloadSchema.js +30 -1
- package/dist/schemas/EventPayloadSchema.js.map +1 -1
- package/dist/schemas/MxpProtocolSchemas.d.ts +6 -6
- package/dist/services/AgentPerformanceService.d.ts +11 -0
- package/dist/services/AgentPerformanceService.d.ts.map +1 -1
- package/dist/services/AgentPerformanceService.js +59 -33
- package/dist/services/AgentPerformanceService.js.map +1 -1
- package/dist/services/AutoCorrectionService.d.ts +3 -0
- package/dist/services/AutoCorrectionService.d.ts.map +1 -1
- package/dist/services/AutoCorrectionService.js +19 -2
- package/dist/services/AutoCorrectionService.js.map +1 -1
- package/dist/services/BackgroundTaskManager.d.ts +23 -7
- package/dist/services/BackgroundTaskManager.d.ts.map +1 -1
- package/dist/services/BackgroundTaskManager.js +137 -57
- package/dist/services/BackgroundTaskManager.js.map +1 -1
- package/dist/services/BrowserManager.d.ts +2 -0
- package/dist/services/BrowserManager.d.ts.map +1 -1
- package/dist/services/BrowserManager.js +18 -15
- package/dist/services/BrowserManager.js.map +1 -1
- package/dist/services/ChannelContextMemoryOperations.d.ts +8 -1
- package/dist/services/ChannelContextMemoryOperations.d.ts.map +1 -1
- package/dist/services/ChannelContextMemoryOperations.js +89 -165
- package/dist/services/ChannelContextMemoryOperations.js.map +1 -1
- package/dist/services/ChannelContextMessageOperations.d.ts +4 -3
- package/dist/services/ChannelContextMessageOperations.d.ts.map +1 -1
- package/dist/services/ChannelContextMessageOperations.js +72 -212
- package/dist/services/ChannelContextMessageOperations.js.map +1 -1
- package/dist/services/MemoryService.d.ts +52 -21
- package/dist/services/MemoryService.d.ts.map +1 -1
- package/dist/services/MemoryService.js +775 -548
- package/dist/services/MemoryService.js.map +1 -1
- package/dist/services/PatternLearningService.d.ts +5 -0
- package/dist/services/PatternLearningService.d.ts.map +1 -1
- package/dist/services/PatternLearningService.js +26 -3
- package/dist/services/PatternLearningService.js.map +1 -1
- package/dist/services/PerformanceOptimizationService.d.ts +2 -1
- package/dist/services/PerformanceOptimizationService.d.ts.map +1 -1
- package/dist/services/PerformanceOptimizationService.js +21 -6
- package/dist/services/PerformanceOptimizationService.js.map +1 -1
- package/dist/services/PredictiveAnalyticsService.d.ts +1 -0
- package/dist/services/PredictiveAnalyticsService.d.ts.map +1 -1
- package/dist/services/PredictiveAnalyticsService.js +18 -6
- package/dist/services/PredictiveAnalyticsService.js.map +1 -1
- package/dist/services/ProactiveValidationService.d.ts +6 -0
- package/dist/services/ProactiveValidationService.d.ts.map +1 -1
- package/dist/services/ProactiveValidationService.js +58 -39
- package/dist/services/ProactiveValidationService.js.map +1 -1
- package/dist/services/TaskEffectivenessService.d.ts +55 -31
- package/dist/services/TaskEffectivenessService.d.ts.map +1 -1
- package/dist/services/TaskEffectivenessService.js +243 -125
- package/dist/services/TaskEffectivenessService.js.map +1 -1
- package/dist/services/ToolExecutionInterceptor.d.ts +4 -0
- package/dist/services/ToolExecutionInterceptor.d.ts.map +1 -1
- package/dist/services/ToolExecutionInterceptor.js +31 -5
- package/dist/services/ToolExecutionInterceptor.js.map +1 -1
- package/dist/services/UserInputRequestManager.d.ts +13 -3
- package/dist/services/UserInputRequestManager.d.ts.map +1 -1
- package/dist/services/UserInputRequestManager.js +42 -6
- package/dist/services/UserInputRequestManager.js.map +1 -1
- package/dist/services/UserMemoryService.d.ts +2 -0
- package/dist/services/UserMemoryService.d.ts.map +1 -1
- package/dist/services/UserMemoryService.js +9 -4
- package/dist/services/UserMemoryService.js.map +1 -1
- package/dist/services/ValidationAnalyticsService.d.ts +4 -0
- package/dist/services/ValidationAnalyticsService.d.ts.map +1 -1
- package/dist/services/ValidationAnalyticsService.js +30 -8
- package/dist/services/ValidationAnalyticsService.js.map +1 -1
- package/dist/services/ValidationCacheService.d.ts +3 -1
- package/dist/services/ValidationCacheService.d.ts.map +1 -1
- package/dist/services/ValidationCacheService.js +25 -4
- package/dist/services/ValidationCacheService.js.map +1 -1
- package/dist/services/ValidationMiddleware.d.ts +7 -0
- package/dist/services/ValidationMiddleware.d.ts.map +1 -1
- package/dist/services/ValidationMiddleware.js +53 -10
- package/dist/services/ValidationMiddleware.js.map +1 -1
- package/dist/services/ValidationPerformanceService.d.ts +3 -0
- package/dist/services/ValidationPerformanceService.d.ts.map +1 -1
- package/dist/services/ValidationPerformanceService.js +28 -11
- package/dist/services/ValidationPerformanceService.js.map +1 -1
- package/dist/services/WebSearchService.d.ts.map +1 -1
- package/dist/services/WebSearchService.js +9 -0
- package/dist/services/WebSearchService.js.map +1 -1
- package/dist/services/dag/TaskDagService.d.ts +3 -0
- package/dist/services/dag/TaskDagService.d.ts.map +1 -1
- package/dist/services/dag/TaskDagService.js +18 -0
- package/dist/services/dag/TaskDagService.js.map +1 -1
- package/dist/services/kg/EntityQValueManager.d.ts +3 -1
- package/dist/services/kg/EntityQValueManager.d.ts.map +1 -1
- package/dist/services/kg/EntityQValueManager.js +10 -10
- package/dist/services/kg/EntityQValueManager.js.map +1 -1
- package/dist/services/kg/GraphSurpriseCalculator.d.ts +0 -4
- package/dist/services/kg/GraphSurpriseCalculator.d.ts.map +1 -1
- package/dist/services/kg/GraphSurpriseCalculator.js +0 -9
- package/dist/services/kg/GraphSurpriseCalculator.js.map +1 -1
- package/dist/services/kg/KnowledgeGraphService.d.ts +12 -12
- package/dist/services/kg/KnowledgeGraphService.d.ts.map +1 -1
- package/dist/services/kg/KnowledgeGraphService.js +43 -51
- package/dist/services/kg/KnowledgeGraphService.js.map +1 -1
- package/dist/services/kg/OrparGraphIntegration.d.ts.map +1 -1
- package/dist/services/kg/OrparGraphIntegration.js +6 -5
- package/dist/services/kg/OrparGraphIntegration.js.map +1 -1
- package/dist/services/orpar-memory/CycleConsolidationTrigger.d.ts +1 -0
- package/dist/services/orpar-memory/CycleConsolidationTrigger.d.ts.map +1 -1
- package/dist/services/orpar-memory/CycleConsolidationTrigger.js +8 -1
- package/dist/services/orpar-memory/CycleConsolidationTrigger.js.map +1 -1
- package/dist/services/orpar-memory/OrparMemoryCoordinator.d.ts +8 -1
- package/dist/services/orpar-memory/OrparMemoryCoordinator.d.ts.map +1 -1
- package/dist/services/orpar-memory/OrparMemoryCoordinator.js +93 -45
- package/dist/services/orpar-memory/OrparMemoryCoordinator.js.map +1 -1
- package/dist/services/orpar-memory/SurpriseOrparAdapter.d.ts +1 -0
- package/dist/services/orpar-memory/SurpriseOrparAdapter.d.ts.map +1 -1
- package/dist/services/orpar-memory/SurpriseOrparAdapter.js +8 -1
- package/dist/services/orpar-memory/SurpriseOrparAdapter.js.map +1 -1
- package/dist/types/ChannelContext.d.ts +2 -1
- package/dist/types/ChannelContext.d.ts.map +1 -1
- package/dist/types/EffectivenessTypes.d.ts +4 -1
- package/dist/types/EffectivenessTypes.d.ts.map +1 -1
- package/dist/types/TaskCompletionTypes.d.ts +7 -5
- package/dist/types/TaskCompletionTypes.d.ts.map +1 -1
- package/dist/types/TaskTypes.d.ts +8 -1
- package/dist/types/TaskTypes.d.ts.map +1 -1
- package/dist/utils/GlobMatcher.d.ts +37 -0
- package/dist/utils/GlobMatcher.d.ts.map +1 -0
- package/dist/utils/GlobMatcher.js +131 -0
- package/dist/utils/GlobMatcher.js.map +1 -0
- package/package.json +1 -1
- package/src/config/ModelContextLimits.ts +7 -1
- package/src/constants/CoreTools.ts +6 -5
- package/src/constants/DefaultPhaseProfiles.ts +29 -0
- package/src/constants/ReservedIdentities.ts +51 -0
- package/src/database/adapters/mongodb/MongoKnowledgeGraphRepository.ts +115 -36
- package/src/events/ClientEventBus.ts +117 -48
- package/src/events/EventBus.ts +32 -2
- package/src/events/EventBusBase.ts +132 -39
- package/src/events/EventNames.ts +43 -36
- package/src/events/PublicEvents.ts +8 -0
- package/src/events/ServerEventBus.ts +9 -128
- package/src/events/event-definitions/ControlLoopEvents.ts +12 -0
- package/src/events/event-definitions/SdkEvents.ts +58 -0
- package/src/events/event-definitions/TaskEvents.ts +2 -2
- package/src/index.ts +15 -0
- package/src/interfaces/AgentInterfaces.ts +5 -0
- package/src/interfaces/ChannelConfig.ts +2 -2
- package/src/interfaces/ConversationMessage.ts +5 -0
- package/src/interfaces/IMemoryPersistence.ts +55 -1
- package/src/interfaces/SocketServiceInterface.ts +3 -2
- package/src/interfaces/TaskInterfaces.ts +16 -1
- package/src/models/agent.ts +0 -6
- package/src/models/agentIdentityReservation.ts +77 -0
- package/src/models/channel.ts +2 -0
- package/src/models/channelKey.ts +10 -0
- package/src/models/memory.ts +18 -19
- package/src/models/memoryStrata.ts +9 -23
- package/src/models/plan.ts +3 -3
- package/src/models/taskEffectiveness.ts +9 -2
- package/src/models/user.ts +12 -0
- package/src/protocols/mcp/LlmTestEnvironmentGuard.ts +30 -0
- package/src/protocols/mcp/McpServerTypes.ts +9 -0
- package/src/protocols/mcp/providers/AnthropicMcpClient.ts +2 -0
- package/src/protocols/mcp/providers/AzureOpenAiMcpClient.ts +1 -0
- package/src/protocols/mcp/providers/BaseMcpClient.ts +13 -0
- package/src/protocols/mcp/providers/CustomMcpClient.ts +7 -0
- package/src/protocols/mcp/providers/GeminiMcpClient.ts +2 -0
- package/src/protocols/mcp/providers/OllamaMcpClient.ts +3 -1
- package/src/protocols/mcp/providers/OpenAiMcpClient.ts +2 -0
- package/src/protocols/mcp/providers/OpenRouterMcpClient.ts +3 -0
- package/src/protocols/mcp/providers/XaiMcpClient.ts +2 -0
- package/src/protocols/mcp/security/BrowserTargetGuard.ts +64 -0
- package/src/protocols/mcp/security/ExternalMcpRegistrationPolicy.ts +38 -0
- package/src/protocols/mcp/security/HttpTargetGuard.ts +77 -6
- package/src/protocols/mcp/security/McpSecurityGuard.ts +7 -5
- package/src/protocols/mcp/security/McpToolPolicy.ts +74 -0
- package/src/protocols/mcp/services/ExternalMcpServerManager.ts +146 -17
- package/src/protocols/mcp/services/ExternalServerConfigs.ts +26 -8
- package/src/protocols/mcp/tools/AnalyticsTools.ts +167 -641
- package/src/protocols/mcp/tools/CodeAnalysisTools.ts +44 -14
- package/src/protocols/mcp/tools/EffectivenessTools.ts +185 -45
- package/src/protocols/mcp/tools/GitTools.ts +15 -5
- package/src/protocols/mcp/tools/InfrastructureTools.ts +42 -90
- package/src/protocols/mcp/tools/JsonTools.ts +7 -4
- package/src/protocols/mcp/tools/KnowledgeGraphTools.ts +313 -164
- package/src/protocols/mcp/tools/MemorySearchTools.ts +158 -46
- package/src/protocols/mcp/tools/MemoryUtilityTools.ts +85 -232
- package/src/protocols/mcp/tools/PlanningTools.ts +137 -59
- package/src/protocols/mcp/tools/ProjectContextTools.ts +33 -12
- package/src/protocols/mcp/tools/SafetyTools.ts +49 -13
- package/src/protocols/mcp/tools/SearchProjectTools.ts +294 -153
- package/src/protocols/mcp/tools/TaskPlanningTools.ts +437 -514
- package/src/protocols/mcp/tools/TestTools.ts +41 -11
- package/src/protocols/mcp/tools/TypeScriptTools.ts +61 -12
- package/src/protocols/mcp/tools/UserInputTools.ts +15 -1
- package/src/protocols/mcp/tools/UserMemoryTools.ts +27 -62
- package/src/protocols/mcp/tools/shell/ShellExecuteHandler.ts +26 -84
- package/src/protocols/mcp/tools/shell/ShellSandbox.ts +13 -31
- package/src/repositories/interfaces/IKnowledgeGraphRepository.ts +45 -27
- package/src/schemas/EventPayloadSchema.ts +45 -1
- package/src/services/AgentPerformanceService.ts +85 -36
- package/src/services/AutoCorrectionService.ts +25 -6
- package/src/services/BackgroundTaskManager.ts +183 -76
- package/src/services/BrowserManager.ts +20 -16
- package/src/services/ChannelContextMemoryOperations.ts +169 -202
- package/src/services/ChannelContextMessageOperations.ts +112 -274
- package/src/services/MemoryService.ts +1053 -760
- package/src/services/PatternLearningService.ts +32 -7
- package/src/services/PerformanceOptimizationService.ts +26 -9
- package/src/services/PredictiveAnalyticsService.ts +23 -10
- package/src/services/ProactiveValidationService.ts +66 -40
- package/src/services/TaskEffectivenessService.ts +421 -206
- package/src/services/ToolExecutionInterceptor.ts +40 -9
- package/src/services/UserInputRequestManager.ts +51 -6
- package/src/services/UserMemoryService.ts +12 -3
- package/src/services/ValidationAnalyticsService.ts +36 -11
- package/src/services/ValidationCacheService.ts +30 -7
- package/src/services/ValidationMiddleware.ts +62 -14
- package/src/services/ValidationPerformanceService.ts +47 -25
- package/src/services/WebSearchService.ts +16 -4
- package/src/services/dag/TaskDagService.ts +20 -1
- package/src/services/kg/EntityQValueManager.ts +21 -10
- package/src/services/kg/GraphSurpriseCalculator.ts +0 -14
- package/src/services/kg/KnowledgeGraphService.ts +56 -48
- package/src/services/kg/OrparGraphIntegration.ts +11 -5
- package/src/services/orpar-memory/CycleConsolidationTrigger.ts +10 -1
- package/src/services/orpar-memory/OrparMemoryCoordinator.ts +142 -71
- package/src/services/orpar-memory/SurpriseOrparAdapter.ts +10 -1
- package/src/types/ChannelContext.ts +3 -1
- package/src/types/EffectivenessTypes.ts +6 -2
- package/src/types/TaskCompletionTypes.ts +9 -9
- package/src/types/TaskTypes.ts +12 -1
- package/src/utils/GlobMatcher.ts +157 -0
|
@@ -40,15 +40,27 @@ import { TOOL_CATEGORIES } from '../../../constants/ToolNames.js';
|
|
|
40
40
|
import { defineTool, ToolRunContext } from '../defineTool.js';
|
|
41
41
|
import { ToolError } from '../ToolError.js';
|
|
42
42
|
import { executeShellCommand } from './InfrastructureTools.js';
|
|
43
|
+
import { resolveWorkspacePath } from '../security/McpToolPolicy.js';
|
|
43
44
|
|
|
44
45
|
/** Exit code the shell reports when a command could not be found or spawned. */
|
|
45
46
|
const COMMAND_NOT_FOUND = 127;
|
|
46
47
|
|
|
47
48
|
const workingDirectoryProperty = {
|
|
48
49
|
type: 'string',
|
|
49
|
-
description: 'Working directory
|
|
50
|
+
description: 'Working directory under MXF_WORKSPACE_ROOT (defaults to MXF_WORKSPACE_ROOT)'
|
|
50
51
|
};
|
|
51
52
|
|
|
53
|
+
function resolveTestFiles(
|
|
54
|
+
inputs: string[] | undefined,
|
|
55
|
+
workingDirectory: string,
|
|
56
|
+
consumer: string
|
|
57
|
+
): string[] {
|
|
58
|
+
return (inputs ?? []).map(input => resolveWorkspacePath(
|
|
59
|
+
path.resolve(workingDirectory, input),
|
|
60
|
+
consumer
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
52
64
|
/** Outcome of a test run, in the shape every runner here reports. */
|
|
53
65
|
export interface TestRunResult {
|
|
54
66
|
runner: 'jest' | 'mocha' | 'vitest';
|
|
@@ -80,7 +92,7 @@ async function runTestRunner(
|
|
|
80
92
|
channelId: context.channelId,
|
|
81
93
|
requestId: context.requestId
|
|
82
94
|
},
|
|
83
|
-
workingDirectory
|
|
95
|
+
workingDirectory,
|
|
84
96
|
captureOutput: true
|
|
85
97
|
});
|
|
86
98
|
|
|
@@ -197,6 +209,10 @@ export const jestTestTool = defineTool<
|
|
|
197
209
|
}
|
|
198
210
|
},
|
|
199
211
|
run: async (input, context) => {
|
|
212
|
+
const workingDirectory = resolveWorkspacePath(
|
|
213
|
+
input.workingDirectory,
|
|
214
|
+
'test_jest workingDirectory'
|
|
215
|
+
);
|
|
200
216
|
const args = ['--no-watchman', '--passWithNoTests'];
|
|
201
217
|
|
|
202
218
|
if (input.coverage) {
|
|
@@ -212,10 +228,10 @@ export const jestTestTool = defineTool<
|
|
|
212
228
|
args.push('--testNamePattern', input.testNamePattern);
|
|
213
229
|
}
|
|
214
230
|
if (input.testFiles && input.testFiles.length > 0) {
|
|
215
|
-
args.push(...input.testFiles);
|
|
231
|
+
args.push(...resolveTestFiles(input.testFiles, workingDirectory, 'test_jest file'));
|
|
216
232
|
}
|
|
217
233
|
|
|
218
|
-
return runTestRunner('jest', args,
|
|
234
|
+
return runTestRunner('jest', args, workingDirectory, context);
|
|
219
235
|
}
|
|
220
236
|
});
|
|
221
237
|
|
|
@@ -265,6 +281,10 @@ export const mochaTestTool = defineTool<
|
|
|
265
281
|
}
|
|
266
282
|
},
|
|
267
283
|
run: async (input, context) => {
|
|
284
|
+
const workingDirectory = resolveWorkspacePath(
|
|
285
|
+
input.workingDirectory,
|
|
286
|
+
'test_mocha workingDirectory'
|
|
287
|
+
);
|
|
268
288
|
const args: string[] = [];
|
|
269
289
|
|
|
270
290
|
if (input.reporter) {
|
|
@@ -280,10 +300,10 @@ export const mochaTestTool = defineTool<
|
|
|
280
300
|
args.push('--recursive');
|
|
281
301
|
}
|
|
282
302
|
if (input.testFiles && input.testFiles.length > 0) {
|
|
283
|
-
args.push(...input.testFiles);
|
|
303
|
+
args.push(...resolveTestFiles(input.testFiles, workingDirectory, 'test_mocha file'));
|
|
284
304
|
}
|
|
285
305
|
|
|
286
|
-
return runTestRunner('mocha', args,
|
|
306
|
+
return runTestRunner('mocha', args, workingDirectory, context);
|
|
287
307
|
}
|
|
288
308
|
});
|
|
289
309
|
|
|
@@ -322,6 +342,10 @@ export const vitestTestTool = defineTool<
|
|
|
322
342
|
}
|
|
323
343
|
},
|
|
324
344
|
run: async (input, context) => {
|
|
345
|
+
const workingDirectory = resolveWorkspacePath(
|
|
346
|
+
input.workingDirectory,
|
|
347
|
+
'test_vitest workingDirectory'
|
|
348
|
+
);
|
|
325
349
|
// `run` is Vitest's non-watching mode. Without it Vitest watches by
|
|
326
350
|
// default and the process would never exit.
|
|
327
351
|
const args = ['run'];
|
|
@@ -333,10 +357,10 @@ export const vitestTestTool = defineTool<
|
|
|
333
357
|
args.push('--reporter', input.reporter);
|
|
334
358
|
}
|
|
335
359
|
if (input.testFiles && input.testFiles.length > 0) {
|
|
336
|
-
args.push(...input.testFiles);
|
|
360
|
+
args.push(...resolveTestFiles(input.testFiles, workingDirectory, 'test_vitest file'));
|
|
337
361
|
}
|
|
338
362
|
|
|
339
|
-
return runTestRunner('vitest', args,
|
|
363
|
+
return runTestRunner('vitest', args, workingDirectory, context);
|
|
340
364
|
}
|
|
341
365
|
});
|
|
342
366
|
|
|
@@ -348,7 +372,10 @@ export const vitestTestTool = defineTool<
|
|
|
348
372
|
* steps later.
|
|
349
373
|
*/
|
|
350
374
|
async function detectFramework(workingDirectory: string): Promise<'jest' | 'mocha' | 'vitest'> {
|
|
351
|
-
const packageJsonPath =
|
|
375
|
+
const packageJsonPath = resolveWorkspacePath(
|
|
376
|
+
path.join(workingDirectory, 'package.json'),
|
|
377
|
+
'test_runner package.json'
|
|
378
|
+
);
|
|
352
379
|
|
|
353
380
|
let raw: string;
|
|
354
381
|
try {
|
|
@@ -426,7 +453,10 @@ export const testRunnerTool = defineTool<
|
|
|
426
453
|
}
|
|
427
454
|
},
|
|
428
455
|
run: async (input, context) => {
|
|
429
|
-
const workingDirectory =
|
|
456
|
+
const workingDirectory = resolveWorkspacePath(
|
|
457
|
+
input.workingDirectory,
|
|
458
|
+
'test_runner workingDirectory'
|
|
459
|
+
);
|
|
430
460
|
const requested = input.framework ?? 'auto';
|
|
431
461
|
|
|
432
462
|
const detected = requested === 'auto';
|
|
@@ -459,7 +489,7 @@ export const testRunnerTool = defineTool<
|
|
|
459
489
|
}
|
|
460
490
|
|
|
461
491
|
if (input.testFiles && input.testFiles.length > 0) {
|
|
462
|
-
args.push(...input.testFiles);
|
|
492
|
+
args.push(...resolveTestFiles(input.testFiles, workingDirectory, 'test_runner file'));
|
|
463
493
|
}
|
|
464
494
|
|
|
465
495
|
const result = await runTestRunner(framework, args, workingDirectory, context);
|
|
@@ -38,15 +38,28 @@ import { TOOL_CATEGORIES } from '../../../constants/ToolNames.js';
|
|
|
38
38
|
import { defineTool, ToolRunContext } from '../defineTool.js';
|
|
39
39
|
import { ToolError } from '../ToolError.js';
|
|
40
40
|
import { executeShellCommand, ShellCommandResult } from './InfrastructureTools.js';
|
|
41
|
+
import * as path from 'path';
|
|
42
|
+
import { resolveWorkspacePath } from '../security/McpToolPolicy.js';
|
|
41
43
|
|
|
42
44
|
/** Exit code the shell reports when a command could not be found or spawned. */
|
|
43
45
|
const COMMAND_NOT_FOUND = 127;
|
|
44
46
|
|
|
45
47
|
const workingDirectoryProperty = {
|
|
46
48
|
type: 'string',
|
|
47
|
-
description: 'Working directory
|
|
49
|
+
description: 'Working directory under MXF_WORKSPACE_ROOT (defaults to MXF_WORKSPACE_ROOT)'
|
|
48
50
|
};
|
|
49
51
|
|
|
52
|
+
function resolveInputPaths(
|
|
53
|
+
inputs: string[] | undefined,
|
|
54
|
+
workingDirectory: string,
|
|
55
|
+
consumer: string
|
|
56
|
+
): string[] {
|
|
57
|
+
return (inputs ?? []).map(input => resolveWorkspacePath(
|
|
58
|
+
path.resolve(workingDirectory, input),
|
|
59
|
+
consumer
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
50
63
|
/**
|
|
51
64
|
* Run one of the node toolchain binaries via npx.
|
|
52
65
|
*
|
|
@@ -64,7 +77,7 @@ async function runNpx(
|
|
|
64
77
|
channelId: context.channelId,
|
|
65
78
|
requestId: context.requestId
|
|
66
79
|
},
|
|
67
|
-
workingDirectory
|
|
80
|
+
workingDirectory,
|
|
68
81
|
captureOutput: true
|
|
69
82
|
});
|
|
70
83
|
|
|
@@ -144,12 +157,20 @@ export const typescriptCheckTool = defineTool<
|
|
|
144
157
|
}
|
|
145
158
|
},
|
|
146
159
|
run: async (input, context) => {
|
|
160
|
+
const workingDirectory = resolveWorkspacePath(
|
|
161
|
+
input.workingDirectory,
|
|
162
|
+
'typescript_check workingDirectory'
|
|
163
|
+
);
|
|
147
164
|
const tscArgs = ['tsc', '--noEmit', '--pretty', 'false'];
|
|
148
165
|
if (input.files && input.files.length > 0) {
|
|
149
|
-
tscArgs.push(...
|
|
166
|
+
tscArgs.push(...resolveInputPaths(
|
|
167
|
+
input.files,
|
|
168
|
+
workingDirectory,
|
|
169
|
+
'typescript_check file'
|
|
170
|
+
));
|
|
150
171
|
}
|
|
151
172
|
|
|
152
|
-
const result = await runNpx(tscArgs,
|
|
173
|
+
const result = await runNpx(tscArgs, workingDirectory, context);
|
|
153
174
|
|
|
154
175
|
// tsc writes diagnostics to stdout and exits 1 when it finds any. That is
|
|
155
176
|
// the tool working, not the tool failing.
|
|
@@ -195,11 +216,15 @@ export const typescriptBuildTool = defineTool<
|
|
|
195
216
|
},
|
|
196
217
|
run: async (input, context) => {
|
|
197
218
|
const startedAt = Date.now();
|
|
219
|
+
const workingDirectory = resolveWorkspacePath(
|
|
220
|
+
input.workingDirectory,
|
|
221
|
+
'typescript_build workingDirectory'
|
|
222
|
+
);
|
|
198
223
|
|
|
199
224
|
if (input.clean) {
|
|
200
225
|
const cleanResult = await runNpx(
|
|
201
226
|
['tsc', '--build', '--clean'],
|
|
202
|
-
|
|
227
|
+
workingDirectory,
|
|
203
228
|
context
|
|
204
229
|
);
|
|
205
230
|
// A failed clean leaves stale output behind, which makes the build's
|
|
@@ -212,7 +237,7 @@ export const typescriptBuildTool = defineTool<
|
|
|
212
237
|
}
|
|
213
238
|
}
|
|
214
239
|
|
|
215
|
-
const result = await runNpx(['tsc', '--build'],
|
|
240
|
+
const result = await runNpx(['tsc', '--build'], workingDirectory, context);
|
|
216
241
|
|
|
217
242
|
const errors = (result.stdout ?? '')
|
|
218
243
|
.split('\n')
|
|
@@ -255,15 +280,23 @@ export const typescriptFormatTool = defineTool<
|
|
|
255
280
|
},
|
|
256
281
|
run: async (input, context) => {
|
|
257
282
|
const mode: 'check' | 'write' = input.check ? 'check' : 'write';
|
|
283
|
+
const workingDirectory = resolveWorkspacePath(
|
|
284
|
+
input.workingDirectory,
|
|
285
|
+
'typescript_format workingDirectory'
|
|
286
|
+
);
|
|
258
287
|
const prettierArgs = ['prettier', input.check ? '--check' : '--write'];
|
|
259
288
|
|
|
260
289
|
if (input.files && input.files.length > 0) {
|
|
261
|
-
prettierArgs.push(...
|
|
290
|
+
prettierArgs.push(...resolveInputPaths(
|
|
291
|
+
input.files,
|
|
292
|
+
workingDirectory,
|
|
293
|
+
'typescript_format file'
|
|
294
|
+
));
|
|
262
295
|
} else {
|
|
263
296
|
prettierArgs.push('**/*.{ts,tsx,js,jsx}');
|
|
264
297
|
}
|
|
265
298
|
|
|
266
|
-
const result = await runNpx(prettierArgs,
|
|
299
|
+
const result = await runNpx(prettierArgs, workingDirectory, context);
|
|
267
300
|
|
|
268
301
|
// In check mode prettier exits 1 when files need formatting — a finding,
|
|
269
302
|
// not a failure. In write mode a non-zero exit means it could not write.
|
|
@@ -314,18 +347,26 @@ export const typescriptLintTool = defineTool<
|
|
|
314
347
|
}
|
|
315
348
|
},
|
|
316
349
|
run: async (input, context) => {
|
|
350
|
+
const workingDirectory = resolveWorkspacePath(
|
|
351
|
+
input.workingDirectory,
|
|
352
|
+
'typescript_lint workingDirectory'
|
|
353
|
+
);
|
|
317
354
|
const eslintArgs = ['eslint', '--format', 'json'];
|
|
318
355
|
if (input.fix) {
|
|
319
356
|
eslintArgs.push('--fix');
|
|
320
357
|
}
|
|
321
358
|
|
|
322
359
|
if (input.files && input.files.length > 0) {
|
|
323
|
-
eslintArgs.push(...
|
|
360
|
+
eslintArgs.push(...resolveInputPaths(
|
|
361
|
+
input.files,
|
|
362
|
+
workingDirectory,
|
|
363
|
+
'typescript_lint file'
|
|
364
|
+
));
|
|
324
365
|
} else {
|
|
325
366
|
eslintArgs.push('**/*.{ts,tsx,js,jsx}');
|
|
326
367
|
}
|
|
327
368
|
|
|
328
|
-
const result = await runNpx(eslintArgs,
|
|
369
|
+
const result = await runNpx(eslintArgs, workingDirectory, context);
|
|
329
370
|
|
|
330
371
|
// ESLint exits 1 when it finds errors, but always prints its JSON report.
|
|
331
372
|
// No parseable report means ESLint itself fell over — that is a failure,
|
|
@@ -386,16 +427,24 @@ export const typescriptTestTool = defineTool<
|
|
|
386
427
|
}
|
|
387
428
|
},
|
|
388
429
|
run: async (input, context) => {
|
|
430
|
+
const workingDirectory = resolveWorkspacePath(
|
|
431
|
+
input.workingDirectory,
|
|
432
|
+
'typescript_test workingDirectory'
|
|
433
|
+
);
|
|
389
434
|
const jestArgs = ['jest', '--no-watchman', '--passWithNoTests'];
|
|
390
435
|
|
|
391
436
|
if (input.coverage) {
|
|
392
437
|
jestArgs.push('--coverage');
|
|
393
438
|
}
|
|
394
439
|
if (input.testFiles && input.testFiles.length > 0) {
|
|
395
|
-
jestArgs.push(...
|
|
440
|
+
jestArgs.push(...resolveInputPaths(
|
|
441
|
+
input.testFiles,
|
|
442
|
+
workingDirectory,
|
|
443
|
+
'typescript_test file'
|
|
444
|
+
));
|
|
396
445
|
}
|
|
397
446
|
|
|
398
|
-
const result = await runNpx(jestArgs,
|
|
447
|
+
const result = await runNpx(jestArgs, workingDirectory, context);
|
|
399
448
|
|
|
400
449
|
// Jest writes its summary to stderr, not stdout.
|
|
401
450
|
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
@@ -343,8 +343,22 @@ Use after calling request_user_input to retrieve the response.`,
|
|
|
343
343
|
context: McpToolHandlerContext
|
|
344
344
|
): Promise<McpToolHandlerResult> => {
|
|
345
345
|
try {
|
|
346
|
+
const agentId = context.agentId as AgentId;
|
|
347
|
+
const channelId = context.channelId as ChannelId;
|
|
348
|
+
if (!agentId || !channelId) {
|
|
349
|
+
return {
|
|
350
|
+
content: {
|
|
351
|
+
type: 'text',
|
|
352
|
+
data: JSON.stringify({
|
|
353
|
+
success: false,
|
|
354
|
+
error: 'Agent ID and channel ID are required to read a user input response'
|
|
355
|
+
})
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
346
360
|
const manager = UserInputRequestManager.getInstance();
|
|
347
|
-
const result = manager.getRequest(input.requestId);
|
|
361
|
+
const result = manager.getRequest(input.requestId, agentId, channelId);
|
|
348
362
|
|
|
349
363
|
if (!result) {
|
|
350
364
|
return {
|
|
@@ -45,12 +45,17 @@ const logger = new Logger('info', 'UserMemoryTools', 'server');
|
|
|
45
45
|
/** Valid memory types — used for input validation across all tools */
|
|
46
46
|
const VALID_TYPES: UserMemoryType[] = ['user', 'feedback', 'project', 'reference'];
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
/** Derive a collision-safe persistent scope from authenticated identity only. */
|
|
49
|
+
export function getUserMemoryScopeKey(context: McpToolHandlerContext): string {
|
|
50
|
+
if (typeof context.agentId !== 'string' || context.agentId.trim().length === 0 ||
|
|
51
|
+
typeof context.channelId !== 'string' || context.channelId.trim().length === 0) {
|
|
52
|
+
throw new Error('User memory requires exact authenticated agent and channel identity');
|
|
53
|
+
}
|
|
54
|
+
if (context.agentId !== context.agentId.trim() ||
|
|
55
|
+
context.channelId !== context.channelId.trim()) {
|
|
56
|
+
throw new Error('User memory identity must not contain surrounding whitespace');
|
|
57
|
+
}
|
|
58
|
+
return JSON.stringify([context.agentId, context.channelId]);
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
// ─── Tool: user_memory_save ───────────────────────────────────────────────────
|
|
@@ -99,27 +104,22 @@ export const userMemorySaveTool: McpToolDefinition = {
|
|
|
99
104
|
|
|
100
105
|
// Validate type is a recognised value
|
|
101
106
|
if (!VALID_TYPES.includes(type)) {
|
|
102
|
-
|
|
103
|
-
content: {
|
|
104
|
-
type: 'text',
|
|
105
|
-
data: `Invalid type "${type}". Must be one of: ${VALID_TYPES.join(', ')}.`
|
|
106
|
-
}
|
|
107
|
-
};
|
|
107
|
+
throw new Error(`Invalid type "${type}". Must be one of: ${VALID_TYPES.join(', ')}.`);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// Validate required string fields are non-empty
|
|
111
111
|
if (!title?.trim()) {
|
|
112
|
-
|
|
112
|
+
throw new Error('title must not be empty.');
|
|
113
113
|
}
|
|
114
114
|
if (!description?.trim()) {
|
|
115
|
-
|
|
115
|
+
throw new Error('description must not be empty.');
|
|
116
116
|
}
|
|
117
117
|
if (!content?.trim()) {
|
|
118
|
-
|
|
118
|
+
throw new Error('content must not be empty.');
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
try {
|
|
122
|
-
const userId =
|
|
122
|
+
const userId = getUserMemoryScopeKey(context);
|
|
123
123
|
const service = UserMemoryService.getInstance();
|
|
124
124
|
await service.save(userId, { type, title, description, content });
|
|
125
125
|
logger.info(`Saved user memory "${title}" (${type}) for userId=${userId}`);
|
|
@@ -132,12 +132,7 @@ export const userMemorySaveTool: McpToolDefinition = {
|
|
|
132
132
|
} catch (err) {
|
|
133
133
|
const message = err instanceof Error ? err.message : String(err);
|
|
134
134
|
logger.error('user_memory_save failed', err);
|
|
135
|
-
|
|
136
|
-
content: {
|
|
137
|
-
type: 'text',
|
|
138
|
-
data: `Failed to save memory: ${message}`
|
|
139
|
-
}
|
|
140
|
-
};
|
|
135
|
+
throw new Error(`Failed to save memory: ${message}`);
|
|
141
136
|
}
|
|
142
137
|
}
|
|
143
138
|
};
|
|
@@ -184,24 +179,19 @@ export const userMemoryRecallTool: McpToolDefinition = {
|
|
|
184
179
|
|
|
185
180
|
// Validate query is non-empty
|
|
186
181
|
if (!query?.trim()) {
|
|
187
|
-
|
|
182
|
+
throw new Error('query must not be empty.');
|
|
188
183
|
}
|
|
189
184
|
|
|
190
185
|
// Validate optional type
|
|
191
186
|
if (type !== undefined && !VALID_TYPES.includes(type)) {
|
|
192
|
-
|
|
193
|
-
content: {
|
|
194
|
-
type: 'text',
|
|
195
|
-
data: `Invalid type "${type}". Must be one of: ${VALID_TYPES.join(', ')}.`
|
|
196
|
-
}
|
|
197
|
-
};
|
|
187
|
+
throw new Error(`Invalid type "${type}". Must be one of: ${VALID_TYPES.join(', ')}.`);
|
|
198
188
|
}
|
|
199
189
|
|
|
200
190
|
// Clamp limit to 1–50
|
|
201
191
|
const resolvedLimit = limit !== undefined ? Math.min(50, Math.max(1, limit)) : 5;
|
|
202
192
|
|
|
203
193
|
try {
|
|
204
|
-
const userId =
|
|
194
|
+
const userId = getUserMemoryScopeKey(context);
|
|
205
195
|
const service = UserMemoryService.getInstance();
|
|
206
196
|
const results = await service.recall(userId, query, { type, limit: resolvedLimit });
|
|
207
197
|
|
|
@@ -227,12 +217,7 @@ export const userMemoryRecallTool: McpToolDefinition = {
|
|
|
227
217
|
} catch (err) {
|
|
228
218
|
const message = err instanceof Error ? err.message : String(err);
|
|
229
219
|
logger.error('user_memory_recall failed', err);
|
|
230
|
-
|
|
231
|
-
content: {
|
|
232
|
-
type: 'text',
|
|
233
|
-
data: `Failed to recall memories: ${message}`
|
|
234
|
-
}
|
|
235
|
-
};
|
|
220
|
+
throw new Error(`Failed to recall memories: ${message}`);
|
|
236
221
|
}
|
|
237
222
|
}
|
|
238
223
|
};
|
|
@@ -269,16 +254,11 @@ export const userMemoryForgetTool: McpToolDefinition = {
|
|
|
269
254
|
|
|
270
255
|
// Require at least one deletion target
|
|
271
256
|
if (!memoryId?.trim() && !searchTerm?.trim()) {
|
|
272
|
-
|
|
273
|
-
content: {
|
|
274
|
-
type: 'text',
|
|
275
|
-
data: 'At least one of memoryId or searchTerm must be provided.'
|
|
276
|
-
}
|
|
277
|
-
};
|
|
257
|
+
throw new Error('At least one of memoryId or searchTerm must be provided.');
|
|
278
258
|
}
|
|
279
259
|
|
|
280
260
|
try {
|
|
281
|
-
const userId =
|
|
261
|
+
const userId = getUserMemoryScopeKey(context);
|
|
282
262
|
const service = UserMemoryService.getInstance();
|
|
283
263
|
const { deleted } = await service.forget(userId, {
|
|
284
264
|
memoryId: memoryId?.trim() || undefined,
|
|
@@ -300,12 +280,7 @@ export const userMemoryForgetTool: McpToolDefinition = {
|
|
|
300
280
|
} catch (err) {
|
|
301
281
|
const message = err instanceof Error ? err.message : String(err);
|
|
302
282
|
logger.error('user_memory_forget failed', err);
|
|
303
|
-
|
|
304
|
-
content: {
|
|
305
|
-
type: 'text',
|
|
306
|
-
data: `Failed to delete memory: ${message}`
|
|
307
|
-
}
|
|
308
|
-
};
|
|
283
|
+
throw new Error(`Failed to delete memory: ${message}`);
|
|
309
284
|
}
|
|
310
285
|
}
|
|
311
286
|
};
|
|
@@ -338,16 +313,11 @@ export const userMemoryShakeTool: McpToolDefinition = {
|
|
|
338
313
|
|
|
339
314
|
// Validate thresholdDays if provided
|
|
340
315
|
if (thresholdDays !== undefined && (typeof thresholdDays !== 'number' || thresholdDays < 1)) {
|
|
341
|
-
|
|
342
|
-
content: {
|
|
343
|
-
type: 'text',
|
|
344
|
-
data: 'thresholdDays must be a number >= 1.'
|
|
345
|
-
}
|
|
346
|
-
};
|
|
316
|
+
throw new Error('thresholdDays must be a number >= 1.');
|
|
347
317
|
}
|
|
348
318
|
|
|
349
319
|
try {
|
|
350
|
-
const userId =
|
|
320
|
+
const userId = getUserMemoryScopeKey(context);
|
|
351
321
|
const service = UserMemoryService.getInstance();
|
|
352
322
|
const stale = await service.shake(userId, thresholdDays);
|
|
353
323
|
|
|
@@ -376,12 +346,7 @@ export const userMemoryShakeTool: McpToolDefinition = {
|
|
|
376
346
|
} catch (err) {
|
|
377
347
|
const message = err instanceof Error ? err.message : String(err);
|
|
378
348
|
logger.error('user_memory_shake failed', err);
|
|
379
|
-
|
|
380
|
-
content: {
|
|
381
|
-
type: 'text',
|
|
382
|
-
data: `Failed to shake memories: ${message}`
|
|
383
|
-
}
|
|
384
|
-
};
|
|
349
|
+
throw new Error(`Failed to shake memories: ${message}`);
|
|
385
350
|
}
|
|
386
351
|
}
|
|
387
352
|
};
|