UNPKG

hikma-engine

Version:

Code Knowledge Graph Indexer - A sophisticated TypeScript-based indexer that transforms Git repositories into multi-dimensional knowledge stores for AI agents

89 lines 2.57 kB
/** * @file Result enhancement service for adding context and metadata to search results. * Provides syntax highlighting, breadcrumbs, and related information. */ import { SearchResult } from '../../modules/search-service'; import { SQLiteClient } from '../../persistence/db-clients'; /** * Enhanced search result with additional context. */ export interface EnhancedSearchResult extends SearchResult { context?: { filePath?: string; fileName?: string; breadcrumbs?: string[]; beforeLines?: string[]; afterLines?: string[]; relatedFiles?: string[]; syntaxHighlighted?: string; }; metadata?: { language?: string; author?: string; lastModified?: string; fileSize?: number; lineCount?: number; }; } /** * Enhancement options. */ interface EnhancementOptions { includeSyntaxHighlighting?: boolean; includeContext?: boolean; includeRelatedFiles?: boolean; contextLines?: number; } /** * Service for enhancing search results with additional context and metadata. */ export declare class ResultEnhancerService { private sqliteClient; constructor(sqliteClient: SQLiteClient); /** * Enhances an array of search results. */ enhanceResults(results: SearchResult[], options?: EnhancementOptions, query?: string): Promise<EnhancedSearchResult[]>; /** * Enhances a single search result with advanced features. */ private enhanceResult; /** * Adds file context including breadcrumbs and surrounding lines. */ private addFileContext; /** * Adds metadata about the file and node. */ private addMetadata; /** * Generates breadcrumb navigation for a file path. */ private generateBreadcrumbs; /** * Gets code context (surrounding lines) for a code node. */ private getCodeContext; /** * Finds files related to the current result. */ private findRelatedFiles; /** * Adds relevance scoring explanation to results. */ private addRelevanceExplanation; /** * Improves syntax highlighting with better language detection and highlighting. */ private addAdvancedSyntaxHighlighting; /** * Gets advanced highlighting rules for different languages. */ private getAdvancedHighlightingRules; /** * Enhanced method to find related files with better algorithms. */ private findAdvancedRelatedFiles; } export {}; //# sourceMappingURL=result-enhancer.d.ts.map