export type EntityType = "person" | "project" | "repo" | "file" | "tool" | "channel" | "account" | "concept"; export type Entity = { id: number; name: string; type: EntityType; firstSeenMs: number; lastSeenMs: number; mentionCount: number; }; /** Upsert an entity. Returns its id. Best-effort; returns 0 on any error. */ export declare function upsertEntity(name: string, type: EntityType): number; /** Add a relation between two existing entities. Best-effort. */ export declare function addEdge(params: { subjectId: number; predicate: string; objectId: number; weight?: number; }): void; /** * Look up entities matched by name (LIKE). Used by the prompt-builder when * a user message contains likely entity references. */ export declare function findEntities(name: string, limit?: number): Entity[]; /** Get edges where the entity is subject. */ export declare function getOutgoingEdges(subjectId: number, limit?: number): Array<{ predicate: string; object: Entity; weight: number; }>; /** * Extract entities from a free-form message and persist them. Returns the * count of entities upserted. Cheap and synchronous; safe to call on every * inbound user message. */ export declare function observeMessageForGraph(message: string): number; /** Build a short prompt section listing graph hits relevant to the message. */ export declare function buildPersonalGraphSection(message: string): string; /** Test/maintenance helper. Closes the connection so the file can be removed. */ export declare function closeGraphDb(): void;