/** * smart_unfold — single symbol extraction from source files. * * Takes a file path + symbol name, parses the file via tree-sitter, * finds the matching symbol node, and extracts complete source including * JSDoc/docstring, decorators, and full body. AST node boundaries * guarantee no truncation. * * @task T153 */ import type { CodeSymbol } from '@cleocode/contracts'; /** Result of unfolding a single symbol. */ export interface SmartUnfoldResult { /** Whether the symbol was found. */ found: boolean; /** The matched symbol metadata. */ symbol?: CodeSymbol; /** Complete source text including JSDoc, decorators, and body. */ source: string; /** Start line (1-based, inclusive of leading doc comment). */ startLine: number; /** End line (1-based). */ endLine: number; /** Estimated token count for this extraction. */ estimatedTokens: number; /** File path (relative). */ filePath: string; /** Errors encountered. */ errors: string[]; } /** * Extract a symbol's complete source from a file. * * Finds the symbol by name (supports "Class.method" dot notation), * determines its full range including leading documentation, and * returns the exact source text. * * @param filePath - Absolute path to source file * @param symbolName - Symbol to extract (e.g. "parseFile" or "HttpTransport.connect") * @param projectRoot - Project root for relative path computation * @returns Unfold result with complete source text */ export declare function smartUnfold(filePath: string, symbolName: string, projectRoot?: string): SmartUnfoldResult; //# sourceMappingURL=unfold.d.ts.map