/** * @module memory/stream-buffer-store * @description Store for buffering stream events locally in SQLite. * * Premium stream events (Pyth price ticks, meme alerts, volatility signals) are * persisted locally so the agent can consume them without paid polls. Events * are deduplicated by (streamType, eventId) and consumed in FIFO order. */ import type { StreamBufferRecord } from './types.js'; /** * @name StreamBufferStore * @description Manages local stream event buffering with FIFO consumption. */ export declare class StreamBufferStore { /** * @name buffer * @description Buffers a stream event. Deduplicates by (streamType, eventId). * @param record - Event to buffer. * @returns The row ID, or -1 if the event was already buffered (dedup). */ buffer(record: Omit): number; /** * @name consume * @description Returns unconsumed events for a stream type and marks them consumed. * FIFO order (oldest first). Returns up to `limit` events. * @param streamType - Stream type to consume (e.g. 'pyth-price'). * @param limit - Maximum events to consume. Default 20. * @returns Consumed events. */ consume(streamType: string, limit?: number): StreamBufferRecord[]; /** * @name peek * @description Returns unconsumed events without marking them consumed. * Used for preview/inspection. */ peek(streamType: string, limit?: number): StreamBufferRecord[]; /** * @name replay * @description Returns all events (consumed + unconsumed) for a stream type * within a time range. Used for backtest/analysis. * @param streamType - Stream type to replay. * @param since - ISO 8601 timestamp. Events created after this time. * @param limit - Maximum events. Default 100. */ replay(streamType: string, since?: string, limit?: number): StreamBufferRecord[]; /** * @name pendingCount * @description Returns the number of unconsumed events. */ pendingCount(): number; /** * @name evict * @description Evicts old consumed events to keep the buffer bounded. * @param maxPerType - Maximum events per stream type. Default 10000. * @returns Number of events evicted. */ evict(maxPerType?: number): number; /** * @name clear * @description Clears all events for a stream type. */ clear(streamType: string): number; } /** * @name streamBufferStore * @description Singleton instance of the stream buffer store. */ export declare const streamBufferStore: StreamBufferStore; //# sourceMappingURL=stream-buffer-store.d.ts.map