import type { ASTChunk } from './types.js'; export interface ASTChunkOptions { minChunkSize?: number; /** * Absolute path to the workspace/monorepo root. When provided (and the * root has an npm `workspaces` field), bare package specifiers that name a * sibling workspace package (e.g. `@scope/pkg`) are resolved to that * package's source entry file, so cross-package imports participate in * dependency analysis. Omit for non-monorepo projects — behavior is * unchanged. */ workspaceRoot?: string; } /** * Chunk a file using AST-based semantic boundaries * * Uses Tree-sitter to parse code into an AST and extract semantic chunks * (functions, classes, methods) that respect code structure. * * **Known Limitations:** * - Tree-sitter may fail with "Invalid argument" error on very large files (1000+ lines) * - When this occurs, Lien automatically falls back to line-based chunking * - Configure fallback behavior via `chunking.astFallback` ('line-based' or 'error') * * @param filepath - Path to the file * @param content - File content * @param options - Chunking options * @returns Array of AST-aware chunks * @throws Error if AST parsing fails and astFallback is 'error' */ export declare function chunkByAST(filepath: string, content: string, options?: ASTChunkOptions): ASTChunk[]; /** * Check if AST chunking should be used for a file */ export declare function shouldUseAST(filepath: string): boolean; //# sourceMappingURL=chunker.d.ts.map