import type { DeliveryConfirmation, HookInput, InjectionsResponse } from './types.js'; export declare const MAX_DELIVERY_CONFIRMATIONS_PER_REQUEST = 8; export interface PendingDelivery { deliveryRef: string; emittedHashes: string[]; rendererVersion: string; transcriptByteOffset: number; sessionSalt: string; } export declare function pendingDeliveryPath(sessionId: string): string; /** * A named file inside this session's private state directory — the same * directory pending.jsonl and session.salt live in, so sweepStaleSessionDirs * cleans it up with the rest of the session's litter. */ export declare function sessionStateFilePath(sessionId: string, fileName: string): string; /** Generate one random salt per host session without any awaited work. */ export declare function getOrCreateSessionSalt(sessionId: string): string; export declare function ensurePrivateDirectory(path: string): boolean; /** One bounded O_APPEND write. Any failure is silent and never blocks emission. */ export declare function appendPendingDelivery(sessionId: string, record: PendingDelivery): boolean; /** Parse only bytes appended after each stored transcript offset. */ export declare function collectDeliveryConfirmations(input: HookInput): DeliveryConfirmation[]; /** Remove accepted references after the existing request returns. */ export declare function acknowledgeDeliveryConfirmations(sessionId: string, accepted: string[]): void; /** Wall-clock floor for files left behind when the host misses lifecycle cleanup. */ export declare const ORPHAN_SESSION_MS: number; /** * Remove abandoned session directories after lifecycle cleanup failed to run. * This wall clock limits orphaned files only. It does not expire a live proof. * Runs once per SessionStart and checks the directory plus each direct child, * because rewriting a child does not refresh its directory mtime on Linux. */ export declare function sweepStaleSessionDirs(now?: number): number; /** Remove one session's private proof state on clean SessionEnd. */ export declare function clearPendingDeliveries(sessionId: string): void; /** Record the reflex fragments that survived final additionalContext composition. */ export declare function captureReflexDeliveries(input: HookInput, additionalContext: string, response: InjectionsResponse | null): boolean;