import type { Database, SessionActivityDatabase } from "./database.js"; export declare const SESSION_REALTIME_CONTEXT_MAX_BYTES = 65536; export declare const SESSION_REALTIME_TAIL_SOURCE = "transcript_tail_flush"; export declare const SESSION_REALTIME_TAIL_INSTRUCTION = "The user just ended the realtime voice session but remains reachable by text. Ending voice changes only the communication mode; it does not stop, pause, or complete existing work. Treat the remaining transcript tail as additional context. If work was already underway, continue it from the current state. Change or stop that work only if the user explicitly requested it. If nothing was underway and the transcript contains no unhandled request, acknowledge briefly; otherwise handle any unhandled request. Reply in the language the user spoke in the transcript, not the language of this note."; export type SessionRealtimeContextProjection = { id: string; workspaceId: string; sessionId: string; turnId: string; context: string | null; sourceModeCount: number; sourceEntryCount: number; includedEntryCount: number; omittedEntryCount: number; createdAt: string; }; export type SessionRealtimeContextSourceEntry = { id: string; realtimeId: string; sequence: number; role: string | null; text: string | null; payload: Record; }; export type SessionRealtimeContinuityEntry = { realtimeId: string; sequence: number; role: "user" | "assistant"; text: string; turnId: string; createdAt: string; }; /** Render the exact finalized tail after the latest provider delegation fence. */ export declare function renderSessionRealtimeTail(entries: readonly SessionRealtimeContextSourceEntry[]): { context: string | null; includedEntryCount: number; omittedEntryCount: number; }; /** * Codex-style end fence: route only finalized voice transcript after the last * delegation into the same canonical Steer-or-start path used by a human. */ export declare function flushSessionRealtimeTranscriptTailInTransaction(db: SessionActivityDatabase, input: { accountId: string; workspaceId: string; sessionId: string; realtimeId: string; ownerSubjectId: string; /** The owner's own label (their email) when a request carries it. */ ownerSubjectLabel?: string | null | undefined; now?: Date; }): Promise; export declare function listSessionRealtimeContinuityEntriesInTransaction(db: Database, input: { accountId: string; workspaceId: string; sessionId: string; maximumEntries?: number; }): Promise;