import { z } from "zod"; import { type Database } from "./database.js"; import type { ModelCallFactReconciliation } from "./insights.js"; declare const Checkpoint: z.ZodObject<{ since: z.ZodString; until: z.ZodString; complete: z.ZodBoolean; phase: z.ZodEnum<{ events: "events"; ledger: "ledger"; }>; after: z.ZodNullable>; batchId: z.ZodNullable; turn: z.ZodNullable>; exhausted: z.ZodBoolean; batchId: z.ZodString; }, z.core.$strip>>; }, z.core.$strip>; export type ModelFactCheckpoint = z.infer; type UsageEvent = { id: string; accountId: string; workspaceId: string; sessionId: string; turnId: string | null; turnAttemptId: string | null; payload: unknown; occurredAt: Date; }; /** Advance bounded input pages, not an unbounded scan with bounded output. * A first historical sweep discovers old gaps. Commit-coupled triggers queue * subsequent ledger/event arrivals, including backdated commits. A bounded * claimed batch scans a turn's history, including legacy unkeyed events. * Progress, queue changes and repairs commit together. Failed or interrupted * pages replay safely; permanent gaps cannot starve later ledger rows. */ export declare function reconcileModelCallFactPage(db: Database, input: { workspaceId: string; since: Date; until: Date; limit?: number; signal?: AbortSignal; }, insertFact: (db: Database, workspaceId: string, event: UsageEvent) => Promise): Promise; export {};