/** * TotalReclaw Client Library * * A TypeScript library for end-to-end encrypted memory operations. * * This library provides: * - End-to-end encryption of memories and embeddings * - LSH-based blind index search * - Client-side reranking with BM25 + RRF fusion * - Importance decay for memory lifecycle management * * @example * ```typescript * import { TotalReclaw } from '@totalreclaw/client'; * * const client = new TotalReclaw({ * serverUrl: 'http://127.0.0.1:8080', * }); * * // Register a new user * const userId = await client.register('my-secure-password'); * * // Store a memory * const factId = await client.remember('I prefer coffee over tea'); * * // Recall memories * const results = await client.recall('what do I like to drink?'); * ``` */ import { TotalReclawConfig, FactMetadata, RerankedResult, ExportedData } from './types'; /** * Main TotalReclaw Client * * Provides a high-level API for end-to-end encrypted memory operations. */ export declare class TotalReclaw { private config; private apiClient; private lshHasher; private embeddingModel; private bm25Scorer; private state; /** * Create a new TotalReclaw client * * @param config - Client configuration */ constructor(config: TotalReclawConfig); /** * Initialize the client * * Must be called before any other operations. */ init(): Promise; /** * Initialize LSH hasher from a mnemonic. * Must be called before remember() or recall() when using the mnemonic path. */ initLshFromMnemonic(mnemonic: string): void; /** * Initialize LSH hasher from a raw seed (Uint8Array). */ initLshFromSeed(seed: Uint8Array): void; /** * Register a new user with the server * * @param masterPassword - User's recovery phrase * @returns User ID */ register(masterPassword: string): Promise; /** * Login with existing credentials * * @param userId - User ID from previous registration * @param masterPassword - User's recovery phrase * @param salt - Salt from previous registration */ login(userId: string, masterPassword: string, salt: Buffer): Promise; /** * Store a new memory * * @param text - Memory text to store * @param metadata - Optional metadata * @returns Fact ID */ remember(text: string, metadata?: FactMetadata): Promise; /** * Search for memories * * @param query - Search query * @param k - Number of results to return (default: 8) * @returns Reranked search results */ recall(query: string, k?: number): Promise; /** * Delete a memory * * @param factId - Fact ID to delete */ forget(factId: string): Promise; /** * Export all data for portability * * Note: This requires fetching all facts from the server, * which may not be implemented in the PoC. * * @returns Exported data */ export(): Promise; /** * Get embedding for text */ private getEmbedding; /** * Decrypt search results */ private decryptResults; /** * Rerank search results using BM25 + cosine similarity + RRF */ private rerankResults; /** * Ensure client is ready for operations */ private ensureReady; /** * Get the current user ID */ getUserId(): string | null; /** * Get the salt (for export/backup) */ getSalt(): Buffer | null; /** * Check if the client is ready */ isReady(): boolean; } export { LSHConfig, DEFAULT_LSH_CONFIG, TotalReclawConfig, Fact, FactMetadata, EncryptedFact, EncryptedSearchResult, RerankedResult, ExportedData, RegisterRequest, RegisterResponse, StoreRequest, StoreResponse, SearchRequest, SearchResponse, TotalReclawError, TotalReclawErrorCode, } from './types'; export { deriveKeys, deriveAuthKey, deriveEncryptionKey, generateSalt, createAuthProof, verifyAuthProof, encrypt, decrypt, generateBlindIndices, generateTrapdoors, tokenize, sha256Hash, } from './crypto'; export type { KeyDerivationParams } from './crypto'; export * from './lsh'; export * from './embedding'; export * from './search'; export * from './api'; export default TotalReclaw; //# sourceMappingURL=index.d.ts.map