/** * Smart Read Tool - 80% token reduction through intelligent caching and diff-based updates * * Features: * - Diff-based updates (send only changes) * - Automatic chunking for large files * - Syntax-aware truncation * - Cache integration with git awareness * - Token tracking and metrics */ import { CacheEngine } from '../../core/cache-engine.js'; import { TokenCounter } from '../../core/token-counter.js'; import { MetricsCollector } from '../../core/metrics.js'; export interface SmartReadOptions { enableCache?: boolean; ttl?: number; diffMode?: boolean; maxSize?: number; chunkSize?: number; preserveStructure?: boolean; includeMetadata?: boolean; encoding?: BufferEncoding; } export interface SmartReadResult { content: string; metadata: { path: string; size: number; encoding: string; fileType: string; hash: string; fromCache: boolean; isDiff: boolean; chunked: boolean; truncated: boolean; tokensSaved: number; tokenCount: number; originalTokenCount: number; compressionRatio: number; }; chunks?: string[]; diff?: { added: string[]; removed: string[]; unchanged: number; }; } export declare class SmartReadTool { private cache; private tokenCounter; private metrics; constructor(cache: CacheEngine, tokenCounter: TokenCounter, metrics: MetricsCollector); /** * Smart read with aggressive token optimization */ read(filePath: string, options?: SmartReadOptions): Promise; /** * Read a specific chunk from a chunked file */ readChunk(filePath: string, chunkIndex: number, chunkSize?: number): Promise; /** * Get file metadata without reading content (minimal tokens) */ getMetadata(filePath: string): Promise; } export declare function getSmartReadTool(cache: CacheEngine, tokenCounter: TokenCounter, metrics: MetricsCollector): SmartReadTool; /** * CLI function - Creates resources and uses factory */ export declare function runSmartRead(filePath: string, options?: SmartReadOptions): Promise; export declare const SMART_READ_TOOL_DEFINITION: { name: string; description: string; inputSchema: { type: string; properties: { path: { type: string; description: string; }; diffMode: { type: string; description: string; default: boolean; }; maxSize: { type: string; description: string; default: number; }; chunkSize: { type: string; description: string; default: number; }; chunkIndex: { type: string; description: string; }; }; required: string[]; }; }; //# sourceMappingURL=smart-read.d.ts.map