export type TelegramMessageState = 'processing' | 'ready' | 'delivered'; export interface TelegramMessageLedgerEntry { key: string; state: TelegramMessageState; updatedAt: number; ownerId: string; response?: string; nextChunkIndex?: number; deliveryUncertain?: boolean; deliveryTarget?: string; payloadIdentity?: string; /** * TG-05/TG-06: a pinned entry is exempt from TTL pruning and delivered-entry * eviction while the report-context SQLite row remains nonterminal, so a * confirmed-send proof cannot expire before the durable context commit. */ pinned?: boolean; } export interface TelegramDeliveryBinding { deliveryTarget: string; payloadIdentity: string; } export interface TelegramMessageLedgerOptions { ttlMs?: number; maxEntries?: number; now?: () => number; log?: (line: string) => void; ownerId?: string; } export declare class TelegramMessageLedger { private readonly path; private readonly entries; private readonly ttlMs; private readonly maxEntries; private readonly now; private readonly log; private readonly ownerId; constructor(path: string, options?: TelegramMessageLedgerOptions); get(key: string): TelegramMessageLedgerEntry | null; has(key: string): boolean; listUndelivered(): TelegramMessageLedgerEntry[]; isOwnedByCurrentProcess(entry: TelegramMessageLedgerEntry): boolean; claim(key: string, binding?: TelegramDeliveryBinding): { claimed: boolean; entry: TelegramMessageLedgerEntry; }; markReady(key: string, response: string): void; markDeliveryProgress(key: string, nextChunkIndex: number, deliveryUncertain: boolean): void; markDelivered(key: string): void; /** Pin an existing delivery entry against TTL pruning and eviction. */ pin(key: string): void; /** Idempotently release a pin; a missing or unpinned entry is a no-op. */ unpin(key: string): void; /** Compatibility alias for the original completed-ID ledger API. */ record(key: string): void; private requireEntry; private enforceEntryLimit; private load; private prune; private save; private serialize; private loadEntry; private evictOldestDelivered; private commit; } //# sourceMappingURL=telegram-message-ledger.d.ts.map