/** * JsonCortexStore — file-backed CortexStore implementation. * * Loads on construct, holds the entire dataset in memory, persists on every * write (atomic via temp-file + rename). Intended for backup, restore, and * the round-trip migration tests — not production scale. * * Vector search is the same brute-force cosine as SqliteCortexStore. */ import type { CortexStore, StoreCapabilities } from '../core/store.js'; import type { Memory, Observation, Edge, OpsEntry, OpsFilters, Signal, BeliefEntry, SearchResult, FSRSData, QueryFilter } from '../core/types.js'; export declare class JsonCortexStore implements CortexStore { private readonly path; private readonly ns; private data; constructor(filePath: string, namespace?: string); private load; /** Atomic write: serialize → write to temp → rename over the target. */ private persistRaw; private persist; putMemory(memory: Omit): Promise; getMemory(id: string): Promise; updateMemory(id: string, updates: Partial>): Promise; findNearest(embedding: number[], limit: number): Promise; touchMemory(id: string, fsrsUpdates: Partial): Promise; getAllMemories(): Promise; getRecentMemories(days: number, limit: number): Promise; putObservation(obs: Omit): Promise; getUnprocessedObservations(limit: number): Promise; markObservationProcessed(id: string): Promise; putEdge(edge: Omit): Promise; getEdgesFrom(memoryId: string): Promise; getEdgesForMemories(memoryIds: string[]): Promise; appendOps(entry: Omit): Promise; queryOps(filters: OpsFilters): Promise; updateOps(id: string, updates: Partial>): Promise; putSignal(signal: Omit): Promise; putBelief(entry: Omit): Promise; getBeliefHistory(conceptId: string): Promise; put(collection: string, doc: Record): Promise; get(collection: string, id: string): Promise | null>; update(collection: string, id: string, updates: Record): Promise; query(collection: string, filters: QueryFilter[], options?: { limit?: number; orderBy?: string; orderDir?: 'asc' | 'desc'; }): Promise[]>; countDocuments(collection: string, filters?: QueryFilter[]): Promise; delete(collection: string, id: string): Promise; withTransaction(fn: (txn: CortexStore) => Promise): Promise; upsertMemory(memory: Memory): Promise; upsertObservation(obs: Observation): Promise; upsertEdge(edge: Edge): Promise; upsertOpsEntry(entry: OpsEntry): Promise; upsertSignal(signal: Signal): Promise; upsertBelief(belief: BeliefEntry): Promise; getCapabilities(): Promise; /** Snapshot all entities of a given kind. The returned arrays are deep clones. */ listAllSignals(): Signal[]; listAllBeliefs(): BeliefEntry[]; listAllObservations(): Observation[]; listAllEdges(): Edge[]; listAllOps(): OpsEntry[]; /** Returns `{ collection: { id: doc } }` snapshot of the generic bucket. */ snapshotGeneric(): Record>>; } //# sourceMappingURL=json.d.ts.map