ai-debug-local-mcp
Version:
🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh
100 lines • 2.92 kB
TypeScript
/**
* Intelligent Server Readiness & Auto-Startup System
*
* Addresses the common AI pattern where inject_debugging is attempted before
* the development server is running, causing inefficient retry cycles.
*
* Features:
* - Proactive server readiness detection
* - Intelligent auto-startup with framework detection
* - Development server health monitoring
* - Zero-wait injection through predictive readiness
*/
export interface ServerReadinessResult {
isReady: boolean;
url: string;
framework: string;
autoStarted: boolean;
readinessTimeMs: number;
recommendedAction: 'proceed' | 'wait' | 'start_server' | 'check_config';
serverInfo?: {
pid?: number;
port: number;
status: 'starting' | 'ready' | 'error' | 'stopped';
startupTimeMs?: number;
};
}
export interface FrameworkStartupConfig {
framework: string;
detectionFiles: string[];
startCommands: string[];
defaultPort: number;
readinessPath: string;
startupTimeoutMs: number;
healthCheckEndpoints: string[];
}
export declare class IntelligentServerReadiness {
private logger;
private frameworkConfigs;
private serverProcesses;
private readinessCache;
constructor();
/**
* Main method: Check if server is ready, auto-start if needed
*/
ensureServerReadiness(url: string, options?: {
autoStart?: boolean;
maxWaitMs?: number;
framework?: string;
workingDirectory?: string;
}): Promise<ServerReadinessResult>;
/**
* Check if server is ready to accept debugging connections
*/
private checkServerReadiness;
/**
* Auto-start development server based on detected framework
*/
private autoStartDevelopmentServer;
/**
* Wait for server to become ready with intelligent polling
*/
private waitForServerReadiness;
/**
* Detect project framework from file system
*/
private detectProjectFramework;
/**
* Initialize framework configurations
*/
private initializeFrameworkConfigs;
/**
* Select the best start command for the detected environment
*/
private selectBestStartCommand;
/**
* Spawn server process with proper error handling
*/
private spawnServerProcess;
private isPortListening;
private testHttpResponse;
private cacheReadinessResult;
private detectAvailablePackageManagers;
private isCommandAvailable;
private detectFrameworkFromPackageJson;
private getRecommendedAction;
/**
* Get current server readiness metrics
*/
getReadinessMetrics(): {
cachedUrls: number;
activeProcesses: number;
frameworksSupported: number;
averageStartupTime: number;
};
/**
* Cleanup server processes
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=intelligent-server-readiness.d.ts.map