import type { Database } from "./database"; /** Classification of entity types in the knowledge graph. */ export type EntityType = "technology" | "library" | "pattern" | "concept" | "file" | "person" | "project" | "other"; /** A node in the knowledge graph representing a named concept or artifact. */ export interface Entity { id: string; name: string; entityType: EntityType; firstSeenAt: string; lastSeenAt: string; mentionCount: number; } /** A directed edge between two entities in the knowledge graph. */ export interface EntityRelation { id: string; sourceEntityId: string; targetEntityId: string; relationship: string; observationId: string; createdAt: string; } /** Repository for managing the entity knowledge graph (nodes, relations, observation links). */ export declare class EntityRepository { private db; constructor(db: Database); /** Insert or update an entity, incrementing its mention count if it already exists. */ upsertEntity(name: string, entityType: EntityType): Entity; /** Create a directed relation between two entities, ignoring duplicates. */ createRelation(sourceEntityId: string, targetEntityId: string, relationship: string, observationId: string): EntityRelation | null; /** Link an entity to an observation via the junction table. */ linkObservation(entityId: string, observationId: string): void; /** Find entities by name using FTS5 full-text search. */ findByName(name: string): Entity[]; /** Get all relations where the entity is either source or target. */ getRelationsFor(entityId: string): EntityRelation[]; /** BFS traversal of entity relations up to the given depth (max 2). */ traverseRelations(entityId: string, depth?: number): Set; /** Get all observation IDs linked to an entity. */ getObservationsForEntity(entityId: string): string[]; /** Get an entity by its unique ID. */ getById(id: string): Entity | null; private mapEntityRow; private mapRelationRow; } //# sourceMappingURL=entities.d.ts.map