import type { Store, StoreIndexOptions, StoreItem, StoreNamespace, StorePutOptions, StoreSearchOptions } from '../types/store.js'; export { cosine, matches, readPath, textOf } from './helpers.js'; /** Options for the in-memory store. */ export interface MemoryStoreOptions { /** Enables semantic search by embedding indexed fields on write. */ index?: StoreIndexOptions; /** Items kept before the least recently written one is dropped. Defaults to 10,000. */ maxItems?: number; /** Replaces the system clock, for tests. */ now?: () => Date; } /** * In-process long-term memory. * * Enough for a single process, for tests, and for development; `RedisStore` and `PostgresStore` * carry the same contract across processes. Bounded like the graph's memory checkpointer, because a * store that only grows is a leak with a friendly name. */ export declare class MemoryStore implements Store { private readonly options; private readonly items; private readonly maxItems; private readonly now; constructor(options?: MemoryStoreOptions); /** Stores an item, keeping its original `createdAt` when it replaces one. */ put(namespace: StoreNamespace, key: string, value: V, options?: StorePutOptions): Promise; /** Reads an item, or `undefined` when it does not exist or has expired. */ get(namespace: StoreNamespace, key: string): StoreItem | undefined; /** Deletes an item. */ delete(namespace: StoreNamespace, key: string): void; /** * Items under a namespace prefix, newest first, or ranked by similarity when a query is given. * Defaults to 20. */ search(namespacePrefix: StoreNamespace, options?: StoreSearchOptions): Promise>>; /** Namespaces under a prefix. Defaults to 100. */ listNamespaces(options?: { prefix?: StoreNamespace; limit?: number; }): string[][]; /** Items currently held, expired ones excluded. */ size(): number; private embed; private expired; private sweep; }