/** * AgentGuard(TM) Spend: In-memory spend store * * Reference implementation of the SpendStore interface. Suitable for tests, * examples, and single-process shadow deployments. Production callers with * multi-process or distributed workloads should supply their own store * (typically Redis with INCR, or Postgres with SELECT FOR UPDATE). * * Licensed under the alpha evaluation license; see LICENSE in the package * root. Patent notice: Protected by U.S. patent-pending technology * (App. Nos. 63/983,615; 63/983,621; 63/983,843; 63/984,626; * 64/071,781; 64/071,789). */ import type { SpendStore, SpendWindow } from './types'; export declare const WINDOW_DURATION_MS: Record; /** * Returns the millisecond timestamp at which a window of the given duration * containing `nowMs` started. For fixed-grid windows we align to UTC epoch * (so all processes agree on window boundaries without coordination). */ export declare function windowStart(window: SpendWindow, nowMs: number): number; /** * In-memory spend store. Thread-safe in single-process Node (we rely on the * event loop's atomic execution between awaits; this store does no I/O). */ export declare class InMemorySpendStore implements SpendStore { private state; private key; private rollIfStale; getWindowSpend(scopeKey: string, window: SpendWindow): Promise; incrementWindowSpend(scopeKey: string, window: SpendWindow, cents: number): Promise; reserveWindowSpend(scopeKey: string, window: SpendWindow, cents: number, limitCents: number): Promise<{ allowed: boolean; before: number; after: number; }>; settleWindowSpend(scopeKey: string, window: SpendWindow, deltaCents: number): Promise; /** Clear all state. Test helper. */ reset(): void; } //# sourceMappingURL=store-memory.d.ts.map