import type { EvaluationPayload } from "./types"; export type LkgEntry = { /** Meta.generation stamped on the cached payload (0 if unversioned). */ generation: number; payload: EvaluationPayload; }; /** * Cache key for a (workspace+environment, context) pair. The frontend SDK key * is the client-side proxy for workspace+environment (the server resolves both * from it), and `contextSig` (encodeContexts) carries the evaluated context, so * `${sdkKey}:${contextSig}` is exactly the dimension along which an * eval-with-context response is unique — the same keying the per-URL ETag cache * uses, minus the host (LKG must be primary/secondary-agnostic). */ export declare function lkgKey(sdkKey: string, contextSig: string): string; /** Read the cached entry for `key`, or undefined if absent/unreadable/corrupt. */ export declare function readLkg(key: string): LkgEntry | undefined; /** * Persist `entry` as the last-known-good for `key`. Best-effort: a thrown quota * or serialization error is swallowed. Callers persist only what the client * actually installed (post reject-older guard), so the per-context entry is * already monotonic — an older live response is dropped by the guard before it * ever reaches here, satisfying "the watermark rule applies to the cache too". */ export declare function writeLkg(key: string, entry: LkgEntry): void;