/** * Canvas helpers shared by the session bridge (session-proxy.ts) and the app * catalog (canvas-app-catalog.ts). Kept in their own module so the catalog * can be exercised without importing the whole bridge, and so the bridge and * the catalog can never disagree about slot names or revision derivation. * * The session canvas: one reserved artifact per session slot, drawn by the * agent with draw_canvas and rendered live in the portal. The revision is * derived from the durable session.canvas_updated event log, not a counter * column — see docs/proposals/session-canvas.md. */ export declare const CANVAS_ARTIFACT_FILENAME = "canvas.html"; /** Slot 1 keeps the historical name; 2-5 are canvas2.html .. canvas5.html. */ export declare function canvasArtifactFilename(slot: number): string; /** 1-5, defaulting absent to 1. Returns null for anything else. */ export declare function normalizeCanvasSlot(value: unknown): number | null; /** Event rows predate slots; a missing slot means slot 1. */ export declare function eventSlot(row: any): number; /** * Latest canvas draw's full data (rev + armed contract) from the durable * event log — the single authority. Reads a bounded window rather than * exactly one row and takes the max of the VALID revs it finds, so one * garbage event (rev missing, NaN, negative — injectable via * send_session_event, which validates nothing) cannot reset the sequence. * * No empty-coerce on failure: a transient read error that reads as "no * canvas" would mint rev 1 over a live rev-12 canvas. Callers route the * throw to a structured { error }. * * Window 30, not 5: five interleaved slots can push one slot's latest draw * well past a five-event window. The session_canvases table is the fast * path; this scan is the durable fallback. */ export declare function latestCanvasEventData(catalog: any, sessionId: string, slot?: number): Promise<{ rev: number; responseContract?: Record; }>; /** The current canvas revision: table first (migration 0045), event scan as the durable fallback. */ export declare function latestCanvasRev(catalog: any, sessionId: string, slot?: number): Promise; //# sourceMappingURL=canvas-support.d.ts.map