export type CanvasResource = { /** Opaque URI, e.g. `canvas://session/koi:main:main/checklist`. */ uri: string; /** Monotonic per-URI version — increments on every mutation. */ revision: number; /** Monotonic per-session turn counter — shared across URIs in a session. */ turnSeq: number; /** Resource content. Schema is per-URI-type, opaque to the registry. */ content: unknown; /** Wall-clock ms of last update. */ updatedAt: number; }; export type CanvasChangeListener = (resource: CanvasResource) => void; export declare function parseCanvasUri(uri: string): { sessionKey: string; relPath: string; } | null; export declare function canvasUri(sessionKey: string, relPath: string): string; export declare function hydrateSessionFromDisk(sessionKey: string): void; /** Get current state for a URI, or null if not set. */ export declare function getCanvasResource(uri: string): CanvasResource | null; /** List every URI currently tracked for a session. */ export declare function listCanvasUris(sessionKey: string): string[]; /** * Replace the content at a URI with a new full snapshot. Bumps revision. * Optionally bumps turnSeq for the session (callers that want the new * content to participate in a fresh turn consistency group). * * This is the Phase A0 primitive — full replacement. Patch-op support * lands in Phase B for concurrent writers (multi-sub-koi fleet). */ export declare function replaceCanvasResource(uri: string, content: unknown, opts?: { newTurn?: boolean; }): CanvasResource; /** Clear a URI. Emits a delete-like notification as revision++ with null content. */ export declare function deleteCanvasResource(uri: string): void; /** * Clear every resource for a session. Used on session reset/clearChat. */ export declare function clearSessionCanvas(sessionKey: string): void; /** * Subscribe to every canvas mutation in the process. Used by the gateway * to fan out `canvas:updated` notifications to interested clients. */ export declare function onCanvasChange(listener: CanvasChangeListener): () => void; export declare function resetCanvasRegistryForTest(): void;