import type { AgentMessage } from "@earendil-works/pi-agent-core";
import type { ImageContent } from "@earendil-works/pi-ai/compat";
import type { CustomMessage } from "./messages.ts";
import type { SendMessageOptions } from "./extensions/index.ts";
import type { AgentSessionInternalSurface as AgentSession } from "./agent-session-methods.ts";
import { type DrainedAgentQueues, type InterruptQueueHold } from "./agent-session-types.ts";
export declare function _queueSteer(this: AgentSession, text: string, images?: ImageContent[]): Promise<void>;
/**
 * Internal: Queue a follow-up message (already expanded, no extension command check).
 */
export declare function _queueFollowUp(this: AgentSession, text: string, images?: ImageContent[]): Promise<void>;
/**
 * Throw an error if the text is an extension command.
 */
export declare function _throwIfExtensionCommand(this: AgentSession, text: string): void;
/**
 * Send a custom message to the session. Creates a CustomMessageEntry.
 *
 * Handles five cases:
 * - Streaming + interrupt trigger: aborts the active run and starts an immediate custom-message turn
 * - Streaming + explicit display-only context exclusion: appends to state/session, no turn and no queue
 * - Streaming otherwise: queues message, processed when loop pulls from queue
 * - Not streaming + triggerTurn: appends to state/session, starts new turn
 * - Not streaming + no trigger: appends to state/session, no turn
 *
 * @param message Custom message with customType, content, display, details
 * @param options.triggerTurn If true and not streaming, triggers a new LLM turn
 * @param options.deliverAs Delivery mode: "steer", "followUp", "nextTurn", or "interrupt"
 */
export declare function sendCustomMessage<T = unknown>(this: AgentSession, message: Pick<CustomMessage<T>, "customType" | "content" | "display" | "details">, options?: SendMessageOptions): Promise<void>;
export declare function _appendCustomMessage<T>(this: AgentSession, message: CustomMessage<T>): void;
export declare function _enqueueInterruptCustomMessage<T>(this: AgentSession, message: CustomMessage<T>, options?: SendMessageOptions): Promise<void>;
export declare function _sendInterruptCustomMessageNow<T>(this: AgentSession, message: CustomMessage<T>, options?: SendMessageOptions): Promise<void>;
export declare function _ensureActiveInterruptQueueHold(this: AgentSession): InterruptQueueHold;
export declare function _restoreAndClearActiveInterruptQueueHold(this: AgentSession): void;
export declare function _queueAgentMessage(this: AgentSession, message: AgentMessage, delivery: "steer" | "followUp"): void;
export declare function _drainQueuedAgentMessages(this: AgentSession): DrainedAgentQueues;
export declare function _restoreQueuedAgentMessages(this: AgentSession, queues: DrainedAgentQueues): void;
/**
 * Send a user message to the agent. Always triggers a turn.
 * When the agent is streaming, use deliverAs to specify how to queue the message.
 *
 * @param content User message content (string or content array)
 * @param options.deliverAs Delivery mode when streaming: "steer" or "followUp"
 */
export declare function clearQueue(this: AgentSession): {
    steering: string[];
    followUp: string[];
};
/** Number of pending messages (includes both steering and follow-up) */
export declare function getSteeringMessages(this: AgentSession): readonly string[];
/** Get pending follow-up messages (read-only) */
export declare function getFollowUpMessages(this: AgentSession): readonly string[];
export declare function abort(this: AgentSession): Promise<void>;
export declare function setSteeringMode(this: AgentSession, mode: "all" | "one-at-a-time"): void;
/**
 * Set follow-up message mode.
 * Saves to settings.
 */
export declare function setFollowUpMode(this: AgentSession, mode: "all" | "one-at-a-time"): void;
/**
 * Apply validated logical deletions and rebuild active agent context.
 * Retained transcript entries/content blocks stay verbatim.
 */
export declare const agentSessionMessageQueueMethods: {
    _queueSteer: typeof _queueSteer;
    _queueFollowUp: typeof _queueFollowUp;
    _throwIfExtensionCommand: typeof _throwIfExtensionCommand;
    sendCustomMessage: typeof sendCustomMessage;
    _appendCustomMessage: typeof _appendCustomMessage;
    _enqueueInterruptCustomMessage: typeof _enqueueInterruptCustomMessage;
    _sendInterruptCustomMessageNow: typeof _sendInterruptCustomMessageNow;
    _ensureActiveInterruptQueueHold: typeof _ensureActiveInterruptQueueHold;
    _restoreAndClearActiveInterruptQueueHold: typeof _restoreAndClearActiveInterruptQueueHold;
    _queueAgentMessage: typeof _queueAgentMessage;
    _drainQueuedAgentMessages: typeof _drainQueuedAgentMessages;
    _restoreQueuedAgentMessages: typeof _restoreQueuedAgentMessages;
    clearQueue: typeof clearQueue;
    getSteeringMessages: typeof getSteeringMessages;
    getFollowUpMessages: typeof getFollowUpMessages;
    abort: typeof abort;
    setSteeringMode: typeof setSteeringMode;
    setFollowUpMode: typeof setFollowUpMode;
};
//# sourceMappingURL=agent-session-message-queue.d.ts.map