/** M3: id of one logical message — `msg--<8 hex>` — generated once at the * message's origin and carried on every bus copy and queue entry. */ export declare function newMessageId(): string; export interface QueuedMessage { fromQualified: string; toRole: string; subject: string; body: string; ts: number; /** M3: origin message id, re-used when the queue is drained. */ messageId?: string; /** M2: queued for an endpoint role (retried by POST, never drained into a mailbox). */ endpoint?: boolean; /** Structured handoff context (rich metadata for role transitions) */ context?: { summary?: string; nextAction?: string; filesChanged?: string[]; relatedIssues?: string[]; metadata?: Record; }; } export declare function queueMessage(root: string, orgName: string, msg: QueuedMessage): boolean; export declare function drainInbox(root: string, orgName: string): QueuedMessage[]; /** Non-destructive read of the queue (pending file plus an interrupted drain). */ export declare function peekInbox(root: string, orgName: string): QueuedMessage[]; /** Remove and return the queued messages matching `predicate`; every other * message is put back. M2 uses it to retry endpoint entries while leaving * other queued messages in place. * * The snapshot is renamed to `.draining` (which drainInbox recovers after a * crash) and only unlinked AFTER the untouched messages were appended back, * so a crash can at worst duplicate a message, never lose one — and a * concurrent peekInbox never sees the untouched messages disappear. */ export declare function takeQueued(root: string, orgName: string, predicate: (m: QueuedMessage) => boolean): QueuedMessage[]; export declare function inboxCount(root: string, orgName: string): number; //# sourceMappingURL=inbox.d.ts.map