// engine/compact/state-store.ts — SPEC-922: Per-clientId hysteresis state (bounded LRU)
const MAX_ENTRIES = 1000;
const stateMap = new Map();
export class CompactStateStore {
    get(clientId) {
        return stateMap.get(clientId);
    }
    set(clientId, mode) {
        // Evict oldest if at capacity
        if (stateMap.size >= MAX_ENTRIES && !stateMap.has(clientId)) {
            const firstKey = stateMap.keys().next().value;
            if (firstKey !== undefined) {
                stateMap.delete(firstKey);
            }
        }
        stateMap.set(clientId, mode);
    }
}
/** Singleton store instance used across the process. */
export const globalCompactStateStore = new CompactStateStore();
//# sourceMappingURL=state-store.js.map