@hivetechs/hive-ai
Version:
Real-time streaming AI consensus platform with HTTP+SSE MCP integration for Claude Code, VS Code, Cursor, and Windsurf - powered by OpenRouter's unified API
91 lines • 2.27 kB
TypeScript
/**
* MCP Daemon - Persistent Daemon Architecture (2025 Research Patterns)
*
* Implements "Persistent daemons ensure reliability at scale" with:
* - Automatic port discovery and conflict resolution
* - Circuit breakers with exponential backoff retry
* - Health monitoring and auto-recovery
* - Global compatibility across OS/environments
* - 99.95% uptime through proper error handling
*/
export declare class MCPDaemon {
private config;
private configPath;
private lockPath;
private serverProcess;
private circuitBreaker;
private healthCheckInterval;
private logPath;
private readonly FAILURE_THRESHOLD;
private readonly RECOVERY_TIMEOUT;
private readonly MAX_RESTART_ATTEMPTS;
constructor();
/**
* Start persistent daemon with auto-recovery (research pattern)
*/
start(): Promise<{
port: number;
success: boolean;
message: string;
}>;
/**
* Intelligent port discovery (global compatibility)
*/
private findAvailablePort;
/**
* Check if port is available (cross-platform)
*/
private isPortAvailable;
/**
* Get OS-assigned port (fallback strategy)
*/
private getOSAssignedPort;
/**
* Start MCP server process
*/
private startMCPServer;
/**
* Health monitoring with auto-recovery (research pattern)
*/
private startHealthMonitoring;
/**
* Update Claude Code configuration with current port
*/
private updateClaudeCodeConfig;
/**
* Check if daemon is running
*/
isRunning(): Promise<boolean>;
/**
* Stop daemon
*/
stop(): Promise<void>;
/**
* Circuit breaker management
*/
private recordFailure;
private resetCircuitBreaker;
/**
* Configuration management
*/
private loadConfig;
private saveConfig;
private createLockFile;
private removeLockFile;
/**
* Logging
*/
private log;
/**
* Get daemon status
*/
getStatus(): Promise<{
running: boolean;
port: number;
uptime: number;
restartCount: number;
lastError?: string;
circuitBreakerState: string;
}>;
}
//# sourceMappingURL=mcp-daemon.d.ts.map