import { KGEntity, KGRelation, KGGraph, PageRankResult } from '../types.js'; /** * Knowledge Graph — maps your entire codebase as a living graph. * * Entity extraction: Parse source files for functions, classes, interfaces, * modules, variables (exported only). * * Relations: calls, imports, extends, implements, uses, tests * * PageRank: Damping factor 0.85, convergence < 0.0001, max 100 iterations. * Result: normalized score 0-1 for each entity. * * Use cases: * - Most critical functions to test (high PageRank) * - Orphan code (zero in-degree, zero PageRank) * - Circular dependency detection (cycles) * - Impact analysis: what breaks if X changes? */ export declare class KnowledgeGraph { private graph; private projectDir; constructor(projectDir: string); /** Build the knowledge graph from project source files */ build(): Promise; /** Add a single entity */ addEntity(entity: KGEntity): void; /** Add a relation */ addRelation(relation: KGRelation): void; /** Extract code entities from source file content */ private extractEntities; /** Extract relations between entities based on imports, calls, etc. */ private extractRelations; /** * Compute PageRank scores for all entities. * Damping factor: 0.85, convergence: < 0.0001, max iterations: 100. */ pageRank(iterations?: number): PageRankResult; /** Get top-N most important entities by PageRank */ getTopEntities(topN?: number): KGEntity[]; /** Find entities impacted by a change to the given entity */ getImpactedBy(entityId: string): KGEntity[]; private findDownstream; /** Find circular dependencies */ findCycles(): string[][]; /** Get graph statistics */ getStats(): { entities: number; relations: number; avgPageRank: number; orphanCount: number; }; private findSourceFiles; private saveToDisk; private loadFromDisk; } //# sourceMappingURL=knowledge-graph.d.ts.map