import type { MailboxMessage, MailboxMessageView } from "./types.js"; /** * Recipient names are used to build `/.jsonl` paths and * come from external CLI `--input` JSON. Reject anything that could escape the * mailbox directory. Hard guard — call before constructing any file path. */ export declare function validateRecipientName(name: string): boolean; export declare function mailboxFilePath(mailboxDir: string, recipient: string): string; export declare function mailboxOffsetPath(mailboxDir: string, recipient: string): string; /** Append a message to its recipient's mailbox (keyed by msg.to). */ export declare function appendMailbox(mailboxDir: string, msg: MailboxMessage): void; /** * Mark a message delivered by APPENDING a DeliveryReceipt line (never rewrites * the file, so active byte cursors stay valid). Returns false if no message * with `messageId` exists (no receipt written). */ export declare function markDelivered(mailboxDir: string, recipient: string, messageId: string): boolean; /** * Read new messages via byte cursor and advance it. The cursor advances past * ALL lines (including delivery-receipt lines), but only `type: "message"` * lines are returned — receipts are consumed but filtered from the result. */ export declare function readNewMailbox(mailboxDir: string, recipient: string): MailboxMessage[]; /** Same filtering as readNewMailbox but does NOT advance the cursor. */ export declare function peekMailbox(mailboxDir: string, recipient: string): MailboxMessage[]; /** * Full-file scan (no cursor). Returns every message merged with delivery info * from any matching DeliveryReceipt line. */ export declare function listMailbox(mailboxDir: string, recipient: string): MailboxMessageView[];