@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
package/src/events/EventNames.ts
CHANGED
|
@@ -224,6 +224,11 @@ import type { ProgressPayloads } from './event-definitions/ProgressEvents.js';
|
|
|
224
224
|
export { ProgressEvents };
|
|
225
225
|
export type { ProgressPayloads };
|
|
226
226
|
|
|
227
|
+
import { SdkEvents } from './event-definitions/SdkEvents.js';
|
|
228
|
+
import type { SdkPayloads } from './event-definitions/SdkEvents.js';
|
|
229
|
+
export { SdkEvents };
|
|
230
|
+
export type { SdkPayloads };
|
|
231
|
+
|
|
227
232
|
/**
|
|
228
233
|
* Socket Authentication Events
|
|
229
234
|
* Used for socket authentication success/failure communication
|
|
@@ -236,41 +241,42 @@ export const AuthEvents = {
|
|
|
236
241
|
/**
|
|
237
242
|
* Unified export of all events for convenience
|
|
238
243
|
*/
|
|
239
|
-
export
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
244
|
+
export const Events = {
|
|
245
|
+
Core: CoreSocketEvents,
|
|
246
|
+
Agent: AgentEvents,
|
|
247
|
+
Message: MessageEvents,
|
|
248
|
+
Channel: ChannelEventsInternal,
|
|
249
|
+
Key: KeyEvents,
|
|
250
|
+
Task: TaskEvents,
|
|
251
|
+
LlmService: LlmServiceEvents,
|
|
252
|
+
ControlLoop: ControlLoopEvents,
|
|
253
|
+
Orpar: OrparEvents,
|
|
254
|
+
Heartbeat: HeartbeatEvents,
|
|
255
|
+
Mcp: McpEvents,
|
|
256
|
+
Memory: MemoryEventsInternal,
|
|
257
|
+
System: SystemEvents,
|
|
258
|
+
Analytics: AnalyticsEvents,
|
|
259
|
+
Config: ConfigEvents,
|
|
260
|
+
Bulk: BulkEvents,
|
|
261
|
+
Auth: AuthEvents,
|
|
262
|
+
Mxp: MxpEvents,
|
|
263
|
+
Meilisearch: MeilisearchEvents,
|
|
264
|
+
LlmBudget: LlmBudgetEvents,
|
|
265
|
+
CodeExecution: CodeExecutionEvents,
|
|
266
|
+
Shell: ShellExecutionEvents,
|
|
267
|
+
Workflow: WorkflowEvents,
|
|
268
|
+
InferenceParameter: InferenceParameterEvents,
|
|
269
|
+
Plan: PlanEvents,
|
|
270
|
+
MemoryUtility: MemoryUtilityEvents,
|
|
271
|
+
OrparMemory: OrparMemoryEvents,
|
|
272
|
+
Dag: DagEvents,
|
|
273
|
+
KnowledgeGraph: KnowledgeGraphEvents,
|
|
274
|
+
TensorFlow: TensorFlowEvents,
|
|
275
|
+
UserInput: UserInputEvents,
|
|
276
|
+
Compaction: CompactionEvents,
|
|
277
|
+
Progress: ProgressEvents,
|
|
278
|
+
Sdk: SdkEvents,
|
|
279
|
+
} as const;
|
|
274
280
|
|
|
275
281
|
/**
|
|
276
282
|
* Complete event map combining all event payloads
|
|
@@ -306,7 +312,8 @@ export type EventMap =
|
|
|
306
312
|
TensorFlowPayloads &
|
|
307
313
|
UserInputPayloads &
|
|
308
314
|
CompactionPayloads &
|
|
309
|
-
ProgressPayloads
|
|
315
|
+
ProgressPayloads &
|
|
316
|
+
SdkPayloads;
|
|
310
317
|
|
|
311
318
|
/**
|
|
312
319
|
* Event name type - any valid event name
|
|
@@ -165,6 +165,13 @@ export const PUBLIC_MEILISEARCH_EVENTS = [
|
|
|
165
165
|
Events.Meilisearch.BACKFILL_PARTIAL,
|
|
166
166
|
] as const;
|
|
167
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Public SDK Events - the SDK's own user connection
|
|
170
|
+
*/
|
|
171
|
+
export const PUBLIC_SDK_EVENTS = [
|
|
172
|
+
Events.Sdk.RECONNECTED,
|
|
173
|
+
] as const;
|
|
174
|
+
|
|
168
175
|
/**
|
|
169
176
|
* Combined array of all public events
|
|
170
177
|
*/
|
|
@@ -179,6 +186,7 @@ export const PUBLIC_EVENTS = [
|
|
|
179
186
|
...PUBLIC_CHANNEL_EVENTS,
|
|
180
187
|
...PUBLIC_USER_INPUT_EVENTS,
|
|
181
188
|
...PUBLIC_MEILISEARCH_EVENTS,
|
|
189
|
+
...PUBLIC_SDK_EVENTS,
|
|
182
190
|
] as const;
|
|
183
191
|
|
|
184
192
|
/**
|
|
@@ -27,16 +27,10 @@
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import { Subject } from 'rxjs';
|
|
30
|
-
import type { Server as SocketIOServer } from 'socket.io';
|
|
31
|
-
import { ControlLoopEvents } from './event-definitions/ControlLoopEvents.js';
|
|
32
|
-
import { OrparEvents } from './event-definitions/OrparEvents.js';
|
|
33
|
-
import { McpEvents } from './event-definitions/McpEvents.js';
|
|
34
|
-
import { TaskEvents } from './event-definitions/TaskEvents.js';
|
|
35
30
|
import {
|
|
36
31
|
AnyEventName,
|
|
37
32
|
BaseEventBusImplementation,
|
|
38
33
|
EventMessage,
|
|
39
|
-
isReservedEvent,
|
|
40
34
|
PayloadOf
|
|
41
35
|
} from './EventBusBase.js';
|
|
42
36
|
import { createStrictValidator } from '../utils/validation.js';
|
|
@@ -52,25 +46,6 @@ const validator = createStrictValidator('ServerEventBus');
|
|
|
52
46
|
* Server-side event bus interface
|
|
53
47
|
*/
|
|
54
48
|
export interface IServerEventBus extends BaseEventBusImplementation {
|
|
55
|
-
/**
|
|
56
|
-
* Set the Socket.IO server instance
|
|
57
|
-
* @param io Socket.IO server instance
|
|
58
|
-
* @returns this (for chaining)
|
|
59
|
-
*/
|
|
60
|
-
setSocketServer(io: SocketIOServer): this;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Clear the Socket.IO server instance
|
|
64
|
-
* @returns this (for chaining)
|
|
65
|
-
*/
|
|
66
|
-
clearSocketServer(): this;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Remove all server event listeners
|
|
70
|
-
* @returns this (for chaining)
|
|
71
|
-
*/
|
|
72
|
-
removeAllSocketListeners(): this;
|
|
73
|
-
|
|
74
49
|
/**
|
|
75
50
|
* Clean up all subscriptions and listeners
|
|
76
51
|
* @returns this (for chaining)
|
|
@@ -82,41 +57,6 @@ export interface IServerEventBus extends BaseEventBusImplementation {
|
|
|
82
57
|
* Server-side event bus implementation
|
|
83
58
|
*/
|
|
84
59
|
export class ServerEventBus extends BaseEventBusImplementation implements IServerEventBus {
|
|
85
|
-
/**
|
|
86
|
-
* Events delivered to specific agents/channels by eventForwardingHandlers.
|
|
87
|
-
* Broadcasting these over io.emit() would deliver them twice.
|
|
88
|
-
*/
|
|
89
|
-
private static readonly AGENT_SPECIFIC_EVENTS: ReadonlySet<string> = new Set<string>([
|
|
90
|
-
...Object.values(ControlLoopEvents),
|
|
91
|
-
...Object.values(OrparEvents),
|
|
92
|
-
// MCP response events
|
|
93
|
-
McpEvents.TOOL_RESULT,
|
|
94
|
-
McpEvents.TOOL_ERROR,
|
|
95
|
-
McpEvents.TOOL_REGISTERED,
|
|
96
|
-
McpEvents.TOOL_UNREGISTERED,
|
|
97
|
-
McpEvents.MXF_TOOL_LIST_RESULT,
|
|
98
|
-
McpEvents.MXF_TOOL_LIST_ERROR,
|
|
99
|
-
McpEvents.RESOURCE_RESULT,
|
|
100
|
-
McpEvents.RESOURCE_ERROR,
|
|
101
|
-
McpEvents.EXTERNAL_SERVER_REGISTERED,
|
|
102
|
-
McpEvents.EXTERNAL_SERVER_UNREGISTERED,
|
|
103
|
-
McpEvents.EXTERNAL_SERVER_REGISTRATION_FAILED,
|
|
104
|
-
McpEvents.CHANNEL_SERVER_REGISTERED,
|
|
105
|
-
McpEvents.CHANNEL_SERVER_UNREGISTERED,
|
|
106
|
-
McpEvents.CHANNEL_SERVER_REGISTRATION_FAILED,
|
|
107
|
-
// Task lifecycle events
|
|
108
|
-
TaskEvents.CREATED,
|
|
109
|
-
TaskEvents.ASSIGNED,
|
|
110
|
-
TaskEvents.STARTED,
|
|
111
|
-
TaskEvents.PROGRESS_UPDATED,
|
|
112
|
-
TaskEvents.COMPLETED,
|
|
113
|
-
TaskEvents.FAILED,
|
|
114
|
-
TaskEvents.ERROR,
|
|
115
|
-
TaskEvents.CANCELLED,
|
|
116
|
-
]);
|
|
117
|
-
|
|
118
|
-
private ioInstance: SocketIOServer | null = null;
|
|
119
|
-
|
|
120
60
|
/**
|
|
121
61
|
* Create a new ServerEventBus
|
|
122
62
|
* @param eventSubject Subject to use for events
|
|
@@ -126,85 +66,26 @@ export class ServerEventBus extends BaseEventBusImplementation implements IServe
|
|
|
126
66
|
}
|
|
127
67
|
|
|
128
68
|
/**
|
|
129
|
-
* Set the Socket.IO server instance
|
|
130
|
-
* @param io Socket.IO server instance
|
|
131
|
-
* @returns this (for chaining)
|
|
132
|
-
*/
|
|
133
|
-
public setSocketServer(io: SocketIOServer): this {
|
|
134
|
-
try {
|
|
135
|
-
validator.assertIsObject(io);
|
|
136
|
-
validator.assertHasFunction(io, 'emit');
|
|
137
|
-
validator.assertHasFunction(io, 'to');
|
|
138
|
-
|
|
139
|
-
this.ioInstance = io;
|
|
140
|
-
|
|
141
|
-
} catch (error) {
|
|
142
|
-
logger.error('[ServerEventBus] Error setting Socket.IO server:', error instanceof Error ? error.message : String(error));
|
|
143
|
-
throw new Error(`Error setting Socket.IO server: ${error instanceof Error ? error.message : 'Invalid server instance'}`);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return this;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Clear the Socket.IO server instance
|
|
151
|
-
* @returns this (for chaining)
|
|
152
|
-
*/
|
|
153
|
-
public clearSocketServer(): this {
|
|
154
|
-
this.ioInstance = null;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return this;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Forward an emitted event to the Socket.IO server.
|
|
162
|
-
*
|
|
163
69
|
* Called by BaseEventBusImplementation.emit() after validation and local
|
|
164
|
-
* delivery.
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* so a broadcast event would be seen twice (once from the Subject push, once
|
|
171
|
-
* from the socket re-injection).
|
|
70
|
+
* delivery. The server bus has no transport: EventBus events often contain
|
|
71
|
+
* private memory, prompts, tool results, or channel data, and a partial
|
|
72
|
+
* denylist would turn every newly added event into an unauthenticated
|
|
73
|
+
* global broadcast. Reviewed routing belongs to eventForwardingHandlers,
|
|
74
|
+
* which selects an authenticated agent or Socket.IO room explicitly, so
|
|
75
|
+
* this bus holds no Socket.IO server reference at all.
|
|
172
76
|
*/
|
|
173
77
|
protected override forwardToTransport<K extends AnyEventName>(event: K, payload: PayloadOf<K>): void {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const eventName = String(event);
|
|
179
|
-
if (isReservedEvent(eventName) || ServerEventBus.AGENT_SPECIFIC_EVENTS.has(eventName)) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
this.ioInstance.emit(eventName, payload);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Drop the Socket.IO server reference so no further events are broadcast.
|
|
188
|
-
*
|
|
189
|
-
* The bus attaches no listeners to the Socket.IO server — it only calls
|
|
190
|
-
* io.emit() — so there is nothing else to detach here.
|
|
191
|
-
*
|
|
192
|
-
* @returns this (for chaining)
|
|
193
|
-
*/
|
|
194
|
-
public removeAllSocketListeners(): this {
|
|
195
|
-
this.ioInstance = null;
|
|
196
|
-
|
|
197
|
-
return this;
|
|
78
|
+
void event;
|
|
79
|
+
void payload;
|
|
198
80
|
}
|
|
199
81
|
|
|
200
82
|
/**
|
|
201
|
-
* Dispose every subscription
|
|
83
|
+
* Dispose every subscription.
|
|
202
84
|
*
|
|
203
85
|
* @returns this (for chaining)
|
|
204
86
|
*/
|
|
205
87
|
public cleanup(): this {
|
|
206
88
|
this.removeAllListeners();
|
|
207
|
-
this.removeAllSocketListeners();
|
|
208
89
|
|
|
209
90
|
return this;
|
|
210
91
|
}
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
*/
|
|
24
24
|
export const ControlLoopEvents = {
|
|
25
25
|
INITIALIZE: 'controlLoop:initialize', // Request to initialize a control loop
|
|
26
|
+
START_REQUEST: 'controlLoop:start:request', // Request to start a control loop
|
|
27
|
+
STOP_REQUEST: 'controlLoop:stop:request', // Request to stop a control loop
|
|
28
|
+
OBSERVATION_SUBMIT: 'controlLoop:observation:submit', // Submit an observation
|
|
29
|
+
EXECUTION_REQUEST: 'controlLoop:execution:request', // Request action execution
|
|
30
|
+
PLAN_SUBMIT: 'controlLoop:plan:submit', // Submit an agent-generated plan
|
|
31
|
+
REFLECTION_SUBMIT: 'controlLoop:reflection:submit', // Submit an agent reflection
|
|
26
32
|
INITIALIZED: 'controlLoop:initialized', // Control loop has been initialized
|
|
27
33
|
STARTED: 'controlLoop:started', // Control loop has been started
|
|
28
34
|
OBSERVATION: 'controlLoop:observation', // Observation submitted to control loop
|
|
@@ -45,6 +51,12 @@ export const ControlLoopEvents = {
|
|
|
45
51
|
*/
|
|
46
52
|
export interface ControlLoopPayloads {
|
|
47
53
|
'controlLoop:initialize': { loopId: string, timestamp: number };
|
|
54
|
+
'controlLoop:start:request': { loopId: string, timestamp: number };
|
|
55
|
+
'controlLoop:stop:request': { loopId: string, timestamp: number, reason?: string };
|
|
56
|
+
'controlLoop:observation:submit': { loopId: string, timestamp: number, observation: unknown };
|
|
57
|
+
'controlLoop:execution:request': { loopId: string, timestamp: number, action: unknown };
|
|
58
|
+
'controlLoop:plan:submit': { loopId: string, timestamp: number, plan: unknown };
|
|
59
|
+
'controlLoop:reflection:submit': { loopId: string, timestamp: number, reflection: unknown };
|
|
48
60
|
'controlLoop:initialized': { loopId: string, timestamp: number };
|
|
49
61
|
'controlLoop:started': { loopId: string, timestamp: number };
|
|
50
62
|
'controlLoop:observation': { loopId: string, timestamp: number, observation: any };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024 Brad Anderson
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
* @author Brad Anderson <BradA1878@pm.me>
|
|
17
|
+
* @repository https://github.com/BradA1878/model-exchange-framework
|
|
18
|
+
* @documentation https://mxf-dev.github.io/mxf/
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { BaseEventPayload } from '../../schemas/EventPayloadSchema.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* SDK connection lifecycle events.
|
|
25
|
+
*
|
|
26
|
+
* These describe the SDK's own user connection, not an agent. They are
|
|
27
|
+
* delivered to local subscribers only (EventBus.client.emitLocal) and never
|
|
28
|
+
* sent over the socket.
|
|
29
|
+
*/
|
|
30
|
+
export const SdkEvents = {
|
|
31
|
+
/**
|
|
32
|
+
* The socket manager re-established the user connection and the server
|
|
33
|
+
* re-authenticated it, without a connect() call waiting on the result.
|
|
34
|
+
* Anything the server forgot while the connection was down — registered
|
|
35
|
+
* channel MCP server processes, for example — may need to be set up again.
|
|
36
|
+
*/
|
|
37
|
+
RECONNECTED: 'sdk:reconnected',
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Data carried by SdkEvents.RECONNECTED.
|
|
42
|
+
*/
|
|
43
|
+
export interface SdkReconnectedEventData {
|
|
44
|
+
/** Server-confirmed user id of the re-authenticated connection. */
|
|
45
|
+
userId: string;
|
|
46
|
+
/**
|
|
47
|
+
* Transport reconnect attempts reported by the socket manager, or null
|
|
48
|
+
* when the manager did not report one before authentication succeeded.
|
|
49
|
+
*/
|
|
50
|
+
attempt: number | null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* SDK event payload types
|
|
55
|
+
*/
|
|
56
|
+
export interface SdkPayloads {
|
|
57
|
+
'sdk:reconnected': BaseEventPayload<SdkReconnectedEventData>;
|
|
58
|
+
}
|
|
@@ -98,7 +98,7 @@ export type TaskProgressEvent = TaskEventPayload & {
|
|
|
98
98
|
export type TaskCompletedEvent = TaskEventPayload & {
|
|
99
99
|
data: {
|
|
100
100
|
task: ChannelTask;
|
|
101
|
-
result:
|
|
101
|
+
result: unknown;
|
|
102
102
|
duration: number; // in minutes
|
|
103
103
|
};
|
|
104
104
|
};
|
|
@@ -172,7 +172,7 @@ export interface TaskPayloads {
|
|
|
172
172
|
'task:fail_request': TaskEventPayload & { data: { task: ChannelTask; error: string } };
|
|
173
173
|
'task:cancel_request': TaskEventPayload & { data: { task: ChannelTask; reason?: string } };
|
|
174
174
|
'task:assign_request': TaskEventPayload & { data: { task: ChannelTask; agentId: AgentId } };
|
|
175
|
-
'task:update_request': TaskEventPayload
|
|
175
|
+
'task:update_request': TaskEventPayload;
|
|
176
176
|
'task:workload_analyze_request': TaskEventPayload & { data: { channelId: ChannelId } };
|
|
177
177
|
|
|
178
178
|
// Core task lifecycle events
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,21 @@ export type { EventName } from './events/EventNames.js';
|
|
|
9
9
|
export { EventBus } from './events/EventBus.js';
|
|
10
10
|
export { Logger } from './utils/Logger.js';
|
|
11
11
|
export { ConfigManager } from './config/ConfigManager.js';
|
|
12
|
+
export {
|
|
13
|
+
CORE_MXF_TOOLS,
|
|
14
|
+
isCoreToolName,
|
|
15
|
+
} from './constants/CoreTools.js';
|
|
16
|
+
export type { CoreMxfTool } from './constants/CoreTools.js';
|
|
17
|
+
export {
|
|
18
|
+
MemoryPersistenceLevel,
|
|
19
|
+
MemoryScope,
|
|
20
|
+
} from './types/MemoryTypes.js';
|
|
21
|
+
export type {
|
|
22
|
+
IAgentMemory,
|
|
23
|
+
IChannelMemory,
|
|
24
|
+
IRelationshipMemory,
|
|
25
|
+
MemoryData,
|
|
26
|
+
} from './types/MemoryTypes.js';
|
|
12
27
|
export {
|
|
13
28
|
DEFAULT_SERVER_CONFIG,
|
|
14
29
|
getServerConfig,
|
|
@@ -104,6 +104,11 @@ export interface AgentConfig {
|
|
|
104
104
|
providerOptions?: Record<string, any>;
|
|
105
105
|
|
|
106
106
|
// Tool access control
|
|
107
|
+
/**
|
|
108
|
+
* Requested subset of the authenticated channel key's tool grant.
|
|
109
|
+
* `undefined` selects MXF's curated core-tool set; `[]` denies every tool.
|
|
110
|
+
* A client request can narrow its credential grant but cannot expand it.
|
|
111
|
+
*/
|
|
107
112
|
allowedTools?: string[];
|
|
108
113
|
circuitBreakerExemptTools?: string[]; // Tools exempt from circuit breaker detection (for game tools, etc.)
|
|
109
114
|
|
|
@@ -26,8 +26,8 @@ export interface ChannelMcpServerConfig {
|
|
|
26
26
|
name: string;
|
|
27
27
|
command?: string;
|
|
28
28
|
args?: string[];
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/** Caller-supplied runtime registration currently supports stdio only. */
|
|
30
|
+
transport?: 'stdio';
|
|
31
31
|
autoStart?: boolean;
|
|
32
32
|
environmentVariables?: Record<string, string>;
|
|
33
33
|
restartOnCrash?: boolean;
|
|
@@ -41,6 +41,11 @@ export type MessageType =
|
|
|
41
41
|
| 'agent-message-received' // Message received from another agent
|
|
42
42
|
| 'tool-result' // Result from tool execution
|
|
43
43
|
| 'system-notice' // System intervention or notice
|
|
44
|
+
| 'system-event' // Framework event injected into conversation context
|
|
45
|
+
| 'systemllm-coordination' // Ephemeral SystemLLM coordination context
|
|
46
|
+
| 'channel-message-immediate' // Channel notification awaiting agent review
|
|
47
|
+
| 'error_feedback' // Validation or execution feedback
|
|
48
|
+
| 'error_correction_trigger' // Prompt to correct an earlier invalid action
|
|
44
49
|
| 'action-history' // Historical action summary
|
|
45
50
|
| 'llm-response'; // Direct LLM response
|
|
46
51
|
|
|
@@ -13,9 +13,38 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { Observable } from 'rxjs';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
IAgentMemory,
|
|
18
|
+
IChannelMemory,
|
|
19
|
+
IRelationshipMemory,
|
|
20
|
+
MemoryScope
|
|
21
|
+
} from '../types/MemoryTypes.js';
|
|
17
22
|
import { MemoryUtilitySubdocument } from '../types/MemoryUtilityTypes.js';
|
|
18
23
|
|
|
24
|
+
/**
|
|
25
|
+
* A mutation against one reserved field in a channel-memory document.
|
|
26
|
+
*
|
|
27
|
+
* Append mutations are deliberately expressed as database operations instead of
|
|
28
|
+
* read/modify/write replacements. That lets the persistence adapter retain every
|
|
29
|
+
* concurrently submitted batch with one atomic document update.
|
|
30
|
+
*/
|
|
31
|
+
export type ChannelMemoryAtomicMutation =
|
|
32
|
+
| { kind: 'append_messages'; messages: unknown[] }
|
|
33
|
+
| { kind: 'replace_context'; context: unknown; expectedUpdatedAt?: number }
|
|
34
|
+
| { kind: 'append_context_history'; entries: unknown[]; retainLast: number }
|
|
35
|
+
| { kind: 'delete_messages' }
|
|
36
|
+
| { kind: 'delete_context' }
|
|
37
|
+
| { kind: 'delete_context_history' };
|
|
38
|
+
|
|
39
|
+
export interface ChannelMemoryAtomicMutationResult {
|
|
40
|
+
/** Whether the targeted channel/key existed for this operation. */
|
|
41
|
+
found: boolean;
|
|
42
|
+
/** The authoritative document after the mutation, or null for a missing delete target. */
|
|
43
|
+
memory: IChannelMemory | null;
|
|
44
|
+
/** The authoritative value of the reserved field after the mutation. */
|
|
45
|
+
value: unknown;
|
|
46
|
+
}
|
|
47
|
+
|
|
19
48
|
export interface IMemoryPersistence {
|
|
20
49
|
/** Load an agent's memory document. */
|
|
21
50
|
getAgentMemory(agentId: string): Observable<IAgentMemory>;
|
|
@@ -26,6 +55,31 @@ export interface IMemoryPersistence {
|
|
|
26
55
|
/** Persist a channel's memory document. */
|
|
27
56
|
saveChannelMemory(memory: IChannelMemory): Observable<IChannelMemory>;
|
|
28
57
|
|
|
58
|
+
/** Load a channel's memory document. */
|
|
59
|
+
getChannelMemory(channelId: string): Observable<IChannelMemory>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Atomically mutate one reserved channel-memory field and return the
|
|
63
|
+
* authoritative post-update document/value.
|
|
64
|
+
*/
|
|
65
|
+
mutateChannelMemory(
|
|
66
|
+
channelId: string,
|
|
67
|
+
mutation: ChannelMemoryAtomicMutation
|
|
68
|
+
): Observable<ChannelMemoryAtomicMutationResult>;
|
|
69
|
+
|
|
70
|
+
/** Load relationship memory using its full tenant identity. */
|
|
71
|
+
getRelationshipMemory?(
|
|
72
|
+
agentId1: string,
|
|
73
|
+
agentId2: string,
|
|
74
|
+
channelId: string
|
|
75
|
+
): Observable<IRelationshipMemory>;
|
|
76
|
+
|
|
77
|
+
/** Persist relationship memory using its full tenant identity. */
|
|
78
|
+
saveRelationshipMemory?(memory: IRelationshipMemory): Observable<IRelationshipMemory>;
|
|
79
|
+
|
|
80
|
+
/** Delete one exact memory scope identity from persistent storage. */
|
|
81
|
+
deleteMemory?(scope: MemoryScope, id: string | string[]): Observable<boolean>;
|
|
82
|
+
|
|
29
83
|
/**
|
|
30
84
|
* Persist the MULS utility subdocument for a single memory.
|
|
31
85
|
*
|
|
@@ -73,9 +73,10 @@ export interface ISocketService {
|
|
|
73
73
|
/**
|
|
74
74
|
* Get the socket for an agent by its ID
|
|
75
75
|
* @param agentId Agent ID to find the socket for
|
|
76
|
-
* @
|
|
76
|
+
* @param channelId Authenticated channel the event is scoped to
|
|
77
|
+
* @returns The socket for the agent in that exact channel, or null if not found
|
|
77
78
|
*/
|
|
78
|
-
getSocketByAgentId(agentId: string): Socket | null;
|
|
79
|
+
getSocketByAgentId(agentId: string, channelId: string): Socket | null;
|
|
79
80
|
|
|
80
81
|
/**
|
|
81
82
|
* Get the Socket.IO server instance
|
|
@@ -35,7 +35,16 @@ export interface SimpleTaskRequest {
|
|
|
35
35
|
content: string;
|
|
36
36
|
title?: string; // Task title for display and context
|
|
37
37
|
description?: string; // Full task description (same as content, for compatibility)
|
|
38
|
-
|
|
38
|
+
/** Agent designated to report the task's terminal outcome; the server enforces it. */
|
|
39
|
+
completionAgentId?: string;
|
|
40
|
+
/** Every agent assigned to the task. */
|
|
41
|
+
assignedAgentIds?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Task metadata. Role flags (isCompletionAgent, multiAgentTask, agentRole)
|
|
44
|
+
* are present only on the late-assignment flows; the creator's own
|
|
45
|
+
* metadata is passed through on direct assignment.
|
|
46
|
+
*/
|
|
47
|
+
metadata?: Record<string, unknown>;
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
/**
|
|
@@ -51,3 +60,9 @@ export interface SimpleTaskResponse {
|
|
|
51
60
|
* Callback for handling task requests
|
|
52
61
|
*/
|
|
53
62
|
export type TaskRequestHandler = (task: SimpleTaskRequest) => Promise<SimpleTaskResponse>;
|
|
63
|
+
|
|
64
|
+
/** Terminal outcomes the server broadcasts for a task. */
|
|
65
|
+
export type TaskOutcome = 'completed' | 'failed' | 'cancelled';
|
|
66
|
+
|
|
67
|
+
/** Called once when the task this agent was assigned reaches a terminal outcome. */
|
|
68
|
+
export type TaskEndedHandler = (taskId: string, outcome: TaskOutcome) => void;
|
package/src/models/agent.ts
CHANGED
|
@@ -40,7 +40,6 @@ export interface IAgent extends Document {
|
|
|
40
40
|
keyId?: string; // API key used as lookup for this agent
|
|
41
41
|
role?: string; // Agent's role (e.g., "assistant", "specialist")
|
|
42
42
|
specialization?: string; // Agent's area of specialization
|
|
43
|
-
allowedTools?: string[]; // Tool access control - list of allowed MCP tools
|
|
44
43
|
|
|
45
44
|
// Agent context (read-only)
|
|
46
45
|
context?: {
|
|
@@ -123,11 +122,6 @@ const AgentSchema: Schema = new Schema(
|
|
|
123
122
|
specialization: {
|
|
124
123
|
type: String
|
|
125
124
|
},
|
|
126
|
-
allowedTools: {
|
|
127
|
-
type: [String],
|
|
128
|
-
required: false,
|
|
129
|
-
default: undefined // undefined = all tools allowed
|
|
130
|
-
},
|
|
131
125
|
|
|
132
126
|
// Agent context
|
|
133
127
|
context: {
|