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
189 lines • 5.49 kB
TypeScript
/**
* Python Backend Debug Engine
* Handles Python code analysis, test debugging, Pydantic validation, and database schema issues
*/
export interface TestAnalysisResult {
summary: {
total: number;
passed: number;
failed: number;
skipped: number;
errors: number;
};
failures: Array<{
test_name: string;
error_message: string;
file_path: string;
line_number?: number;
traceback?: string;
}>;
errorAnalysis: Array<{
type: string;
description: string;
severity: 'high' | 'medium' | 'low';
suggestions: string[];
}>;
recommendations: string[];
}
export interface PydanticValidationResult {
models: Array<{
name: string;
fields: Array<{
name: string;
type: string;
required: boolean;
constraints?: string[];
}>;
}>;
errors: Array<{
field: string;
message: string;
error_type: string;
}>;
fieldMismatches: Array<{
field: string;
expected: string;
actual: string;
}>;
suggestions: string[];
}
export interface DatabaseSchemaResult {
tables: Array<{
name: string;
columns: Array<{
name: string;
type: string;
nullable: boolean;
primary_key: boolean;
}>;
indexes: Array<{
name: string;
columns: string[];
}>;
foreign_keys: Array<{
column: string;
referenced_table: string;
referenced_column: string;
}>;
}>;
migrationIssues: Array<{
type: string;
description: string;
table?: string;
column?: string;
}>;
inconsistencies: Array<{
table: string;
issue: string;
severity: 'high' | 'medium' | 'low';
}>;
recommendations: string[];
}
export interface BackendLogicResult {
structure: {
functions: number;
classes: number;
lines: number;
complexity?: number;
};
errorAnalysis?: {
type: string;
rootCause: string;
location: string;
suggestions: string[];
};
logicIssues: Array<{
type: string;
description: string;
line?: number;
severity: 'high' | 'medium' | 'low';
}>;
suggestions: string[];
}
export interface ImportDebugResult {
modules: Array<{
name: string;
path: string;
available: boolean;
}>;
errors: Array<{
module: string;
message: string;
type: string;
}>;
pathIssues: Array<{
type: string;
description: string;
path?: string;
}>;
solutions: string[];
}
export interface ApiIntegrationResult {
endpoints: Array<{
method: string;
path: string;
status: 'working' | 'error' | 'unknown';
parameters?: Array<{
name: string;
type: string;
required: boolean;
}>;
}>;
issues: Array<{
type: string;
description: string;
severity: 'high' | 'medium' | 'low';
}>;
validation?: {
requestValid: boolean;
responseValid: boolean;
schemaMatches: boolean;
};
recommendations: string[];
}
export declare class PythonBackendEngine {
private pythonExecutable;
constructor();
private findPythonExecutable;
analyzeTests(testFilePath: string, testOutput?: string, includeStackTrace?: boolean): Promise<TestAnalysisResult>;
validatePydanticModels(modelFilePath: string, validationError?: string, testData?: string): Promise<PydanticValidationResult>;
debugDatabaseSchema(schemaFilePath: string, migrationError?: string, databaseType?: string): Promise<DatabaseSchemaResult>;
analyzeBackendLogic(codeFilePath: string, errorMessage?: string, logContext?: string, analysisType?: string): Promise<BackendLogicResult>;
debugImports(projectPath: string, importError?: string): Promise<ImportDebugResult>;
analyzeApiIntegration(apiEndpointPath: string, requestData?: string, responseError?: string, frameworkType?: string): Promise<ApiIntegrationResult>;
private parseTestOutput;
private runPytestAnalysis;
private analyzeTestFile;
private analyzeTestDirectory;
private generateTestRecommendations;
private parsePydanticModels;
private parseValidationError;
private validateTestData;
private generatePydanticSuggestions;
private parsePythonSchemaFile;
private parseSqlSchemaFile;
private analyzeMigrationError;
private checkSchemaConsistency;
private generateSchemaRecommendations;
private analyzeCodeStructure;
private analyzeRuntimeError;
private analyzeApiEndpoints;
private analyzeDataProcessing;
private analyzeBusinessLogic;
private performGeneralAnalysis;
private generateLogicSuggestions;
private analyzeProjectStructure;
private parseImportError;
private checkPythonPath;
private generateImportSolutions;
private parseApiEndpoints;
private parseFastApiEndpoints;
private parseFlaskEndpoints;
private parseDjangoEndpoints;
private parseGenericEndpoints;
private analyzeRequestData;
private analyzeResponseError;
private validateApiIntegration;
private generateApiRecommendations;
}
//# sourceMappingURL=python-backend-engine.d.ts.map