import type { DatabaseSync } from "node:sqlite"; import { FSWatcher } from "chokidar"; import { ResolvedMemorySearchConfig } from "../agents/memory-search.js"; import { type BotConfig } from "../config/config.js"; import { type EmbeddingProvider, type GeminiEmbeddingClient, type MistralEmbeddingClient, type OllamaEmbeddingClient, type OpenAiEmbeddingClient, type VoyageEmbeddingClient } from "./embeddings.js"; import { type MemoryFileEntry } from "./internal.js"; import type { SessionFileEntry } from "./session-files.js"; import type { MemorySource, MemorySyncProgressUpdate } from "./types.js"; type MemoryIndexMeta = { model: string; provider: string; providerKey?: string; sources?: MemorySource[]; chunkTokens: number; chunkOverlap: number; vectorDims?: number; }; export declare abstract class MemoryManagerSyncOps { protected abstract readonly cfg: BotConfig; protected abstract readonly agentId: string; protected abstract readonly workspaceDir: string; protected abstract readonly settings: ResolvedMemorySearchConfig; protected provider: EmbeddingProvider | null; protected fallbackFrom?: "openai" | "local" | "gemini" | "voyage" | "mistral" | "ollama"; protected openAi?: OpenAiEmbeddingClient; protected gemini?: GeminiEmbeddingClient; protected voyage?: VoyageEmbeddingClient; protected mistral?: MistralEmbeddingClient; protected ollama?: OllamaEmbeddingClient; protected abstract batch: { enabled: boolean; wait: boolean; concurrency: number; pollIntervalMs: number; timeoutMs: number; }; protected readonly sources: Set; protected providerKey: string | null; protected abstract readonly vector: { enabled: boolean; available: boolean | null; extensionPath?: string; loadError?: string; dims?: number; }; protected readonly fts: { enabled: boolean; available: boolean; loadError?: string; }; protected vectorReady: Promise | null; protected watcher: FSWatcher | null; protected watchTimer: NodeJS.Timeout | null; protected sessionWatchTimer: NodeJS.Timeout | null; protected sessionUnsubscribe: (() => void) | null; protected fallbackReason?: string; protected intervalTimer: NodeJS.Timeout | null; protected closed: boolean; protected dirty: boolean; protected sessionsDirty: boolean; protected sessionsDirtyFiles: Set; protected sessionPendingFiles: Set; protected sessionDeltas: Map; private lastMetaSerialized; protected abstract readonly cache: { enabled: boolean; maxEntries?: number; }; protected abstract db: DatabaseSync; protected abstract computeProviderKey(): string; protected abstract sync(params?: { reason?: string; force?: boolean; progress?: (update: MemorySyncProgressUpdate) => void; }): Promise; protected abstract withTimeout(promise: Promise, timeoutMs: number, message: string): Promise; protected abstract getIndexConcurrency(): number; protected abstract pruneEmbeddingCacheIfNeeded(): void; protected abstract indexFile(entry: MemoryFileEntry | SessionFileEntry, options: { source: MemorySource; content?: string; }): Promise; protected ensureVectorReady(dimensions?: number): Promise; private loadVectorExtension; private ensureVectorTable; private dropVectorTable; protected buildSourceFilter(alias?: string): { sql: string; params: MemorySource[]; }; protected openDatabase(): DatabaseSync; private openDatabaseAtPath; private seedEmbeddingCache; private swapIndexFiles; private moveIndexFiles; private removeIndexFiles; protected ensureSchema(): void; protected ensureWatcher(): void; protected ensureSessionListener(): void; private scheduleSessionDirty; private processSessionDeltaBatch; private updateSessionDelta; private countNewlines; private resetSessionDelta; private isSessionFileForAgent; protected ensureIntervalSync(): void; private scheduleWatchSync; private shouldSyncSessions; private syncMemoryFiles; private syncSessionFiles; private createSyncProgress; protected runSync(params?: { reason?: string; force?: boolean; progress?: (update: MemorySyncProgressUpdate) => void; }): Promise; private shouldFallbackOnError; protected resolveBatchConfig(): { enabled: boolean; wait: boolean; concurrency: number; pollIntervalMs: number; timeoutMs: number; }; private activateFallbackProvider; private runSafeReindex; private runUnsafeReindex; private resetIndex; protected readMeta(): MemoryIndexMeta | null; protected writeMeta(meta: MemoryIndexMeta): void; private resolveConfiguredSourcesForMeta; private normalizeMetaSources; private metaSourcesDiffer; } export {};