/** * Smart TSConfig Tool - 83% Token Reduction * * Parses and analyzes tsconfig.json with: * - Extends chain resolution * - Compiler options inheritance * - 7-day TTL caching * - Config issue detection * - Optimization suggestions */ import { CacheEngine } from '../../core/cache-engine.js'; import { TokenCounter } from '../../core/token-counter.js'; import { MetricsCollector } from '../../core/metrics.js'; interface TsConfigCompilerOptions { target?: string; module?: string; strict?: boolean; esModuleInterop?: boolean; skipLibCheck?: boolean; forceConsistentCasingInFileNames?: boolean; moduleResolution?: string; resolveJsonModule?: boolean; isolatedModules?: boolean; jsx?: string; lib?: string[]; outDir?: string; rootDir?: string; baseUrl?: string; paths?: Record; [key: string]: unknown; } interface ResolvedTsConfig { compilerOptions: TsConfigCompilerOptions; include?: string[]; exclude?: string[]; files?: string[]; references?: Array<{ path: string; }>; extendsChain: string[]; configPath: string; } interface ConfigIssue { severity: 'error' | 'warning' | 'info'; category: 'strict-mode' | 'target-version' | 'module-system' | 'paths' | 'performance' | 'compatibility'; message: string; suggestion?: string; } interface SmartTsConfigOptions { configPath?: string; projectRoot?: string; includeIssues?: boolean; includeSuggestions?: boolean; maxCacheAge?: number; } interface SmartTsConfigOutput { success: boolean; configPath: string; resolved: ResolvedTsConfig; issues?: ConfigIssue[]; suggestions?: string[]; cacheHit: boolean; tokenMetrics: { original: number; compact: number; saved: number; savingsPercent: number; }; executionTime: number; diff?: { added: string[]; removed: string[]; modified: string[]; }; } declare class SmartTsConfig { private cache; private tokenCounter; private metrics; private projectRoot; constructor(cache: CacheEngine, tokenCounter: TokenCounter, metrics: MetricsCollector, projectRoot?: string); /** * Main entry point - parse and resolve tsconfig */ run(options?: SmartTsConfigOptions): Promise; /** * Resolve config path from options or find default */ private resolveConfigPath; /** * Resolve tsconfig with extends chain */ private resolveConfig; /** * Parse a single tsconfig file */ private parseConfigFile; /** * Resolve extends path (can be relative or node_modules package) */ private resolveExtendsPath; /** * Merge two configs (later overrides earlier) */ private mergeConfigs; /** * Detect configuration issues */ private detectIssues; /** * Generate optimization suggestions */ private generateSuggestions; /** * Transform output to reduce tokens */ private transformOutput; /** * Compact compiler options by removing defaults */ private compactCompilerOptions; /** * Close resources */ close(): void; } /** * Factory function for shared resources (benchmarks) */ export declare function getSmartTsConfig(cache: CacheEngine, tokenCounter: TokenCounter, metrics: MetricsCollector, projectRoot?: string): SmartTsConfig; /** * Smart TSConfig - Parse and analyze tsconfig.json with caching * * @param options - Configuration options * @returns Parsed and resolved tsconfig with metrics */ export declare function runSmartTsconfig(options?: SmartTsConfigOptions): Promise; export declare const SMART_TSCONFIG_TOOL_DEFINITION: { readonly name: "smart_tsconfig"; readonly description: "Parse and analyze TypeScript configuration with 83% token reduction. Resolves extends chains, detects issues, and caches results for 7 days."; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly configPath: { readonly type: "string"; readonly description: "Path to tsconfig.json (relative to projectRoot)"; }; readonly projectRoot: { readonly type: "string"; readonly description: "Project root directory (defaults to cwd)"; }; readonly includeIssues: { readonly type: "boolean"; readonly description: "Include configuration issues detection (default: true)"; }; readonly includeSuggestions: { readonly type: "boolean"; readonly description: "Include optimization suggestions (default: true)"; }; readonly maxCacheAge: { readonly type: "number"; readonly description: "Maximum cache age in seconds (default: 604800 = 7 days)"; }; }; }; }; export {}; //# sourceMappingURL=smart-tsconfig.d.ts.map