@mxf-dev/core 2.0.4 → 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 +118 -5
- package/dist/protocols/mcp/services/ExternalMcpServerManager.d.ts.map +1 -1
- package/dist/protocols/mcp/services/ExternalMcpServerManager.js +499 -98
- 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 +656 -111
- 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
|
@@ -17,15 +17,8 @@
|
|
|
17
17
|
* @repository https://github.com/BradA1878/model-exchange-framework
|
|
18
18
|
* @documentation https://mxf-dev.github.io/mxf/
|
|
19
19
|
*/
|
|
20
|
-
import { Logger } from '../../../utils/Logger.js';
|
|
21
|
-
import { ValidationAnalyticsService } from '../../../services/ValidationAnalyticsService.js';
|
|
22
20
|
import { TaskEffectivenessService } from '../../../services/TaskEffectivenessService.js';
|
|
23
21
|
import { AgentPerformanceService } from '../../../services/AgentPerformanceService.js';
|
|
24
|
-
import { createStrictValidator } from '../../../utils/validation.js';
|
|
25
|
-
import { firstValueFrom } from 'rxjs';
|
|
26
|
-
const logger = new Logger('info', 'AnalyticsTools', 'server');
|
|
27
|
-
const validate = createStrictValidator('AnalyticsTools');
|
|
28
|
-
// Helper to create consistent tool results
|
|
29
22
|
function createToolResult(success, data) {
|
|
30
23
|
return {
|
|
31
24
|
content: {
|
|
@@ -34,682 +27,209 @@ function createToolResult(success, data) {
|
|
|
34
27
|
}
|
|
35
28
|
};
|
|
36
29
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
function requireTenantIdentity(context) {
|
|
31
|
+
if (!context.agentId?.trim() || !context.channelId?.trim() ||
|
|
32
|
+
context.agentId !== context.agentId.trim() ||
|
|
33
|
+
context.channelId !== context.channelId.trim()) {
|
|
34
|
+
throw new Error('Authenticated agent and channel context are required');
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
agentId: context.agentId,
|
|
38
|
+
channelId: context.channelId
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function rejectCallerSelectedTenant(input) {
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(input, 'agentId') ||
|
|
43
|
+
Object.prototype.hasOwnProperty.call(input, 'channelId')) {
|
|
44
|
+
throw new Error('Agent and channel identity are derived from authenticated tool context');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function requireObjectInput(input) {
|
|
48
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
49
|
+
throw new Error('Tool input must be an object');
|
|
50
|
+
}
|
|
51
|
+
return input;
|
|
52
|
+
}
|
|
53
|
+
function errorMessage(error) {
|
|
54
|
+
return error instanceof Error ? error.message : String(error);
|
|
55
|
+
}
|
|
56
|
+
function unavailableHandler(reason) {
|
|
57
|
+
return async () => createToolResult(false, { error: reason });
|
|
58
|
+
}
|
|
59
|
+
/** Read already-observed performance for the authenticated agent in its channel. */
|
|
40
60
|
export const analytics_agent_performance = {
|
|
41
61
|
name: 'analytics_agent_performance',
|
|
42
|
-
description: 'Get
|
|
62
|
+
description: 'Get tracked performance metrics for the authenticated agent in the current channel',
|
|
43
63
|
inputSchema: {
|
|
44
64
|
type: 'object',
|
|
45
65
|
properties: {
|
|
46
|
-
agentId: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Specific agent ID to analyze (optional - omit for all agents)'
|
|
49
|
-
},
|
|
50
|
-
timeRange: {
|
|
51
|
-
type: 'string',
|
|
52
|
-
enum: ['1h', '24h', '7d', '30d'],
|
|
53
|
-
description: 'Time range for metrics analysis',
|
|
54
|
-
default: '24h'
|
|
55
|
-
},
|
|
56
66
|
includeDetails: {
|
|
57
67
|
type: 'boolean',
|
|
58
|
-
description: 'Include
|
|
68
|
+
description: 'Include the complete tracked metric record',
|
|
59
69
|
default: false
|
|
60
70
|
}
|
|
61
71
|
},
|
|
62
72
|
additionalProperties: false
|
|
63
73
|
},
|
|
64
74
|
enabled: true,
|
|
65
|
-
handler: async (
|
|
66
|
-
const performanceService = AgentPerformanceService.getInstance();
|
|
75
|
+
handler: async (rawInput, context) => {
|
|
67
76
|
try {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return createToolResult(true, {
|
|
80
|
-
agentId: agentId || 'all',
|
|
81
|
-
timeRange,
|
|
82
|
-
metrics: performanceData,
|
|
83
|
-
summary: {
|
|
84
|
-
totalTasks: performanceData?.collaboration?.successfulCollaborations || 0,
|
|
85
|
-
averageResponseTime: performanceData?.orparTiming?.averageTotalCycleTime || 0,
|
|
86
|
-
successRate: performanceData?.collaboration?.collaborationSuccessRate || 0,
|
|
87
|
-
efficiency: performanceData?.benchmark?.relativePerformance?.efficiency || 0
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
logger.error('Error getting agent performance:', error);
|
|
93
|
-
return createToolResult(false, { error: `Failed to get agent performance: ${error.message}` });
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* 2. Get Channel Activity Analytics
|
|
99
|
-
*/
|
|
100
|
-
export const analytics_channel_activity = {
|
|
101
|
-
name: 'analytics_channel_activity',
|
|
102
|
-
description: 'Analyze channel activity patterns, message volume, and engagement metrics',
|
|
103
|
-
inputSchema: {
|
|
104
|
-
type: 'object',
|
|
105
|
-
properties: {
|
|
106
|
-
channelId: {
|
|
107
|
-
type: 'string',
|
|
108
|
-
description: 'Specific channel ID to analyze (optional - omit for all channels)'
|
|
109
|
-
},
|
|
110
|
-
timeRange: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
enum: ['1h', '24h', '7d', '30d'],
|
|
113
|
-
description: 'Time range for activity analysis',
|
|
114
|
-
default: '24h'
|
|
115
|
-
},
|
|
116
|
-
includePatterns: {
|
|
117
|
-
type: 'boolean',
|
|
118
|
-
description: 'Include activity pattern analysis',
|
|
119
|
-
default: true
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
additionalProperties: false
|
|
123
|
-
},
|
|
124
|
-
enabled: true,
|
|
125
|
-
handler: async ({ channelId, timeRange = '24h', includePatterns = true }, { agentId, channelId: contextChannelId }) => {
|
|
126
|
-
try {
|
|
127
|
-
// Mock implementation - replace with actual analytics service call
|
|
128
|
-
const activityData = {
|
|
129
|
-
totalMessages: 0,
|
|
130
|
-
activeAgents: 0,
|
|
131
|
-
averageResponseTime: 0,
|
|
132
|
-
peakActivity: null,
|
|
133
|
-
patterns: includePatterns ? {
|
|
134
|
-
mostActiveHours: [],
|
|
135
|
-
averageMessagesPerHour: 0,
|
|
136
|
-
responseTimeDistribution: {}
|
|
137
|
-
} : null
|
|
138
|
-
};
|
|
139
|
-
return createToolResult(true, {
|
|
140
|
-
channelId: channelId || 'all',
|
|
141
|
-
timeRange,
|
|
142
|
-
activity: activityData,
|
|
143
|
-
insights: [
|
|
144
|
-
'Channel activity analysis complete',
|
|
145
|
-
`Analyzed ${timeRange} of data`,
|
|
146
|
-
includePatterns ? 'Pattern analysis included' : 'Basic metrics only'
|
|
147
|
-
]
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
logger.error('Error getting channel activity:', error);
|
|
152
|
-
return createToolResult(false, { error: `Failed to get channel activity: ${error.message}` });
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* 3. Get System Health Metrics
|
|
158
|
-
*/
|
|
159
|
-
export const analytics_system_health = {
|
|
160
|
-
name: 'analytics_system_health',
|
|
161
|
-
description: 'Get comprehensive system health metrics including resource usage and service status',
|
|
162
|
-
inputSchema: {
|
|
163
|
-
type: 'object',
|
|
164
|
-
properties: {
|
|
165
|
-
includeServices: {
|
|
166
|
-
type: 'boolean',
|
|
167
|
-
description: 'Include individual service health checks',
|
|
168
|
-
default: true
|
|
169
|
-
},
|
|
170
|
-
includeResources: {
|
|
171
|
-
type: 'boolean',
|
|
172
|
-
description: 'Include resource usage metrics',
|
|
173
|
-
default: true
|
|
77
|
+
const input = requireObjectInput(rawInput);
|
|
78
|
+
rejectCallerSelectedTenant(input);
|
|
79
|
+
const { agentId, channelId } = requireTenantIdentity(context);
|
|
80
|
+
const metrics = AgentPerformanceService.getInstance()
|
|
81
|
+
.getTrackedPerformanceMetrics(agentId, channelId);
|
|
82
|
+
if (!metrics) {
|
|
83
|
+
return createToolResult(false, {
|
|
84
|
+
error: 'No tracked performance metrics exist for this agent in this channel'
|
|
85
|
+
});
|
|
174
86
|
}
|
|
175
|
-
},
|
|
176
|
-
additionalProperties: false
|
|
177
|
-
},
|
|
178
|
-
enabled: true,
|
|
179
|
-
handler: async ({ includeServices = true, includeResources = true }, { agentId, channelId }) => {
|
|
180
|
-
try {
|
|
181
|
-
// Get basic system metrics
|
|
182
|
-
const systemHealth = {
|
|
183
|
-
status: 'healthy',
|
|
184
|
-
uptime: Math.floor(process.uptime()),
|
|
185
|
-
timestamp: new Date().toISOString(),
|
|
186
|
-
memory: includeResources ? {
|
|
187
|
-
used: process.memoryUsage().heapUsed,
|
|
188
|
-
total: process.memoryUsage().heapTotal,
|
|
189
|
-
external: process.memoryUsage().external
|
|
190
|
-
} : null,
|
|
191
|
-
services: includeServices ? {
|
|
192
|
-
database: 'connected',
|
|
193
|
-
eventBus: 'active',
|
|
194
|
-
socketService: 'running',
|
|
195
|
-
mcpService: 'active'
|
|
196
|
-
} : null
|
|
197
|
-
};
|
|
198
87
|
return createToolResult(true, {
|
|
199
|
-
|
|
88
|
+
agentId,
|
|
89
|
+
channelId,
|
|
90
|
+
metrics: input.includeDetails === true ? metrics : undefined,
|
|
200
91
|
summary: {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Math.round((systemHealth.memory.used / systemHealth.memory.total) * 100) : 'N/A'
|
|
92
|
+
totalTasks: metrics.collaboration.successfulCollaborations,
|
|
93
|
+
averageResponseTime: metrics.orparTiming.averageTotalCycleTime,
|
|
94
|
+
successRate: metrics.collaboration.collaborationSuccessRate,
|
|
95
|
+
efficiency: metrics.benchmark.relativePerformance.efficiency
|
|
206
96
|
}
|
|
207
97
|
});
|
|
208
98
|
}
|
|
209
99
|
catch (error) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* 4. Generate Analytics Report
|
|
217
|
-
*/
|
|
218
|
-
export const analytics_generate_report = {
|
|
219
|
-
name: 'analytics_generate_report',
|
|
220
|
-
description: 'Generate comprehensive analytics reports with customizable parameters',
|
|
221
|
-
inputSchema: {
|
|
222
|
-
type: 'object',
|
|
223
|
-
properties: {
|
|
224
|
-
reportType: {
|
|
225
|
-
type: 'string',
|
|
226
|
-
enum: ['performance', 'activity', 'system', 'comprehensive'],
|
|
227
|
-
description: 'Type of report to generate'
|
|
228
|
-
},
|
|
229
|
-
timeRange: {
|
|
230
|
-
type: 'string',
|
|
231
|
-
enum: ['24h', '7d', '30d', '90d'],
|
|
232
|
-
description: 'Time range for report data',
|
|
233
|
-
default: '7d'
|
|
234
|
-
},
|
|
235
|
-
format: {
|
|
236
|
-
type: 'string',
|
|
237
|
-
enum: ['json', 'summary', 'detailed'],
|
|
238
|
-
description: 'Report output format',
|
|
239
|
-
default: 'summary'
|
|
240
|
-
},
|
|
241
|
-
includeCharts: {
|
|
242
|
-
type: 'boolean',
|
|
243
|
-
description: 'Include chart data for visualizations',
|
|
244
|
-
default: false
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
required: ['reportType'],
|
|
248
|
-
additionalProperties: false
|
|
249
|
-
},
|
|
250
|
-
enabled: true,
|
|
251
|
-
handler: async ({ reportType, timeRange = '7d', format = 'summary', includeCharts = false }, { agentId, channelId }) => {
|
|
252
|
-
try {
|
|
253
|
-
// Generate report based on type
|
|
254
|
-
const report = {
|
|
255
|
-
id: `report_${Date.now()}`,
|
|
256
|
-
type: reportType,
|
|
257
|
-
timeRange,
|
|
258
|
-
format,
|
|
259
|
-
generatedAt: new Date().toISOString(),
|
|
260
|
-
data: {
|
|
261
|
-
summary: `${reportType} report for ${timeRange}`,
|
|
262
|
-
metrics: {},
|
|
263
|
-
insights: [],
|
|
264
|
-
recommendations: []
|
|
265
|
-
},
|
|
266
|
-
charts: includeCharts ? {
|
|
267
|
-
available: true,
|
|
268
|
-
types: ['line', 'bar', 'pie']
|
|
269
|
-
} : null
|
|
270
|
-
};
|
|
271
|
-
return createToolResult(true, {
|
|
272
|
-
report,
|
|
273
|
-
downloadUrl: null, // Could implement file generation
|
|
274
|
-
sharing: {
|
|
275
|
-
reportId: report.id,
|
|
276
|
-
expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString()
|
|
277
|
-
}
|
|
100
|
+
return createToolResult(false, {
|
|
101
|
+
error: `Failed to get agent performance: ${errorMessage(error)}`
|
|
278
102
|
});
|
|
279
103
|
}
|
|
280
|
-
catch (error) {
|
|
281
|
-
logger.error('Error generating report:', error);
|
|
282
|
-
return createToolResult(false, { error: `Failed to generate report: ${error.message}` });
|
|
283
|
-
}
|
|
284
104
|
}
|
|
285
105
|
};
|
|
286
|
-
/**
|
|
287
|
-
* 5. Get Task Completion Analytics
|
|
288
|
-
*/
|
|
106
|
+
/** Read task-effectiveness analytics for the authenticated agent and channel. */
|
|
289
107
|
export const analytics_task_completion = {
|
|
290
108
|
name: 'analytics_task_completion',
|
|
291
|
-
description: 'Analyze task completion
|
|
109
|
+
description: 'Analyze task completion for the authenticated agent in the current channel',
|
|
292
110
|
inputSchema: {
|
|
293
111
|
type: 'object',
|
|
294
112
|
properties: {
|
|
295
113
|
timeRange: {
|
|
296
114
|
type: 'string',
|
|
297
115
|
enum: ['24h', '7d', '30d'],
|
|
298
|
-
description: 'Time range for task analysis',
|
|
299
116
|
default: '7d'
|
|
300
117
|
},
|
|
301
118
|
includeBreakdown: {
|
|
302
119
|
type: 'boolean',
|
|
303
|
-
description: 'Include detailed breakdown by priority, type, etc.',
|
|
304
120
|
default: true
|
|
305
|
-
},
|
|
306
|
-
agentId: {
|
|
307
|
-
type: 'string',
|
|
308
|
-
description: 'Filter by specific agent (optional)'
|
|
309
|
-
},
|
|
310
|
-
channelId: {
|
|
311
|
-
type: 'string',
|
|
312
|
-
description: 'Filter by specific channel (optional)'
|
|
313
121
|
}
|
|
314
122
|
},
|
|
315
123
|
additionalProperties: false
|
|
316
124
|
},
|
|
317
125
|
enabled: true,
|
|
318
|
-
handler: async (
|
|
319
|
-
const effectivenessService = TaskEffectivenessService.getInstance();
|
|
126
|
+
handler: async (rawInput, context) => {
|
|
320
127
|
try {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const
|
|
128
|
+
const input = requireObjectInput(rawInput);
|
|
129
|
+
rejectCallerSelectedTenant(input);
|
|
130
|
+
const { agentId, channelId } = requireTenantIdentity(context);
|
|
131
|
+
const timeRange = input.timeRange === '24h' || input.timeRange === '30d'
|
|
132
|
+
? input.timeRange
|
|
133
|
+
: '7d';
|
|
134
|
+
const timeRangeMs = timeRange === '24h'
|
|
135
|
+
? 24 * 60 * 60 * 1000
|
|
136
|
+
: timeRange === '7d'
|
|
137
|
+
? 7 * 24 * 60 * 60 * 1000
|
|
138
|
+
: 30 * 24 * 60 * 60 * 1000;
|
|
139
|
+
const endTime = Date.now();
|
|
140
|
+
const analytics = await TaskEffectivenessService.getInstance().getAnalytics(endTime - timeRangeMs, endTime, agentId, channelId);
|
|
141
|
+
const taskTypeStats = Object.values(analytics.byTaskType);
|
|
142
|
+
const totalTasks = taskTypeStats.reduce((sum, stats) => sum + stats.count, 0);
|
|
143
|
+
const completedTasks = Object.values(analytics.byChannel)
|
|
144
|
+
.reduce((sum, stats) => sum + stats.completedTasks, 0);
|
|
145
|
+
const averageCompletionTime = totalTasks === 0
|
|
146
|
+
? 0
|
|
147
|
+
: taskTypeStats.reduce((sum, stats) => sum + (stats.avgCompletionTime * stats.count), 0) / totalTasks;
|
|
328
148
|
return createToolResult(true, {
|
|
329
149
|
timeRange,
|
|
330
|
-
|
|
150
|
+
tenant: { agentId, channelId },
|
|
331
151
|
metrics: {
|
|
332
|
-
totalTasks
|
|
333
|
-
completedTasks
|
|
334
|
-
failedTasks:
|
|
335
|
-
averageCompletionTime
|
|
336
|
-
completionRate:
|
|
152
|
+
totalTasks,
|
|
153
|
+
completedTasks,
|
|
154
|
+
failedTasks: totalTasks - completedTasks,
|
|
155
|
+
averageCompletionTime,
|
|
156
|
+
completionRate: totalTasks === 0 ? 0 : completedTasks / totalTasks
|
|
157
|
+
},
|
|
158
|
+
breakdown: input.includeBreakdown === false ? undefined : {
|
|
159
|
+
byTaskType: analytics.byTaskType,
|
|
160
|
+
byChannel: analytics.byChannel
|
|
337
161
|
},
|
|
338
|
-
|
|
339
|
-
byTaskType: taskAnalytics.byTaskType,
|
|
340
|
-
byChannel: taskAnalytics.byChannel,
|
|
341
|
-
byAgent: {} // Not available in current analytics
|
|
342
|
-
} : null,
|
|
343
|
-
trends: taskAnalytics.trends || []
|
|
162
|
+
trends: analytics.trends
|
|
344
163
|
});
|
|
345
164
|
}
|
|
346
165
|
catch (error) {
|
|
347
|
-
|
|
348
|
-
|
|
166
|
+
return createToolResult(false, {
|
|
167
|
+
error: `Failed to get task analytics: ${errorMessage(error)}`
|
|
168
|
+
});
|
|
349
169
|
}
|
|
350
170
|
}
|
|
351
171
|
};
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
172
|
+
const unavailableInputSchema = {
|
|
173
|
+
type: 'object',
|
|
174
|
+
properties: {},
|
|
175
|
+
additionalProperties: false
|
|
176
|
+
};
|
|
177
|
+
export const analytics_channel_activity = {
|
|
178
|
+
name: 'analytics_channel_activity',
|
|
179
|
+
description: 'Unavailable until channel activity analytics has an authoritative tenant-scoped data source',
|
|
180
|
+
inputSchema: unavailableInputSchema,
|
|
181
|
+
enabled: false,
|
|
182
|
+
handler: unavailableHandler('Channel activity analytics is not implemented')
|
|
183
|
+
};
|
|
184
|
+
export const analytics_system_health = {
|
|
185
|
+
name: 'analytics_system_health',
|
|
186
|
+
description: 'Server-global health is not available to agent MCP callers',
|
|
187
|
+
inputSchema: unavailableInputSchema,
|
|
188
|
+
enabled: false,
|
|
189
|
+
handler: unavailableHandler('Server-global health is restricted to administrative surfaces')
|
|
190
|
+
};
|
|
191
|
+
export const analytics_generate_report = {
|
|
192
|
+
name: 'analytics_generate_report',
|
|
193
|
+
description: 'Unavailable until report generation has an authoritative tenant-scoped implementation',
|
|
194
|
+
inputSchema: unavailableInputSchema,
|
|
195
|
+
enabled: false,
|
|
196
|
+
handler: unavailableHandler('Analytics report generation is not implemented')
|
|
197
|
+
};
|
|
355
198
|
export const analytics_validation_metrics = {
|
|
356
199
|
name: 'analytics_validation_metrics',
|
|
357
|
-
description: '
|
|
358
|
-
inputSchema:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
timeRange: {
|
|
362
|
-
type: 'string',
|
|
363
|
-
enum: ['1h', '24h', '7d', '30d'],
|
|
364
|
-
description: 'Time range for validation metrics',
|
|
365
|
-
default: '24h'
|
|
366
|
-
},
|
|
367
|
-
includeDetails: {
|
|
368
|
-
type: 'boolean',
|
|
369
|
-
description: 'Include detailed error patterns and corrections',
|
|
370
|
-
default: true
|
|
371
|
-
}
|
|
372
|
-
},
|
|
373
|
-
additionalProperties: false
|
|
374
|
-
},
|
|
375
|
-
enabled: true,
|
|
376
|
-
handler: async ({ timeRange = '24h', includeDetails = true }, { agentId, channelId }) => {
|
|
377
|
-
const validationAnalytics = ValidationAnalyticsService.getInstance();
|
|
378
|
-
try {
|
|
379
|
-
// Get validation metrics from service
|
|
380
|
-
const timeRangeEnum = timeRange === '1h' ? 'hour' :
|
|
381
|
-
timeRange === '24h' ? 'day' :
|
|
382
|
-
timeRange === '7d' ? 'week' : 'month';
|
|
383
|
-
const validationMetrics = await validationAnalytics.aggregateValidationMetrics(timeRangeEnum) || {};
|
|
384
|
-
return createToolResult(true, {
|
|
385
|
-
timeRange,
|
|
386
|
-
metrics: {
|
|
387
|
-
totalValidations: validationMetrics.totalValidations || 0,
|
|
388
|
-
successfulValidations: validationMetrics.successfulValidations || 0,
|
|
389
|
-
errorsPrevented: validationMetrics.errorsPrevented || 0,
|
|
390
|
-
averageValidationTime: validationMetrics.averageValidationTime || 0,
|
|
391
|
-
successRate: validationMetrics.successRate || 0
|
|
392
|
-
},
|
|
393
|
-
autoCorrection: {
|
|
394
|
-
totalCorrections: validationMetrics.autoCorrections || 0,
|
|
395
|
-
correctionSuccessRate: validationMetrics.correctionSuccessRate || 0,
|
|
396
|
-
commonCorrections: validationMetrics.commonCorrections || []
|
|
397
|
-
},
|
|
398
|
-
details: includeDetails ? {
|
|
399
|
-
errorPatterns: validationMetrics.errorPatterns || [],
|
|
400
|
-
performanceOptimizations: validationMetrics.optimizations || [],
|
|
401
|
-
predictiveAccuracy: validationMetrics.predictiveAccuracy || 0
|
|
402
|
-
} : null
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
catch (error) {
|
|
406
|
-
logger.error('Error getting validation analytics:', error);
|
|
407
|
-
return createToolResult(false, { error: `Failed to get validation metrics: ${error.message}` });
|
|
408
|
-
}
|
|
409
|
-
}
|
|
200
|
+
description: 'Server-global validation analytics is not available to agent MCP callers',
|
|
201
|
+
inputSchema: unavailableInputSchema,
|
|
202
|
+
enabled: false,
|
|
203
|
+
handler: unavailableHandler('Server-global validation analytics is restricted to administrative surfaces')
|
|
410
204
|
};
|
|
411
|
-
/**
|
|
412
|
-
* 7. Get MCP Tool Usage Analytics
|
|
413
|
-
*/
|
|
414
205
|
export const analytics_tool_usage = {
|
|
415
206
|
name: 'analytics_tool_usage',
|
|
416
|
-
description: '
|
|
417
|
-
inputSchema:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
timeRange: {
|
|
421
|
-
type: 'string',
|
|
422
|
-
enum: ['24h', '7d', '30d'],
|
|
423
|
-
description: 'Time range for tool usage analysis',
|
|
424
|
-
default: '7d'
|
|
425
|
-
},
|
|
426
|
-
category: {
|
|
427
|
-
type: 'string',
|
|
428
|
-
description: 'Filter by tool category (optional)'
|
|
429
|
-
},
|
|
430
|
-
sortBy: {
|
|
431
|
-
type: 'string',
|
|
432
|
-
enum: ['usage', 'success_rate', 'performance', 'errors'],
|
|
433
|
-
description: 'Sort tools by metric',
|
|
434
|
-
default: 'usage'
|
|
435
|
-
},
|
|
436
|
-
limit: {
|
|
437
|
-
type: 'number',
|
|
438
|
-
description: 'Limit number of tools in results',
|
|
439
|
-
default: 20,
|
|
440
|
-
minimum: 1,
|
|
441
|
-
maximum: 100
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
additionalProperties: false
|
|
445
|
-
},
|
|
446
|
-
enabled: true,
|
|
447
|
-
handler: async ({ timeRange = '7d', category, sortBy = 'usage', limit = 20 }, { agentId, channelId }) => {
|
|
448
|
-
try {
|
|
449
|
-
// Mock tool usage data - replace with actual analytics
|
|
450
|
-
const toolUsage = {
|
|
451
|
-
totalExecutions: 0,
|
|
452
|
-
uniqueTools: 0,
|
|
453
|
-
averageExecutionTime: 0,
|
|
454
|
-
topTools: [],
|
|
455
|
-
categories: {},
|
|
456
|
-
trends: []
|
|
457
|
-
};
|
|
458
|
-
return createToolResult(true, {
|
|
459
|
-
timeRange,
|
|
460
|
-
filters: { category, sortBy, limit },
|
|
461
|
-
usage: toolUsage,
|
|
462
|
-
insights: [
|
|
463
|
-
`Analyzed ${toolUsage.uniqueTools} unique tools`,
|
|
464
|
-
`Total executions: ${toolUsage.totalExecutions}`,
|
|
465
|
-
`Average execution time: ${toolUsage.averageExecutionTime}ms`
|
|
466
|
-
]
|
|
467
|
-
});
|
|
468
|
-
}
|
|
469
|
-
catch (error) {
|
|
470
|
-
logger.error('Error getting tool usage analytics:', error);
|
|
471
|
-
return createToolResult(false, { error: `Failed to get tool usage analytics: ${error.message}` });
|
|
472
|
-
}
|
|
473
|
-
}
|
|
207
|
+
description: 'Unavailable until tool usage analytics has an authoritative tenant-scoped data source',
|
|
208
|
+
inputSchema: unavailableInputSchema,
|
|
209
|
+
enabled: false,
|
|
210
|
+
handler: unavailableHandler('Tool usage analytics is not implemented')
|
|
474
211
|
};
|
|
475
|
-
/**
|
|
476
|
-
* 8. Compare Performance Metrics
|
|
477
|
-
*/
|
|
478
212
|
export const analytics_compare_performance = {
|
|
479
213
|
name: 'analytics_compare_performance',
|
|
480
|
-
description: '
|
|
481
|
-
inputSchema:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
comparisonType: {
|
|
485
|
-
type: 'string',
|
|
486
|
-
enum: ['time_periods', 'agents', 'channels'],
|
|
487
|
-
description: 'Type of comparison to perform'
|
|
488
|
-
},
|
|
489
|
-
baseline: {
|
|
490
|
-
type: 'object',
|
|
491
|
-
description: 'Baseline parameters for comparison',
|
|
492
|
-
properties: {
|
|
493
|
-
timeRange: { type: 'string' },
|
|
494
|
-
agentId: { type: 'string' },
|
|
495
|
-
channelId: { type: 'string' }
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
comparison: {
|
|
499
|
-
type: 'object',
|
|
500
|
-
description: 'Comparison parameters',
|
|
501
|
-
properties: {
|
|
502
|
-
timeRange: { type: 'string' },
|
|
503
|
-
agentId: { type: 'string' },
|
|
504
|
-
channelId: { type: 'string' }
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
metrics: {
|
|
508
|
-
type: 'array',
|
|
509
|
-
items: { type: 'string' },
|
|
510
|
-
description: 'Specific metrics to compare',
|
|
511
|
-
default: ['response_time', 'success_rate', 'task_completion']
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
required: ['comparisonType', 'baseline', 'comparison'],
|
|
515
|
-
additionalProperties: false
|
|
516
|
-
},
|
|
517
|
-
enabled: true,
|
|
518
|
-
handler: async ({ comparisonType, baseline, comparison, metrics = ['response_time', 'success_rate', 'task_completion'] }, { agentId, channelId }) => {
|
|
519
|
-
try {
|
|
520
|
-
// Mock comparison data since compareMetrics doesn't exist
|
|
521
|
-
const comparisonResult = {
|
|
522
|
-
improvement: 0,
|
|
523
|
-
significantChanges: [],
|
|
524
|
-
recommendations: ['Comparison functionality needs implementation']
|
|
525
|
-
};
|
|
526
|
-
return createToolResult(true, {
|
|
527
|
-
comparisonType,
|
|
528
|
-
baseline,
|
|
529
|
-
comparison,
|
|
530
|
-
metrics,
|
|
531
|
-
results: comparisonResult,
|
|
532
|
-
summary: {
|
|
533
|
-
improvement: comparisonResult.improvement || 0,
|
|
534
|
-
significantChanges: comparisonResult.significantChanges || [],
|
|
535
|
-
recommendations: comparisonResult.recommendations || []
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
catch (error) {
|
|
540
|
-
logger.error('Error comparing performance:', error);
|
|
541
|
-
return createToolResult(false, { error: `Failed to compare performance: ${error.message}` });
|
|
542
|
-
}
|
|
543
|
-
}
|
|
214
|
+
description: 'Unavailable until performance comparison has an authoritative tenant-scoped implementation',
|
|
215
|
+
inputSchema: unavailableInputSchema,
|
|
216
|
+
enabled: false,
|
|
217
|
+
handler: unavailableHandler('Performance comparison is not implemented')
|
|
544
218
|
};
|
|
545
|
-
/**
|
|
546
|
-
* 9. Get Real-time Analytics Dashboard Data
|
|
547
|
-
*/
|
|
548
219
|
export const analytics_dashboard_data = {
|
|
549
220
|
name: 'analytics_dashboard_data',
|
|
550
|
-
description: '
|
|
551
|
-
inputSchema:
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
refresh: {
|
|
555
|
-
type: 'boolean',
|
|
556
|
-
description: 'Force refresh of cached data',
|
|
557
|
-
default: false
|
|
558
|
-
},
|
|
559
|
-
widgets: {
|
|
560
|
-
type: 'array',
|
|
561
|
-
items: {
|
|
562
|
-
type: 'string',
|
|
563
|
-
enum: ['system_status', 'active_agents', 'task_queue', 'performance_overview', 'recent_activities']
|
|
564
|
-
},
|
|
565
|
-
description: 'Specific dashboard widgets to include',
|
|
566
|
-
default: ['system_status', 'active_agents', 'task_queue', 'performance_overview']
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
additionalProperties: false
|
|
570
|
-
},
|
|
571
|
-
enabled: true,
|
|
572
|
-
handler: async ({ refresh = false, widgets = ['system_status', 'active_agents', 'task_queue', 'performance_overview'] }, { agentId, channelId }) => {
|
|
573
|
-
try {
|
|
574
|
-
const dashboardData = {
|
|
575
|
-
timestamp: new Date().toISOString(),
|
|
576
|
-
widgets: {}
|
|
577
|
-
};
|
|
578
|
-
// Populate requested widgets
|
|
579
|
-
for (const widget of widgets) {
|
|
580
|
-
switch (widget) {
|
|
581
|
-
case 'system_status':
|
|
582
|
-
dashboardData.widgets.system_status = {
|
|
583
|
-
status: 'healthy',
|
|
584
|
-
uptime: Math.floor(process.uptime()),
|
|
585
|
-
services: { active: 4, total: 4 }
|
|
586
|
-
};
|
|
587
|
-
break;
|
|
588
|
-
case 'active_agents':
|
|
589
|
-
dashboardData.widgets.active_agents = {
|
|
590
|
-
total: 0,
|
|
591
|
-
active: 0,
|
|
592
|
-
idle: 0
|
|
593
|
-
};
|
|
594
|
-
break;
|
|
595
|
-
case 'task_queue':
|
|
596
|
-
dashboardData.widgets.task_queue = {
|
|
597
|
-
pending: 0,
|
|
598
|
-
running: 0,
|
|
599
|
-
completed: 0
|
|
600
|
-
};
|
|
601
|
-
break;
|
|
602
|
-
case 'performance_overview':
|
|
603
|
-
dashboardData.widgets.performance_overview = {
|
|
604
|
-
averageResponseTime: 0,
|
|
605
|
-
successRate: 0,
|
|
606
|
-
throughput: 0
|
|
607
|
-
};
|
|
608
|
-
break;
|
|
609
|
-
case 'recent_activities':
|
|
610
|
-
dashboardData.widgets.recent_activities = {
|
|
611
|
-
activities: [],
|
|
612
|
-
count: 0
|
|
613
|
-
};
|
|
614
|
-
break;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
return createToolResult(true, {
|
|
618
|
-
dashboard: dashboardData,
|
|
619
|
-
meta: {
|
|
620
|
-
refreshed: refresh,
|
|
621
|
-
widgetCount: widgets.length,
|
|
622
|
-
dataAge: 0
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
catch (error) {
|
|
627
|
-
logger.error('Error getting dashboard data:', error);
|
|
628
|
-
return createToolResult(false, { error: `Failed to get dashboard data: ${error.message}` });
|
|
629
|
-
}
|
|
630
|
-
}
|
|
221
|
+
description: 'Server-global dashboard data is not available to agent MCP callers',
|
|
222
|
+
inputSchema: unavailableInputSchema,
|
|
223
|
+
enabled: false,
|
|
224
|
+
handler: unavailableHandler('Server-global dashboard data is restricted to administrative surfaces')
|
|
631
225
|
};
|
|
632
|
-
/**
|
|
633
|
-
* 10. Export Analytics Data
|
|
634
|
-
*/
|
|
635
226
|
export const analytics_export_data = {
|
|
636
227
|
name: 'analytics_export_data',
|
|
637
|
-
description: '
|
|
638
|
-
inputSchema:
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
dataType: {
|
|
642
|
-
type: 'string',
|
|
643
|
-
enum: ['performance', 'tasks', 'validation', 'system', 'comprehensive'],
|
|
644
|
-
description: 'Type of data to export'
|
|
645
|
-
},
|
|
646
|
-
timeRange: {
|
|
647
|
-
type: 'string',
|
|
648
|
-
enum: ['24h', '7d', '30d', '90d'],
|
|
649
|
-
description: 'Time range for exported data',
|
|
650
|
-
default: '7d'
|
|
651
|
-
},
|
|
652
|
-
format: {
|
|
653
|
-
type: 'string',
|
|
654
|
-
enum: ['json', 'csv', 'excel'],
|
|
655
|
-
description: 'Export format',
|
|
656
|
-
default: 'json'
|
|
657
|
-
},
|
|
658
|
-
includeRawData: {
|
|
659
|
-
type: 'boolean',
|
|
660
|
-
description: 'Include raw data points (larger file)',
|
|
661
|
-
default: false
|
|
662
|
-
},
|
|
663
|
-
filters: {
|
|
664
|
-
type: 'object',
|
|
665
|
-
description: 'Optional filters for data export',
|
|
666
|
-
properties: {
|
|
667
|
-
agentId: { type: 'string' },
|
|
668
|
-
channelId: { type: 'string' },
|
|
669
|
-
category: { type: 'string' }
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
},
|
|
673
|
-
required: ['dataType'],
|
|
674
|
-
additionalProperties: false
|
|
675
|
-
},
|
|
676
|
-
enabled: true,
|
|
677
|
-
handler: async ({ dataType, timeRange = '7d', format = 'json', includeRawData = false, filters = {} }, { agentId, channelId }) => {
|
|
678
|
-
try {
|
|
679
|
-
// Generate export metadata
|
|
680
|
-
const exportData = {
|
|
681
|
-
exportId: `export_${Date.now()}`,
|
|
682
|
-
dataType,
|
|
683
|
-
timeRange,
|
|
684
|
-
format,
|
|
685
|
-
includeRawData,
|
|
686
|
-
filters,
|
|
687
|
-
generatedAt: new Date().toISOString(),
|
|
688
|
-
estimatedSize: '1.2MB', // Mock estimate
|
|
689
|
-
downloadReady: true,
|
|
690
|
-
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString()
|
|
691
|
-
};
|
|
692
|
-
return createToolResult(true, {
|
|
693
|
-
export: exportData,
|
|
694
|
-
downloadInfo: {
|
|
695
|
-
url: null, // Would be actual download URL
|
|
696
|
-
filename: `mxf_analytics_${dataType}_${timeRange}.${format}`,
|
|
697
|
-
size: exportData.estimatedSize
|
|
698
|
-
},
|
|
699
|
-
preview: {
|
|
700
|
-
recordCount: 100, // Mock count
|
|
701
|
-
columns: ['timestamp', 'metric', 'value', 'context'],
|
|
702
|
-
sampleData: includeRawData ? [] : null
|
|
703
|
-
}
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
catch (error) {
|
|
707
|
-
logger.error('Error exporting analytics data:', error);
|
|
708
|
-
return createToolResult(false, { error: `Failed to export data: ${error.message}` });
|
|
709
|
-
}
|
|
710
|
-
}
|
|
228
|
+
description: 'Unavailable until analytics export has an authoritative tenant-scoped implementation',
|
|
229
|
+
inputSchema: unavailableInputSchema,
|
|
230
|
+
enabled: false,
|
|
231
|
+
handler: unavailableHandler('Analytics export is not implemented')
|
|
711
232
|
};
|
|
712
|
-
// Export all analytics tools
|
|
713
233
|
export const analyticsTools = [
|
|
714
234
|
analytics_agent_performance,
|
|
715
235
|
analytics_channel_activity,
|