import type { Heartbeat } from "./types.js"; export type { Heartbeat } from "./types.js"; /** Interval floor. A session may not schedule itself more often than this — * below a minute the wake-ups arrive faster than a turn can settle. */ export declare const MIN_EVERY_SECONDS = 60; /** Concurrent armed heartbeats one session may hold. */ export declare const MAX_ARMED_PER_SESSION = 5; /** The stored text is delivered verbatim, so it is capped like a prompt, not a note. */ export declare const MESSAGE_MAX_CHARS = 2000; /** A refused arm: the caller asked for something outside a stated limit. The * message names the limit and the fix; routes map it to 422. */ export declare class HeartbeatLimitError extends Error { } export interface ArmHeartbeatInput { ownerSessionId: string; message: string; everySeconds: number; /** Disarm after this many deliveries. */ maxFires?: number; /** Disarm at this instant (epoch ms) without delivering. */ expiresAt?: number; } /** * Arm a heartbeat for `ownerSessionId`. The owner is always supplied by the * gateway from the caller's verified identity, never by the request body. */ export declare function armHeartbeat(input: ArmHeartbeatInput, now?: number): Heartbeat; export declare function getHeartbeat(id: string): Heartbeat | undefined; /** The caller's own armed heartbeats. Another session's rows are not reachable * through this function, which is the whole ownership boundary. */ export declare function listHeartbeatsForSession(ownerSessionId: string): Heartbeat[]; /** * Disarm `id`, but only if `ownerSessionId` owns it. Returns false for an * unknown id, someone else's id, and an already-disarmed row alike — the caller * reports all three as "not found" so a heartbeat's existence never leaks to a * session that does not own it. */ export declare function stopHeartbeat(id: string, ownerSessionId: string, now?: number): boolean; /** Every armed heartbeat due at `now`, oldest deadline first. */ export declare function claimDueHeartbeats(now: number): Heartbeat[]; export declare function disarmHeartbeat(id: string, reason: string, now?: number): void; /** Deletion of a session disarms everything it armed. Stopping does not — a * stopped session is recoverable and its heartbeats should survive with it. */ export declare function disarmHeartbeatsForSession(ownerSessionId: string, now?: number): number; /** * Book one delivery against `id` and schedule the next. * * The next deadline is computed from `now`, never from the deadline just met, so * a heartbeat whose gateway was down for ten intervals fires once and then * resumes on a fresh interval instead of replaying every tick it slept through. */ export declare function advanceHeartbeat(id: string, now?: number): Heartbeat | undefined; //# sourceMappingURL=store.d.ts.map