UNPKG

zai-mcp-server

Version:

🚀 REVOLUTIONARY AI-to-AI Collaboration Platform v6.1! NEW: Advanced Debugging Tools with Screenshot Analysis, Console Error Parsing, Automated Fix Generation, 5 Specialized Debugging Agents, Visual UI Analysis, JavaScript Error Intelligence, CSS/HTML Fix

1,135 lines (1,089 loc) 582 kB
#!/usr/bin/env node /** * ZAI MCP Server - AI-to-AI Loop System with Multi-Provider Support * Supports OpenRouter, Anthropic, and DeepSeek APIs with automatic failover */ import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'; import { MultiProviderAI } from './multiProviderAI.js'; import { ZAIDataCollector } from './data-collection-system.js'; import { AIVotingManager } from './aiVotingManager.js'; import { TaskManager } from './taskManager.js'; import { DeepThinking } from './deepThinking.js'; import { ParallelImplementation } from './parallelImplementation.js'; import { AIAgentCoordinator } from './aiAgentCoordinator.js'; import { SmartCaching } from './smartCaching.js'; import { ProjectMemory } from './projectMemory.js'; import { AIModelAnalytics } from './aiModelAnalytics.js'; import { WorkflowTemplates } from './workflowTemplates.js'; import { RealTimeCollaboration } from './realTimeCollaboration.js'; import { AISwarmIntelligence } from './aiSwarmIntelligence.js'; import { PredictiveTaskManagement } from './predictiveTaskManagement.js'; import { RealTimeCodeGeneration } from './realTimeCodeGeneration.js'; import { AdaptiveLearningSystem } from './adaptiveLearningSystem.js'; import { EnhancedPromptLibrary } from './enhancedPromptLibrary.js'; import { InputSanitizer } from './inputSanitizer.js'; import { AdvancedAILoopEngine } from './advancedAILoopEngine.js'; import { AdaptiveTimingEngine } from './adaptiveTimingEngine.js'; import { MultiAgentCollaborator } from './multiAgentCollaborator.js'; import { AdvancedWorkflowEngine } from './advancedWorkflowEngine.js'; import { PerformanceOptimizationSuite } from './performanceOptimizationSuite.js'; import { InnovativeFeatureSet } from './innovativeFeatureSet.js'; import { AutonomousAITeams } from './autonomousAITeams.js'; import { IntelligentOrchestrator } from './intelligentOrchestrator.js'; import { UniversalIntegrationHub } from './universalIntegrationHub.js'; import { AdvancedLoopIntelligence } from './advancedLoopIntelligence.js'; import { LoopWorkflowEngine } from './loopWorkflowEngine.js'; import { SpecializedAgentSystem } from './specializedAgentSystem.js'; import { DebuggingOrchestrator } from './debuggingOrchestrator.js'; import { AndroidDebuggingManager } from './androidDebuggingManager.js'; import { AndroidUIAnalyzer } from './androidUIAnalyzer.js'; import { AndroidFixGenerator } from './androidFixGenerator.js'; // Revolutionary Performance Engines v8.0.0 import { WASMPerformanceEngine } from './wasmPerformanceEngine.js'; import { GPUAccelerationEngine } from './gpuAccelerationEngine.js'; import { QuantumDebuggingEngine } from './quantumDebuggingEngine.js'; import { AdvancedAISwarm } from './advancedAISwarm.js'; import { UniversalPlatformDebugger } from './universalPlatformDebugger.js'; // Strict Progress Validation System import { StrictProgressValidator } from './strictProgressValidator.js'; // External MCP Bridge for Integration Fixes import { ExternalMCPBridge } from './externalMCPBridge.js'; class ZAIMCPServer { constructor() { this.server = new Server( { name: 'zai-mcp-server', version: '2.0.0', }, { capabilities: { tools: {}, }, } ); // Initialize AI providers, voting system, and data collection try { // Initialize Smart Caching System first this.smartCache = new SmartCaching({ cacheDir: './cache', maxCacheSize: 1000, similarityThreshold: 0.85, costSavingsTarget: 0.7 }); // Initialize AI Model Performance Analytics before MultiProviderAI this.modelAnalytics = new AIModelAnalytics({ analyticsDir: './analytics', maxHistoryEntries: 1000 }); this.multiAI = new MultiProviderAI(this.smartCache, this.modelAnalytics); this.votingManager = new AIVotingManager(this.multiAI); this.dataCollector = new ZAIDataCollector(); // Initialize advanced task management components this.taskManager = new TaskManager(this.multiAI, this.votingManager); this.deepThinking = new DeepThinking(this.multiAI, this.votingManager); this.parallelImplementation = new ParallelImplementation(this.multiAI, this.taskManager, this.deepThinking); // Initialize AI Agent Coordinator for enhanced interaction management this.aiCoordinator = new AIAgentCoordinator(this); // Initialize Project Memory & Context Persistence this.projectMemory = new ProjectMemory({ memoryDir: './memory', maxProjects: 100, maxContextHistory: 50 }); // Initialize Workflow Templates System this.workflowTemplates = new WorkflowTemplates({ templatesDir: './templates', customTemplatesDir: './custom-templates', maxCustomTemplates: 50 }); // Initialize Real-time Collaboration System this.collaboration = new RealTimeCollaboration({ collaborationDir: './collaboration', maxWorkspaces: 100, maxUsersPerWorkspace: 20, sessionTimeout: 30 * 60 * 1000 // 30 minutes }); // Initialize AI Swarm Intelligence System this.swarmIntelligence = new AISwarmIntelligence({ swarmDir: './swarm', maxActiveSwarms: 10, agentTimeout: 5 * 60 * 1000, // 5 minutes coordinationStrategy: 'democratic' }); // Initialize Predictive Task Management System this.predictiveTaskManagement = new PredictiveTaskManagement({ predictiveDir: './predictive', maxHistoryEntries: 1000, predictionAccuracyThreshold: 0.75, riskAssessmentInterval: 60000 // 1 minute }); // Initialize Real-time Code Generation & Review System this.realTimeCodeGeneration = new RealTimeCodeGeneration({ codeGenDir: './codegen', maxSuggestions: 5, analysisInterval: 1000, // 1 second maxCodeHistory: 100 }); // Initialize Adaptive Learning System this.adaptiveLearningSystem = new AdaptiveLearningSystem({ learningDir: './learning', maxLearningEntries: 10000, adaptationThreshold: 0.7, learningRate: 0.1, personalityUpdateInterval: 24 * 60 * 60 * 1000 // 24 hours }); // Initialize Enhanced Prompt Library this.enhancedPromptLibrary = new EnhancedPromptLibrary({ libraryDir: './prompt-library', maxPrompts: 10000, maxVersions: 10, abTestDuration: 7 * 24 * 60 * 60 * 1000, // 7 days communityModerationThreshold: 0.8 }); // Initialize Input Sanitizer this.inputSanitizer = new InputSanitizer(); } catch (error) { console.error('❌ Failed to initialize components:', error); throw error; } // Active loops storage this.activeLoops = new Map(); this.loopCounter = 0; // Agent state management this.agentBusy = false; this.pendingResponses = []; // Initialize Strict Acknowledgment System with Topic-Aware AI Prompts this.acknowledgmentSystem = { pendingAcknowledgments: new Map(), strictMode: true, acknowledgmentTimeout: 30000, // 30 seconds maxRetries: 3, blockedOperations: new Set(), lastAcknowledgmentTime: Date.now(), acknowledgmentHistory: [], requireAcknowledgmentBeforePrompts: true, promptQueue: [], acknowledgmentRequired: false, currentLoopId: null, acknowledgedTopics: new Map(), // Track acknowledged topics for contextual prompts topicContext: new Map(), // Store topic context and related information promptGenerationRules: new Map() // Rules for generating topic-specific prompts }; // Start acknowledgment monitoring this.startAcknowledgmentMonitoring(); // Initialize Advanced AI Loop Engine this.advancedAILoopEngine = new AdvancedAILoopEngine(this); console.log('🚀 Advanced AI Loop Engine initialized with comprehensive enhancements'); // Initialize Game-Changing Features this.autonomousAITeams = new AutonomousAITeams(this.multiAI, this.dataCollector); this.intelligentOrchestrator = new IntelligentOrchestrator(this.multiAI, this.autonomousAITeams, this.dataCollector); this.universalIntegrationHub = new UniversalIntegrationHub(this.multiAI, this.dataCollector); console.log('🎯 Game-changing features initialized: Autonomous AI Teams, Intelligent Orchestration, Universal Integration Hub'); // Initialize Advanced Loop Features this.advancedLoopIntelligence = new AdvancedLoopIntelligence(); this.loopWorkflowEngine = new LoopWorkflowEngine(); this.specializedAgentSystem = new SpecializedAgentSystem(); console.log('🧠 Advanced Loop Features initialized: Loop Intelligence, Workflow Engine, Specialized Agents'); // Initialize Advanced Debugging Tools this.debuggingOrchestrator = new DebuggingOrchestrator(this.multiAI, this.specializedAgentSystem); console.log('🔧 Advanced Debugging Tools initialized: Screenshot Analysis, Console Error Parsing, Automated Fix Generation'); // Initialize Android Debugging Tools this.androidDebuggingManager = new AndroidDebuggingManager(this.multiAI, this.debuggingOrchestrator); this.androidUIAnalyzer = new AndroidUIAnalyzer(this.multiAI); this.androidFixGenerator = new AndroidFixGenerator(this.multiAI); console.log('📱 Android Debugging Tools initialized: Wireless Debugging, Mobile UI Analysis, Android Fix Generation'); // Initialize Revolutionary Performance Engines v8.0.0 this.wasmEngine = new WASMPerformanceEngine(); this.gpuEngine = new GPUAccelerationEngine(); this.quantumDebugger = new QuantumDebuggingEngine(); this.aiSwarm = new AdvancedAISwarm(); this.universalDebugger = new UniversalPlatformDebugger(); console.log('🚀 Revolutionary Performance Engines v8.0.0 initialized'); console.log('⚡ WASM: 10x speed boost | 🔥 GPU: 1000x AI acceleration | 🌌 Quantum: Multi-timeline debugging'); console.log('🤖 AI Swarm: Autonomous development | 🌐 Universal: Debug anything, anywhere'); // Initialize Strict Progress Validation System this.strictValidator = new StrictProgressValidator(); this.agentSessions = new Map(); // Track AI agent sessions this.featureUsageTracking = new Map(); // Track feature usage per agent console.log('🔒 Strict Progress Validation System initialized'); console.log('⚠️ MANDATORY: AI agents must use 75%+ of required features'); console.log('📊 Compliance threshold: 85% | Quality threshold: 80%'); // Initialize External MCP Bridge this.externalBridge = new ExternalMCPBridge(); // Initialize bridge asynchronously after constructor this.initializeExternalBridge(); console.log('🌉 External MCP Bridge initializing with fallback support'); this.setupToolHandlers(); this.setupErrorHandling(); // 🆓 FREE VERSION - No license validation required console.error('🆓 ZAI MCP Server - FREE VERSION'); console.error('📊 Data collection enabled for AI training'); console.error('💡 Help us improve AI by using this free service!'); } /** * Initialize external bridge asynchronously */ async initializeExternalBridge() { try { await this.externalBridge.initialize(); console.log('🔄 Bridge status:', this.externalBridge.getBridgeStatus().externalServerStatus); } catch (error) { console.warn('⚠️ External bridge initialization failed:', error.message); } } /** * Start acknowledgment monitoring system */ startAcknowledgmentMonitoring() { // Check for pending acknowledgments every 5 seconds setInterval(() => { this.checkPendingAcknowledgments(); }, 5000); // Check for acknowledgment timeout every 30 seconds setInterval(() => { this.checkAcknowledgmentTimeout(); }, 30000); console.error('🔒 Strict Acknowledgment System initialized'); console.error('⚠️ AI prompts will be blocked until proper acknowledgment'); } /** * Check for pending acknowledgments */ checkPendingAcknowledgments() { const now = Date.now(); for (const [loopId, ackData] of this.acknowledgmentSystem.pendingAcknowledgments) { const timePending = now - ackData.timestamp; if (timePending > this.acknowledgmentSystem.acknowledgmentTimeout) { console.error(`🚨 ACKNOWLEDGMENT TIMEOUT: Loop ${loopId} - ${Math.round(timePending/1000)}s without acknowledgment`); console.error('🔒 AI prompts BLOCKED until acknowledgment received'); // Block all AI operations for this loop this.acknowledgmentSystem.blockedOperations.add(loopId); } } } /** * Check for overall acknowledgment timeout */ checkAcknowledgmentTimeout() { const now = Date.now(); const timeSinceLastAck = now - this.acknowledgmentSystem.lastAcknowledgmentTime; if (timeSinceLastAck > 60000 && this.acknowledgmentSystem.acknowledgmentRequired) { // 1 minute console.error('🚨 CRITICAL: No acknowledgment received for over 1 minute'); console.error('🔒 ALL AI OPERATIONS BLOCKED until acknowledgment'); console.error('📋 Please use acknowledge_agent_response tool to continue'); // Block all operations this.acknowledgmentSystem.strictMode = true; } } setupToolHandlers() { // List available tools this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: 'activate_infinite_loop', description: 'Start AI-to-AI improvement loops for continuous development', inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'Activation message with topic (format: "zailoop [topic]")' }, aiToAi: { type: 'boolean', description: 'Enable AI-to-AI communication mode', default: true }, interval: { type: 'number', description: 'Loop interval in milliseconds', default: 5000 }, maxIterations: { type: 'number', description: 'Maximum iterations before auto-stop', default: 999999 } }, required: ['message'] } }, { name: 'stop_ai_loops', description: 'Stop all active AI-to-AI loops', inputSchema: { type: 'object', properties: { message: { type: 'string', description: 'Stop command (e.g., "stploop")' } }, required: ['message'] } }, { name: 'list_active_loops', description: 'View running loops', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'get_ai_provider_status', description: 'Check provider status', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'reset_ai_providers', description: 'Reset failed providers', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'get_ai_prompts', description: 'Get AI-generated prompts', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of prompts to return', default: 5 } }, required: [] } }, { name: 'acknowledge_agent_response', description: 'Process AI responses', inputSchema: { type: 'object', properties: { loopId: { type: 'string', description: 'The ID of the loop to acknowledge' }, agentResponse: { type: 'string', description: 'The agent response text' } }, required: ['loopId'] } }, { name: 'ai_voting_request', description: 'Submit prompt for multi-model AI consensus voting', inputSchema: { type: 'object', properties: { prompt: { type: 'string', description: 'The prompt to submit for AI voting' }, panel: { type: 'string', description: 'Voting panel to use (general, coding, reasoning, premium)', default: 'general' }, strategy: { type: 'string', description: 'Voting strategy (majority, consensus, weighted, unanimous)', default: 'consensus' }, maxAgents: { type: 'number', description: 'Maximum number of agents to use', default: 5 } }, required: ['prompt'] } }, { name: 'get_voting_history', description: 'View recent voting sessions', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of recent sessions to return', default: 5 } }, required: [] } }, { name: 'get_agent_performance', description: 'Check AI agent performance statistics', inputSchema: { type: 'object', properties: { agentId: { type: 'string', description: 'Specific agent ID to check (optional)' } }, required: [] } }, { name: 'analyze_task_breakdown', description: 'Analyze a topic and break it down into actionable subtasks with prioritization', inputSchema: { type: 'object', properties: { topic: { type: 'string', description: 'The topic or project to analyze and break down' }, context: { type: 'object', description: 'Additional context for the analysis (optional)' } }, required: ['topic'] } }, { name: 'deep_think_implementation', description: 'Perform deep thinking analysis on a specific task to explore solutions and create implementation plans', inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'ID of the task to analyze' }, taskName: { type: 'string', description: 'Name of the task (if taskId not available)' }, taskDescription: { type: 'string', description: 'Description of the task (if taskId not available)' }, context: { type: 'object', description: 'Additional context for deep thinking (optional)' } }, required: [] } }, { name: 'get_cache_analytics', description: 'Get smart caching system analytics and performance metrics', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'clear_cache', description: 'Clear the smart cache system', inputSchema: { type: 'object', properties: { confirm: { type: 'boolean', description: 'Confirmation to clear cache' } }, required: ['confirm'] } }, { name: 'optimize_cache', description: 'Optimize cache performance by removing low-value entries', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'create_project', description: 'Create a new project in memory for context persistence', inputSchema: { type: 'object', properties: { projectName: { type: 'string', description: 'Name of the project' }, context: { type: 'object', description: 'Project context and metadata' } }, required: ['projectName'] } }, { name: 'get_project_memory', description: 'Retrieve project memory and context', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project ID to retrieve' } }, required: ['projectId'] } }, { name: 'set_user_preference', description: 'Set user preference for personalization', inputSchema: { type: 'object', properties: { key: { type: 'string', description: 'Preference key' }, value: { description: 'Preference value' }, context: { type: 'object', description: 'Context for the preference' } }, required: ['key', 'value'] } }, { name: 'get_memory_analytics', description: 'Get project memory analytics and insights', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'get_recommended_strategies', description: 'Get recommended strategies based on context and history', inputSchema: { type: 'object', properties: { context: { type: 'object', description: 'Current context for recommendations' }, limit: { type: 'number', description: 'Maximum number of strategies to return' } }, required: [] } }, { name: 'get_model_analytics', description: 'Get AI model performance analytics and rankings', inputSchema: { type: 'object', properties: { taskType: { type: 'string', description: 'Filter by specific task type' }, metric: { type: 'string', description: 'Ranking metric (overall, speed, cost, quality, reliability)' } }, required: [] } }, { name: 'get_cost_analysis', description: 'Get detailed cost analysis for AI model usage', inputSchema: { type: 'object', properties: { timeframe: { type: 'string', description: 'Analysis timeframe (day, week, month, all)' } }, required: [] } }, { name: 'get_recommended_model', description: 'Get recommended AI model for specific task type and priorities', inputSchema: { type: 'object', properties: { taskType: { type: 'string', description: 'Type of task' }, priorities: { type: 'object', description: 'Priority weights for cost, speed, quality (0-1)' } }, required: ['taskType'] } }, { name: 'get_performance_trends', description: 'Get performance trends over time', inputSchema: { type: 'object', properties: { metric: { type: 'string', description: 'Metric to analyze (responseTime, successRate, qualityScore, cost)' }, timeframe: { type: 'string', description: 'Time period (day, week, month)' } }, required: [] } }, { name: 'list_workflow_templates', description: 'List available workflow templates with filtering options', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Filter by category (web_development, api_development, data_analysis, machine_learning, devops)' }, framework: { type: 'string', description: 'Filter by framework (react, nodejs, python, docker, etc.)' }, complexity: { type: 'string', description: 'Filter by complexity (low, medium, high)' }, search: { type: 'string', description: 'Search query for template name, description, or tags' } }, required: [] } }, { name: 'get_workflow_template', description: 'Get detailed information about a specific workflow template', inputSchema: { type: 'object', properties: { templateId: { type: 'string', description: 'ID of the template to retrieve' } }, required: ['templateId'] } }, { name: 'create_custom_template', description: 'Create a new custom workflow template', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Template name' }, category: { type: 'string', description: 'Template category' }, description: { type: 'string', description: 'Template description' }, framework: { type: 'string', description: 'Primary framework or technology' }, complexity: { type: 'string', description: 'Complexity level (low, medium, high)' }, estimatedTime: { type: 'string', description: 'Estimated completion time' }, tags: { type: 'array', description: 'Template tags', items: { type: 'string' } }, steps: { type: 'array', description: 'Template steps', items: { type: 'object' } }, dependencies: { type: 'array', description: 'Required dependencies', items: { type: 'string' } }, resources: { type: 'array', description: 'Helpful resources and links', items: { type: 'string' } } }, required: ['name', 'category', 'description', 'steps'] } }, { name: 'get_template_recommendations', description: 'Get recommended templates based on context and usage patterns', inputSchema: { type: 'object', properties: { context: { type: 'object', description: 'Context for recommendations (category, framework, tags, etc.)' }, limit: { type: 'number', description: 'Maximum number of recommendations to return' } }, required: [] } }, { name: 'get_template_analytics', description: 'Get workflow template usage analytics and statistics', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'create_workspace', description: 'Create a new collaborative workspace', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Workspace name' }, creatorId: { type: 'string', description: 'ID of the workspace creator' }, options: { type: 'object', description: 'Workspace configuration options' } }, required: ['name', 'creatorId'] } }, { name: 'join_workspace', description: 'Join an existing collaborative workspace', inputSchema: { type: 'object', properties: { workspaceId: { type: 'string', description: 'ID of the workspace to join' }, userId: { type: 'string', description: 'ID of the user joining' }, userInfo: { type: 'object', description: 'User information and preferences' } }, required: ['workspaceId', 'userId'] } }, { name: 'execute_collaborative_operation', description: 'Execute an operation in a collaborative workspace', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'User session ID' }, operation: { type: 'object', description: 'Operation to execute', properties: { type: { type: 'string' }, data: { type: 'object' } }, required: ['type', 'data'] } }, required: ['sessionId', 'operation'] } }, { name: 'get_workspace_status', description: 'Get current status and state of a workspace', inputSchema: { type: 'object', properties: { workspaceId: { type: 'string', description: 'ID of the workspace' }, userId: { type: 'string', description: 'ID of the requesting user' } }, required: ['workspaceId', 'userId'] } }, { name: 'get_collaboration_analytics', description: 'Get real-time collaboration analytics and statistics', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'create_ai_swarm', description: 'Create a specialized AI swarm for complex tasks', inputSchema: { type: 'object', properties: { taskDescription: { type: 'string', description: 'Description of the task for the AI swarm' }, requiredAgents: { type: 'array', description: 'Required agent types (frontend, backend, devops, testing, security)', items: { type: 'string' } }, options: { type: 'object', description: 'Swarm configuration options' } }, required: ['taskDescription'] } }, { name: 'get_swarm_status', description: 'Get current status and progress of an AI swarm', inputSchema: { type: 'object', properties: { swarmId: { type: 'string', description: 'ID of the AI swarm' } }, required: ['swarmId'] } }, { name: 'get_swarm_analytics', description: 'Get AI swarm intelligence analytics and performance metrics', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'terminate_swarm', description: 'Terminate an active AI swarm', inputSchema: { type: 'object', properties: { swarmId: { type: 'string', description: 'ID of the AI swarm to terminate' } }, required: ['swarmId'] } }, { name: 'create_predictive_project', description: 'Create a new project with AI-powered predictive analytics', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Project name' }, description: { type: 'string', description: 'Project description' }, team: { type: 'array', description: 'Team members with skills and experience', items: { type: 'object' } }, startDate: { type: 'number', description: 'Project start date (timestamp)' }, resources: { type: 'object', description: 'Available resources' } }, required: ['name', 'description'] } }, { name: 'add_predictive_task', description: 'Add a task to a predictive project with failure prediction and timeline estimation', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project ID' }, title: { type: 'string', description: 'Task title' }, description: { type: 'string', description: 'Task description' }, type: { type: 'string', description: 'Task type (development, testing, design, etc.)' }, complexity: { type: 'string', description: 'Task complexity (low, medium, high, critical)' }, priority: { type: 'string', description: 'Task priority (low, medium, high, critical)' }, assignee: { type: 'string', description: 'Assigned team member ID' }, estimatedHours: { type: 'number', description: 'Estimated hours to complete' }, dependencies: { type: 'array', description: 'Task dependencies (task IDs)', items: { type: 'string' } } }, required: ['projectId', 'title', 'description'] } }, { name: 'get_project_predictions', description: 'Get AI predictions for a project including failure risk, timeline accuracy, and resource optimization', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project ID' } }, required: ['projectId'] } }, { name: 'get_task_predictions', description: 'Get AI predictions for a specific task', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project ID' }, taskId: { type: 'string', description: 'Task ID' } }, required: ['projectId', 'taskId'] } }, { name: 'get_predictive_analytics', description: 'Get comprehensive predictive analytics and model performance metrics', inputSchema: { type: 'object', properties: {}, required: [] } }, { name: 'optimize_project_timeline', description: 'Get AI-powered timeline optimization suggestions for a project', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project ID' } }, required: ['projectId'] } }, { name: 'start_code_session', description: 'Start a real-time code generation and review session', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID' }, projectId: { type: 'string', description: 'Project ID (optional)'