UNPKG

superaugment

Version:

Enterprise-grade MCP server with world-class C++ analysis, robust error handling, and production-ready architecture for VS Code Augment

144 lines 3.72 kB
import { type CacheStats } from './FileCache.js'; export interface FileInfo { path: string; relativePath: string; size: number; isDirectory: boolean; extension: string; content?: string; } export interface ProjectStructure { rootPath: string; files: FileInfo[]; directories: string[]; packageJson?: any; framework?: string | undefined; language?: string | undefined; } /** * Enhanced file system manager with caching, security, and performance optimizations */ export declare class FileSystemManager { private maxFileSize; private fileCache; private securityEnabled; private performanceMonitoring; private allowedExtensions; constructor(options?: { maxFileSize?: number; enableCache?: boolean; enableSecurity?: boolean; enablePerformanceMonitoring?: boolean; cacheOptions?: any; }); /** * Enhanced file reading with caching and security checks */ readFileContent(filePath: string): Promise<string>; /** * Secure file writing with directory creation */ writeFileContent(filePath: string, content: string): Promise<void>; /** * Validate file path for security */ private validateFilePath; /** * Read files matching glob patterns */ readFiles(patterns: string[], rootPath?: string): Promise<FileInfo[]>; /** * Read a single file with enhanced caching and error handling */ readFile(filePath: string, rootPath?: string): Promise<FileInfo | null>; /** * Analyze project structure */ analyzeProjectStructure(rootPath?: string): Promise<ProjectStructure>; /** * Get file information */ private getFileInfo; /** * Check if file is allowed */ private isAllowedFile; /** * Check if file is text file */ private isTextFile; /** * Detect project framework */ private detectFramework; /** * Detect primary programming language */ private detectPrimaryLanguage; /** * Map file extension to language */ private extensionToLanguage; /** * Get directories in project */ private getDirectories; /** * Get cache statistics */ getCacheStats(): CacheStats; /** * Clear file cache */ clearCache(): void; /** * Invalidate specific file in cache */ invalidateFile(filePath: string): boolean; /** * Check if file exists */ fileExists(filePath: string): Promise<boolean>; /** * Get file stats safely */ getFileStats(filePath: string): Promise<{ size: number; mtime: Date; } | null>; /** * Find files by pattern with caching */ findFiles(pattern: string, rootPath?: string): Promise<string[]>; /** * Get file content with specific encoding */ readFileWithEncoding(filePath: string, encoding?: BufferEncoding): Promise<string>; /** * Batch read multiple files efficiently */ readMultipleFiles(filePaths: string[]): Promise<Map<string, string>>; /** * Update file system manager options */ updateOptions(options: { maxFileSize?: number; enableSecurity?: boolean; enablePerformanceMonitoring?: boolean; }): void; /** * Get health status of file system manager */ getHealthStatus(): { cacheEnabled: boolean; securityEnabled: boolean; performanceMonitoring: boolean; maxFileSize: number; cacheStats: CacheStats; }; /** * Cleanup resources */ cleanup(): void; } //# sourceMappingURL=FileSystemManager.d.ts.map