import type { EmbeddingProvider } from "./embeddings.js"; import type { LinkRecord, MemoryRecord, ParsedMemory, ProjectRecord } from "./types.js"; export declare class AugmentDatabase { private databasePath; private client; constructor(databasePath: string); setDatabasePath(databasePath: string): void; init(): Promise; private migrateColumn; close(): void; /** * Read a PRAGMA on the live connection (diagnostics/tests). busy_timeout and * foreign_keys are per-connection and don't persist to the file, so they can * only be observed on this exact connection, not via a second client. */ pragma(name: string): Promise; upsertProject(name: string, source?: string): Promise; listProjects(name?: string): Promise; getProjectById(id: number): Promise; getProjectByName(name: string): Promise; upsertMemory(memory: ParsedMemory): Promise; deleteMemory(id: number): Promise; deleteMemoryByPath(relativePath: string): Promise; /** relative_path → stored file mtime (ms), for change detection without reading file bodies. */ listMemoryFileStats(): Promise>; removeMissingMemories(relativePaths: string[]): Promise; rebuildLinks(): Promise; getMemoryById(id: number): Promise; getMemoryByPath(relativePath: string): Promise; listMemories(): Promise; listMemoriesForProject(projectId: number, kind?: string): Promise; listLinks(memoryId: number): Promise; getLinkById(id: number): Promise; getAllLinks(): Promise; getEmbedding(memoryId: number): Promise<{ vector: number[]; embeddedHash: string; } | undefined>; getAllEmbeddings(): Promise>; upsertEmbedding(memory: ParsedMemory | MemoryRecord, provider: EmbeddingProvider, vector: number[]): Promise; embeddingText(memory: ParsedMemory | MemoryRecord): string; /** * Incremental link maintenance for one re-indexed memory: replaces its outbound links from its * frontmatter, then materializes inbound links other memories declare toward its path (they may * have been dangling if this file was just created). Equivalent to {@link rebuildLinks} for the * subgraph touching this memory, without paying the full O(memories × links) sweep. */ rebuildLinksForMemory(memory: MemoryRecord): Promise; private execute; private batch; /** Parameterized statements in one transaction: one commit, all-or-nothing. */ private batchExecute; private getClient; }