/** * Slot registry — assigns each agent a unique numId-namespace slot. * * Multi-writer termlog partitions the uint32 numId space across agents so that * two agents adding documents concurrently never produce colliding numIds. * Slots are persisted in `slots.json`: * * { version: 1, slots: { "": , ... } } * * `slotIndex` is a non-negative integer in [0, MAX_SLOTS). Each slot owns the * uint32 range `[slotIndex * SLOT_SIZE, (slotIndex + 1) * SLOT_SIZE)`. * * Constants: * - SLOT_BITS = 12 → 4096 distinct agents per index * - LOCAL_BITS = 20 → 1,048,576 docs per agent * * The registry uses an O_EXCL-based critical section (`slots.json.lock`) so * concurrent first-time openers don't double-allocate the same slot. */ export declare const SLOT_BITS = 12; export declare const LOCAL_BITS: number; export declare const MAX_SLOTS: number; export declare const SLOT_SIZE: number; export declare class SlotRegistryError extends Error { constructor(message: string); } /** Compute the inclusive lower / exclusive upper bound of numIds for a slot. */ export declare function slotRange(slot: number): { min: number; maxExclusive: number; }; /** * Read the slot for `agentId` from `slots.json`, allocating a new one if * absent. Atomic via O_EXCL on `slots.json.lock`. * * Returns the assigned slot index. `forceSlot` (used by legacy migration) * forces a specific slot when allocating for the first time; if `agentId` * already has a slot the existing value wins. */ export declare function acquireSlot(dir: string, agentId: string, forceSlot?: number): Promise; /** Read the full slots map for diagnostic/reader use (no lock). */ export declare function readSlotsRegistry(dir: string): Promise>; //# sourceMappingURL=slots.d.ts.map