/** * Copyright (c) 2026 Tran Huu Canh (0xTh3OKrypt) * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import Database from "better-sqlite3"; export interface Memory { id: number; content: string; embedding: Buffer | null; scope: "global" | "repo"; repo_id: string | null; tags: string[] | null; created_at: string; updated_at: string; } export interface MemorySearchResult extends Memory { rank: number; } export declare function isVecEnabled(): boolean; export declare function splitIntoChunks(text: string): string[]; export declare function getDb(): Database.Database; export declare function reinitializeVecIndex(): void; export declare function insertMemory(content: string, scope: "global" | "repo", repoId: string | null, tags: string[] | null, chunkEmbeddings?: Buffer[]): number; export declare function updateMemory(id: number, content: string, tags?: string[] | null, chunkEmbeddings?: Buffer[]): boolean; export declare function deleteMemory(id: number): boolean; export declare function listMemories(scope: "global" | "repo" | undefined, repoId: string | null, limit?: number): Memory[]; export declare function searchByKeyword(query: string, scope: "global" | "repo" | "all" | undefined, repoId: string | null, limit?: number): MemorySearchResult[]; export interface VecSearchResult { id: number; distance: number; } export declare function vectorSearch(queryEmbedding: Buffer, scope: "global" | "repo" | "all" | undefined, repoId: string | null, limit: number): VecSearchResult[]; export declare function getMemoryById(id: number): Memory | undefined; export interface MemoryTextRow { id: number; content: string; } export declare function getAllMemoryTexts(): MemoryTextRow[]; export declare function updateChunksForMemory(id: number, chunkEmbeddings: Buffer[]): void; //# sourceMappingURL=database.d.ts.map