/** * Local event outbox for offline/disconnected mode. * Buffers structured OrgX events when cloud API is unreachable. * Events are flushed on next successful sync. */ import type { LiveActivityItem } from "./types.js"; export interface OutboxEvent { id: string; type: "progress" | "decision" | "artifact" | "changeset" | "retro" | "outcome" | "quality"; timestamp: string; payload: Record; activityItem: LiveActivityItem; replayFailures?: number; lastReplayError?: string | null; lastReplayAt?: string | null; } export interface OutboxSummary { pendingTotal: number; pendingByQueue: Record; oldestEventAt: string | null; newestEventAt: string | null; } export declare function appendOutboxDeadLetter(sessionId: string, event: OutboxEvent, reason: string, error?: string | null): Promise; export declare function readOutbox(sessionId: string): Promise; export declare function appendToOutbox(sessionId: string, event: OutboxEvent): Promise; export declare function replaceOutbox(sessionId: string, events: OutboxEvent[]): Promise; export declare function readAllOutboxItems(): Promise; export declare function readOutboxSummary(): Promise; export declare function clearOutbox(sessionId: string): Promise;