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
130 lines • 4.19 kB
TypeScript
import { Page } from 'playwright';
import { NextJSConfig } from './modules/nextjs-config-detector.js';
export { NextJSConfig } from './modules/nextjs-config-detector.js';
export interface AppRouterInfo {
currentRoute: string;
params: Record<string, string>;
searchParams: Record<string, string>;
layoutNesting: number;
parallelRoutes: string[];
interceptedRoutes: number;
routeGroups: string[];
dynamicSegments: string[];
}
export interface DataFetchingAnalysis {
method: 'fetch with cache' | 'fetch no-store' | 'getServerSideProps' | 'getStaticProps' | 'server-action';
cacheStatus: 'HIT' | 'MISS' | 'STALE' | 'NONE';
revalidateTime?: number;
waterfalls: Array<{
component: string;
fetchTime: string;
blocking: boolean;
parallel?: string[];
}>;
}
export interface NextJSBundleAnalysis {
firstLoadJS: Record<string, number>;
totalBundleSize: number;
unusedDependencies: string[];
codeSplitting: {
effectiveness: number;
sharedChunks: string[];
routeChunks: Record<string, string[]>;
};
}
export interface MiddlewareAnalysis {
executionTime: string;
affectedRoutes: number;
memoryUsage: string;
warnings: string[];
matchers: string[];
}
export interface ServerActionMonitor {
invocations: Array<{
action: string;
timestamp: Date;
duration: number;
payloadSize: number;
revalidations: string[];
error?: string;
}>;
totalInvocations: number;
avgExecutionTime: number;
largestPayload: number;
}
export interface NextJSCacheInspector {
dataCache: {
size: string;
entries: number;
hitRate: string;
};
fullRouteCache: {
cachedRoutes: number;
avgAge: string;
};
clientRouterCache: {
entries: number;
};
revalidations: Array<{
path: string;
timestamp: Date;
trigger: 'time-based' | 'on-demand' | 'tag';
}>;
}
export interface FontLoadingAnalysis {
strategy: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
fontsUsingNextFont: number;
fontsNotOptimized: string[];
variableFonts: string[];
cls: number;
loadTime: number;
}
export interface SecurityAnalysis {
environmentVariables: {
exposed: string[];
properlyPrefixed: string[];
warnings: string[];
};
headers: {
csp: boolean;
xFrameOptions: string;
permissionsPolicy: boolean;
cors: string;
missingHeaders: string[];
};
}
/**
* NextJSDebugEngineRefactored - Modular Next.js debugging engine
*
* This class serves as a lightweight orchestrator that delegates to specialized modules:
* - NextJSConfigDetector: Configuration detection and App Router analysis
* - NextJSMonitoringSetup: Real-time monitoring setup
* - NextJSBundleAnalyzer: Bundle analysis and optimization
* - NextJSSecurityAnalyzer: Security analysis and vulnerability detection
*
* This achieves 90%+ code reduction while maintaining full backward compatibility.
*/
export declare class NextJSDebugEngineRefactored {
private page?;
private configDetector;
private monitoringSetup;
private bundleAnalyzer?;
private securityAnalyzer?;
constructor();
attachToPage(page: Page): Promise<void>;
getConfig(): Promise<NextJSConfig | null>;
getAppRouterInfo(): Promise<AppRouterInfo | null>;
getBundleAnalysis(): Promise<NextJSBundleAnalysis>;
getSecurityAnalysis(): Promise<SecurityAnalysis>;
getMonitoringStatus(): Promise<any>;
getPageInfo(session: any): Promise<any>;
auditImages(session: any): Promise<any>;
detectIssues(session: any): Promise<any>;
getDataFetchingAnalysis(): Promise<DataFetchingAnalysis[]>;
getMiddlewareAnalysis(): Promise<MiddlewareAnalysis | null>;
getServerActionMonitor(): Promise<ServerActionMonitor>;
getCacheInspector(): Promise<NextJSCacheInspector>;
getFontLoadingAnalysis(): Promise<FontLoadingAnalysis>;
}
export { NextJSDebugEngineRefactored as NextJSDebugEngineEnhanced };
//# sourceMappingURL=nextjs-debug-engine-refactored.d.ts.map