import type { QueuedMessage } from "../ws/protocol.js";
/**
 * Server-side prompt queue for a single session.
 * Steered messages sort before non-steered, stable within each group.
 */
export declare class PromptQueue {
    private queue;
    /** Create a queue, optionally restoring from persisted data. */
    constructor(initial?: QueuedMessage[]);
    /** Add a message to the end of the queue. Returns the queued message. */
    enqueue(text: string, opts?: {
        images?: Array<{
            type: "image";
            data: string;
            mimeType: string;
        }>;
        attachments?: unknown[];
        isSteered?: boolean;
    }): QueuedMessage;
    /**
     * Mark a message as steered and reorder.
     * Steered messages sort before non-steered, stable within each group.
     * Returns true if the message was found and updated.
     */
    steer(messageId: string): boolean;
    /** Remove a message from the queue. Returns true if found and removed. */
    remove(messageId: string): boolean;
    /** Pop the next message from the front of the queue. Returns undefined if empty. */
    dequeue(): QueuedMessage | undefined;
    /** Pop all consecutive steered messages from the front. Returns empty array if front is not steered. */
    dequeueAllSteered(): QueuedMessage[];
    /**
     * Insert a message at the front of the queue. Used by reconciliation paths
     * (e.g. RPC failure rollback) that need to put a row back at index 0.
     * Calls reorder() so the steered group still sorts first.
     */
    enqueueAtFront(text: string, opts?: {
        images?: Array<{
            type: "image";
            data: string;
            mimeType: string;
        }>;
        attachments?: unknown[];
        isSteered?: boolean;
    }): QueuedMessage;
    /** Peek at the front of the queue without removing. */
    peek(): QueuedMessage | undefined;
    /** Get the full queue as an array (for broadcasting). */
    toArray(): QueuedMessage[];
    /** Number of messages in the queue. */
    get length(): number;
    /** Whether the queue is empty. */
    get isEmpty(): boolean;
    /** Reorder queue to match the given ID list. Unknown IDs ignored. Unlisted items appended at end. */
    reorderByIds(messageIds: string[]): void;
    /**
     * Stable reorder: steered messages first, non-steered second.
     * Within each group, original insertion order is preserved.
     */
    private reorder;
}
//# sourceMappingURL=prompt-queue.d.ts.map