export interface SessionRootReply { messageId: string; sourceAgentId: string; requestMessageId: string; threadId?: string; content: string; createdAt: string; ackToken: string; sourceReconciledAt?: string; acknowledgedAt?: string; } export type SessionRootReplyAcceptance = { status: "retained"; messageId: string; reply: SessionRootReply; created: boolean; } | { status: "completed_replay"; messageId: string; created: false; }; export interface SessionRootMailboxOptions { agentDir: string; parentSessionId: string; } export interface SessionRootReplyInput { sourceAgentId: string; requestMessageId: string; threadId?: string; content: string; } export interface SessionRootReplyQuery { sourceAgentId?: string; requestMessageId?: string; maxMessages?: number; } export interface SessionRootReplyWaitOptions extends SessionRootReplyQuery { timeoutMs?: number; signal?: AbortSignal; } export interface SessionRootReplyWaitResult { replies: SessionRootReply[]; timedOut: boolean; } /** Opaque host-owned sender address for root-originated reply-expected worker messages. */ export declare function sessionRootAddress(parentSessionId: string): string; export declare function sessionRootReplyMessageId(parentSessionId: string, sourceAgentId: string, requestMessageId: string): string; /** Bounded durable inbox for accepted worker replies addressed to one foreground session root. */ export declare class SessionRootMailbox { private readonly parentSessionId; private readonly file; constructor(options: SessionRootMailboxOptions); /** Validate and size one canonical reply without mutating durable inbox state. */ assertReplyInput(input: SessionRootReplyInput): void; enqueueReply(input: SessionRootReplyInput): SessionRootReplyAcceptance; /** Enqueue a reply whose permanent replay authority is the source worker's durable receipt. */ enqueueSourceOwnedReply(input: SessionRootReplyInput): SessionRootReplyAcceptance; private enqueueReplyWithAuthority; pendingReplies(query?: SessionRootReplyQuery): SessionRootReply[]; retainedReplies(): SessionRootReply[]; getReply(messageId: string): SessionRootReply | undefined; markSourceReconciled(messageId: string): boolean; releaseSourceReplayReceipt(messageId: string): boolean; acknowledge(messageId: string, ackToken: string): boolean; waitForReplies(options?: SessionRootReplyWaitOptions): Promise; /** * Subscribes to process-local mutations for every mailbox instance backed by this file. * Callers must unsubscribe; durable cross-process delivery remains the control owner's responsibility. */ subscribe(listener: () => void): () => void; private notify; private read; private update; } //# sourceMappingURL=session-root-mailbox.d.ts.map