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

53 lines 1.9 kB
/** * @file Responsible for discovering all relevant files within a project directory, * respecting `.gitignore` rules. It supports incremental indexing by identifying * files that have changed since a last known state. */ import { ConfigManager } from '../config'; /** * Manages file discovery within a given project. */ export declare class FileScanner { private projectRoot; private config; private logger; /** * @param {string} projectRoot - The absolute path to the root of the project. * @param {ConfigManager} config - Configuration manager instance. */ constructor(projectRoot: string, config: ConfigManager); /** * Reads the .gitignore file and converts its patterns into glob-compatible ignore rules. * @returns {Promise<string[]>} A promise that resolves to an array of .gitignore patterns. */ private getGitIgnorePatterns; /** * Filters files based on size limits and other criteria. * @param {string[]} files - Array of file paths to filter. * @returns {Promise<string[]>} Filtered array of file paths. */ private filterFiles; findAllFiles(patterns: string[], changedFiles?: string[]): Promise<FileMetadata[]>; /** * Gets file statistics for the project. * @returns {Promise<{totalFiles: number, totalSize: number, filesByExtension: Record<string, number>}>} */ getFileStats(): Promise<{ totalFiles: number; totalSize: number; filesByExtension: Record<string, number>; }>; private getFileMetadata; private detectLanguage; private classifyFileType; } export interface FileMetadata { path: string; name: string; extension: string; language: string; sizeKb: number; contentHash: string; fileType: 'source' | 'test' | 'config' | 'dev' | 'vendor'; } //# sourceMappingURL=file-scanner.d.ts.map