/** * [WHO]: extractAtMentionedFiles — @-mention file reference parser for user input * [FROM]: Depends on node:fs, node:path for file reading and path resolution * [TO]: Consumed by controllers/input-submit-controller.ts (idle + streaming submit paths) * [HERE]: modes/interactive/at-mentions.ts — input @-mention processing per CC §XI * * Parses @filename and @file:line-range syntax from user input, reads referenced * files, and returns cleaned text + file content attachments for LLM context. */ /** * A single @-mention reference parsed from user input. */ export interface AtMention { /** The file path referenced (relative or absolute) */ path: string; /** Start line (1-indexed, inclusive). Undefined = entire file. */ offset?: number; /** End line (1-indexed, inclusive). Undefined = to end of file (or just offset line). */ limit?: number; /** The full match string (e.g. "@src/foo.ts:10-20") */ raw: string; } /** * Result of extracting @-mentions from user input. */ export interface AtMentionResult { /** Text with @-mentions replaced by [file: name] references */ text: string; /** Successfully read file contents as context blocks */ mentions: Array<{ /** File path (for display) */ path: string; /** Line range description (e.g. "lines 10-20" or "entire file") */ range: string; /** File content */ content: string; /** Start line (1-indexed) */ startLine?: number; /** End line (1-indexed) */ endLine?: number; }>; } /** * Extract @-mentioned files from user input text. * * @param text User input text * @param cwd Current working directory (for resolving relative paths) * @returns Cleaned text and file content attachments */ export declare function extractAtMentionedFiles(text: string, cwd: string): AtMentionResult; /** * Build a context block string from extracted @-mentions. * This is injected into the prompt as additional context. */ export declare function buildAtMentionContext(mentions: AtMentionResult["mentions"]): string;