/** * Keyword Extraction Service * * Pure domain service for extracting keywords from code. * No external dependencies - operates only on string data. */ /** * Common programming keywords to exclude from keyword extraction. * These appear in almost every code file and don't add search value. */ export declare const COMMON_KEYWORDS: Set; /** * Common architectural layer patterns in file names/paths. * Used to detect the layer a file belongs to. */ export declare const LAYER_PATTERNS: Record; /** * Extract keywords from code content and optional name. * * @param content - Code content to extract keywords from * @param name - Optional name (function name, class name, etc.) * @param maxKeywords - Maximum keywords to return (default: 50) * @returns Array of unique lowercase keywords */ export declare function extractKeywords(content: string, name?: string, maxKeywords?: number): string[]; /** * Extract keywords from a file path. * * Enhanced extraction that: * - Splits camelCase/PascalCase filenames * - Extracts directory segments * - Recognizes common patterns (Service, Controller, etc.) * * @param filepath - File path to extract keywords from * @returns Array of keywords from path segments */ export declare function extractPathKeywords(filepath: string): string[]; /** * Path context information extracted from a file path. */ export interface PathContext { /** Directory segments (excluding filename) */ segments: string[]; /** Detected architectural layer (service, controller, repository, etc.) */ layer?: string; /** Detected feature domain (auth, users, payments, etc.) */ domain?: string; /** Path depth (number of directory levels) */ depth: number; /** Keywords extracted from the path */ keywords: string[]; } /** * Parse a file path and extract structural context. * * This helps with: * - Boosting files in related directories * - Understanding architectural layer * - Grouping by feature domain * * @param filepath - File path to parse * @returns Parsed path context */ export declare function parsePathContext(filepath: string): PathContext; /** * Generate a path context string for embedding. * This is prepended to content to give the embedding model path awareness. * * @param pathContext - Parsed path context * @returns A string representation of the path context */ export declare function formatPathContextForEmbedding(pathContext: PathContext): string;