/** * get_file_summary Tool (SMCP-090) * * MCP tool to extract symbols and complexity metrics from a file. * Returns functions, classes, imports, exports, and complexity scores. * Useful for AI assistants to understand code structure without reading entire files. * * Features: * - Extracts functions, classes, methods, interfaces * - Extracts imports and exports * - Calculates cyclomatic complexity * - Calculates nesting depth * - Calculates overall complexity score * - Fast extraction (< 100ms per typical file) */ import { z } from 'zod'; import type { ToolContext } from './searchCode.js'; /** * Input schema for get_file_summary tool */ export declare const GetFileSummaryInputSchema: z.ZodObject<{ path: z.ZodString; includeComplexity: z.ZodDefault>; includeDocstrings: z.ZodDefault>; }, z.core.$strip>; /** * Inferred input type from schema */ export type GetFileSummaryInput = z.infer; /** * Symbol info for output (simplified from internal SymbolInfo) */ export interface OutputSymbolInfo { /** Symbol name */ name: string; /** Symbol type */ type: string; /** Start line (1-based) */ line: number; /** End line (1-based) */ endLine: number; /** Function/method signature */ signature?: string; /** Docstring or comment */ docstring?: string; /** Whether the symbol is exported */ exported?: boolean; /** Whether the symbol is async */ async?: boolean; /** Whether the symbol is static */ static?: boolean; /** Visibility modifier */ visibility?: string; /** Parameter count */ params?: number; /** Return type */ returnType?: string; /** Parent symbol name */ parent?: string; /** Decorators/annotations */ decorators?: string[]; /** Cyclomatic complexity */ complexity?: number; /** Maximum nesting depth */ nesting?: number; } /** * Import info for output */ export interface OutputImportInfo { /** Module/package being imported */ module: string; /** Named imports */ names?: string[]; /** Default import name */ default?: string; /** Whether it's a namespace import */ namespace?: boolean; /** Line number */ line: number; } /** * Export info for output */ export interface OutputExportInfo { /** Exported name */ name: string; /** Export type */ type: string; /** Original name if renamed */ originalName?: string; /** Source module for re-exports */ sourceModule?: string; /** Line number */ line: number; } /** * Complexity metrics for output */ export interface OutputComplexityMetrics { /** Total cyclomatic complexity */ cyclomatic: number; /** Maximum nesting depth */ maxNesting: number; /** Average function complexity */ avgFunctionComplexity: number; /** Number of decision points */ decisionPoints: number; /** Overall complexity score (0-100, higher is better/less complex) */ score: number; } /** * Output structure for get_file_summary tool */ export interface GetFileSummaryOutput { /** File path (relative to project) */ path: string; /** Detected programming language */ language: string; /** Line statistics */ lines: { total: number; code: number; blank: number; comments: number; }; /** Functions and methods */ functions: OutputSymbolInfo[]; /** Classes, interfaces, structs, etc. */ classes: OutputSymbolInfo[]; /** Import statements */ imports: OutputImportInfo[]; /** Export statements */ exports: OutputExportInfo[]; /** Complexity metrics */ complexity: OutputComplexityMetrics; /** File size in bytes */ size: number; /** Extraction duration in milliseconds */ extractionTimeMs: number; /** Whether the language supports full AST extraction */ fullSupport: boolean; } /** * Get file summary with symbols and complexity metrics * * @param input - The input containing the file path * @param context - Tool context containing the project path * @returns File summary with symbols and complexity metrics */ export declare function getFileSummary(input: GetFileSummaryInput, context: ToolContext): Promise; /** * MCP tool definition for get_file_summary * * This tool extracts symbols and complexity metrics from a file. * It does NOT require confirmation as it's a read-only operation. */ export declare const getFileSummaryTool: { name: string; description: string; inputSchema: { type: "object"; properties: { path: { type: string; description: string; }; includeComplexity: { type: string; description: string; default: boolean; }; includeDocstrings: { type: string; description: string; default: boolean; }; }; required: string[]; }; requiresConfirmation: boolean; }; //# sourceMappingURL=getFileSummary.d.ts.map