import type { AgentMessage } from '@earendil-works/pi-agent-core'; import type { MediaRef } from '../../media/types.js'; import type { CompactionBoundarySummary } from '../../session/types.js'; import { type TranscriptStoredRow, type XopcTranscriptCompactionEntry } from '../../session/session-context-for-llm.js'; import { type TranscriptEntryRow } from './row-mappers.js'; export interface TranscriptSourceEntry { entryId: string; seq: number; createdAt: number; row: TranscriptStoredRow; } export interface CompactionSourceSnapshot { fingerprint?: string; transcriptId: string; lastSeq: number; entries: TranscriptSourceEntry[]; } export interface SessionTranscriptRecallMatch { entryId: string; seq: number; role: string | null; createdAt: number; content: string; } export declare function appendTranscriptEntry(conversationId: string, row: TranscriptStoredRow, opts?: { transcriptId?: string; tokenDelta?: number; }): TranscriptEntryRow; export declare function appendCompactionBoundaryIfUnchanged(conversationId: string, expected: Pick & { fingerprint?: string; }, row: Omit): TranscriptEntryRow | null; export declare function loadCompactionSourceSnapshot(conversationId: string): CompactionSourceSnapshot | null; export declare function searchSessionTranscript(conversationId: string, query: string, options?: { limit?: number; beforeSeq?: number; }): SessionTranscriptRecallMatch[]; export declare function loadTranscriptRowsForSession(conversationId: string): TranscriptStoredRow[]; export declare function loadTranscriptHistoryRowsForSession(conversationId: string): TranscriptStoredRow[]; export declare function loadTranscriptRows(transcriptId: string): TranscriptStoredRow[]; export declare function loadLlmMessagesForSession(conversationId: string): AgentMessage[]; export declare function findLatestAssistantTranscriptEntryId(conversationId: string): string | null; /** Attach generated media to one exact assistant row without rewriting the transcript. */ export declare function appendMediaToAssistantTranscriptEntry(conversationId: string, entryId: string, media: MediaRef): boolean; export declare function replaceTranscriptRows(conversationId: string, rows: TranscriptStoredRow[]): void; export declare function paginateTranscriptMessages(conversationId: string, options?: { offset?: number; limit?: number; beforeIndex?: number; includeContext?: boolean; /** Include reset/rollover transcripts for read-only conversation history. */ includeArchived?: boolean; /** Count user turns rather than diagnostic rows for compact chat history. */ userTurns?: boolean; }): { rows: TranscriptStoredRow[]; messages: AgentMessage[]; total: number; startSeq: number; endSeq: number; revision: number; }; export declare function listCompactionBoundaries(conversationId: string): CompactionBoundarySummary[]; export declare function restoreBeforeCompactionBoundary(conversationId: string, compactionId: string): void;