/** * Durable, atomic, per-source monotonic sequence store for Herdr reports. * * Herdr accepts but ignores a report whose `seq <= last accepted seq for the * same source`. Hooks run as short-lived processes, so an in-memory counter * resets to 1 on every process/restart and would (a) let legitimate new reports * be rejected as stale after a restart and (b) fail to prevent stale reports * across concurrent processes. This store persists the counter under * `.omx/adapters/herdr/seq/.json` and serializes concurrent * increments with an atomic mkdir lock, so seq is strictly increasing per source * across processes and restarts. */ export interface SeqStoreOptions { /** Base `.omx/adapters/herdr` dir; defaults to the resolved OMX adapters dir. */ baseDir?: string; /** Max time to wait for the lock before giving up (best-effort). */ lockTimeoutMs?: number; /** Consider a held lock stale after this age (crash recovery). */ lockStaleMs?: number; } /** Filesystem-safe, collision-resistant file stem for a source id. */ export declare function sanitizeSourceKey(source: string): string; /** * Atomically read-increment-persist the per-source counter and return the new * seq. Strictly increasing and unique per source across concurrent processes * and restarts. Falls back to a time-derived seq only if the lock cannot be * acquired, so a report is never dropped and never regresses below the last * persisted value. */ export declare function nextSeq(source: string, options?: SeqStoreOptions): number; export declare function readPersistedSeq(source: string, options?: SeqStoreOptions): number; //# sourceMappingURL=seq-store.d.ts.map