/** * Episode CRUD operations for the memory system. * * Extracted from memory.ts — episodic memory layer. */ import type { Database } from "./schema.js"; export interface Episode { episodeId: string; sessionId: string; threadId: number; timestamp: string; type: "operator_message" | "agent_action" | "system_event" | "operator_reaction"; modality: "text" | "voice" | "photo" | "video_note" | "document" | "mixed" | "reaction"; content: Record; topicTags: string[]; importance: number; consolidated: boolean; accessedCount: number; lastAccessed: string | null; createdAt: string; } export declare function rowToEpisode(row: Record): Episode; export declare function saveEpisode(db: Database, episode: { sessionId: string; threadId: number; type: "operator_message" | "agent_action" | "system_event" | "operator_reaction"; modality: "text" | "voice" | "photo" | "video_note" | "document" | "mixed" | "reaction"; content: Record; topicTags?: string[]; importance?: number; }): string; export declare function getRecentEpisodes(db: Database, threadId: number, limit?: number, options?: { startTime?: string; endTime?: string; since?: string; }): Episode[]; /** * Chronological dump of ALL episodes in a time window, oldest → newest. * * Unlike getRecentEpisodes (which orders newest-first for "what happened * lately" reads), this returns events in the order they occurred so a caller * can reconstruct a conversation timeline. No query/keyword filtering — every * episode in [startTime, endTime] is returned up to `limit`. */ export declare function getEpisodesInRange(db: Database, threadId: number, options?: { startTime?: string; endTime?: string; limit?: number; }): Episode[]; export declare function getUnconsolidatedEpisodes(db: Database, threadId: number, limit?: number): Episode[]; /** * Fire-and-forget episode save for agent actions (voice, progress reports). * Wraps saveEpisode in a try/catch and logs failures instead of throwing. */ export declare function saveAgentEpisodeSafe(getMemoryDb: () => Database, params: { sessionStartedAt: number; threadId: number; modality: "text" | "voice"; text: string; }): void; export declare function markConsolidated(db: Database, episodeIds: string[]): void; //# sourceMappingURL=episodes.d.ts.map