export type QueueState = "idle" | "dispatching" | "running"; export interface QueuedMessage { id?: string; type?: "message" | "bang" | "notification"; content: string; images?: Array<{ path: string; mimeType: string; }>; longTextMap?: Record; editable?: boolean; } export declare class MessageQueue { private queue; private nextId; private _state; onMessageEnqueued?: () => void; get state(): QueueState; transitionTo(newState: QueueState): boolean; enqueue(message: QueuedMessage): void; dequeue(): QueuedMessage | null; /** * Clear user-facing items (messages, bang commands) but preserve pending * notifications so background task results are not lost on abort. */ clear(): void; hasPending(): boolean; getQueue(): QueuedMessage[]; removeAt(index: number): boolean; removeById(id: string): boolean; updateById(id: string, patch: { content?: string; images?: Array<{ path: string; mimeType: string; }>; type?: "message" | "bang"; }): boolean; popLastEditable(): QueuedMessage | null; popAllEditable(): QueuedMessage[]; /** * Enqueue a background task notification (XML string). Notifications are * not user-editable and not surfaced in the queued-messages UI. */ enqueueNotification(xml: string): void; /** Whether any notification items are pending. */ hasNotifications(): boolean; /** * Drain all notification items, returning their XML content. Non-notification * items (messages, bang commands) are preserved in the queue. */ drainNotifications(): string[]; }