import { type SessionTurn, type TurnUsage } from "@opengeni/contracts"; import { type Database } from "./database.js"; /** * A terminal turn event's payload without the `usage` migration 1497 attaches * when the event is written. `usage` is accounting metadata, not content: * code that proves a copy of an event's content (for example a child's final * answer quoted to its parent) compares this projection. */ export declare function terminalTurnContentPayload(type: string, payload: unknown): unknown; /** * Each turn's `usage` from its latest terminal event (written there by * migration 1497's trigger), in one read of the session_events * (workspace_id, turn_id, type) index. A turn without one (still running, or * from before the field existed) maps to null. Runs inside the caller's * workspace scope. */ export declare function turnUsageByTurn(scopedDb: Pick, workspaceId: string, turnIds: readonly string[]): Promise>; /** The turns with `usage` filled from their terminal events. */ export declare function withTurnUsage(scopedDb: Pick, workspaceId: string, turns: SessionTurn[]): Promise;