import type { Database } from "./database.js"; /** * What the voice model hears when a delegated turn finished without any * answer text. An empty result reads as "done" with nothing to relay, and the * voice model then makes an outcome up, so the absence is stated explicitly. */ export declare const REALTIME_DELEGATION_NO_ANSWER_TEXT = "The work finished without a reply. No result or outcome was reported."; export type ProjectSessionRealtimeDelegationTerminalInput = { accountId: string; workspaceId: string; sessionId: string; turnId: string; turnStatus: "completed" | "failed" | "cancelled" | "superseded"; terminalEvent: { id: string | null; type: "turn.completed" | "turn.failed" | "turn.cancelled" | "turn.superseded"; payload: Record; }; retainedOutputEvidence?: unknown; now?: Date; }; export type SessionRealtimeTerminalEntry = { id: string; realtimeId: string; operationId: string; connectionEpoch: number; sequence: number; direction: "provider_in" | "provider_out"; kind: "user_transcript" | "assistant_transcript" | "delegation_call" | "delegation_progress" | "delegation_result" | "interruption" | "session_update" | "error"; role: "user" | "assistant" | null; providerEventId: string | null; delegationItemId: string | null; sourceUpdateId: string | null; historyItemId: string | null; turnId: string | null; text: string | null; payload: Record; clientAckedAt: string | null; providerAckedAt: string | null; createdAt: string; updatedAt: string; }; export type ProjectSessionRealtimeDelegationTerminalResult = { entry: SessionRealtimeTerminalEntry; replay: boolean; } | null; export declare function buildSessionRealtimeDelegationTerminalProjection(input: ProjectSessionRealtimeDelegationTerminalInput): { kind: "delegation_result" | "error"; text: string; payload: Record; }; /** One terminal projection for every realtime-delegated durable turn. */ export declare function projectSessionRealtimeDelegationTerminalInTransaction(db: Database, input: ProjectSessionRealtimeDelegationTerminalInput): Promise;