import type { ImageContent } from "@bastani/pi-ai/compat"; import type { AgentMessage } from "@earendil-works/pi-agent-core"; import type { AgentSessionInternalSurface as AgentSession } from "./agent-session-methods.ts"; import { abort, pauseQueuedMessages, resumeQueuedMessages } from "./agent-session-queue-pause.ts"; import { transferWorkflowStageDeliveriesTo } from "./agent-session-transfer.ts"; import { type ClearQueueOptions, type DrainedAgentQueues, type InterruptQueueHold } from "./agent-session-types.js"; import type { SendMessageOptions, SendMessagesOptions } from "./extensions/index.js"; import type { CustomMessage } from "./messages.ts"; export { transferWorkflowStageDeliveriesTo }; export declare function _queueSteer(this: AgentSession, text: string, images?: ImageContent[]): Promise; /** * Internal: Queue a follow-up message (already expanded, no extension command check). */ export declare function _queueFollowUp(this: AgentSession, text: string, images?: ImageContent[]): Promise; /** * 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(this: AgentSession, message: Pick, "customType" | "content" | "display" | "details">, options?: SendMessageOptions): Promise; /** Atomically admits a custom-message batch in array order. */ export declare function sendCustomMessages(this: AgentSession, messages: Array, "customType" | "content" | "display" | "details">>, options?: SendMessagesOptions): Promise; export declare function sealWorkflowStageGeneration(this: AgentSession): void; export declare function closeWorkflowStageGeneration(this: AgentSession): Promise; export declare function _appendCustomMessage(this: AgentSession, message: CustomMessage): Promise; /** Append context-only custom messages once the current turn's tool results are in history. */ export declare function _flushPendingCustomMessages(this: AgentSession): Promise; export declare function _enqueueInterruptCustomMessage(this: AgentSession, message: CustomMessage, options?: SendMessageOptions): Promise; export declare function _sendInterruptCustomMessageNow(this: AgentSession, message: CustomMessage, options?: SendMessageOptions): Promise; 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" | "interrupt"): void; export declare function _drainQueuedAgentMessages(this: AgentSession): DrainedAgentQueues; export declare function _restoreQueuedAgentMessages(this: AgentSession, queues: DrainedAgentQueues): void; /** * Clear queued text for editor restoration while retaining optional raw custom entries. */ export declare function clearQueue(this: AgentSession, options?: ClearQueueOptions): { 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 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; export declare const agentSessionMessageQueueMethods: { _queueSteer: typeof _queueSteer; _queueFollowUp: typeof _queueFollowUp; _throwIfExtensionCommand: typeof _throwIfExtensionCommand; transferWorkflowStageDeliveriesTo: typeof transferWorkflowStageDeliveriesTo; sealWorkflowStageGeneration: typeof sealWorkflowStageGeneration; sendCustomMessage: typeof sendCustomMessage; sendCustomMessages: typeof sendCustomMessages; closeWorkflowStageGeneration: typeof closeWorkflowStageGeneration; _appendCustomMessage: typeof _appendCustomMessage; _flushPendingCustomMessages: typeof _flushPendingCustomMessages; _enqueueInterruptCustomMessage: typeof _enqueueInterruptCustomMessage; _sendInterruptCustomMessageNow: typeof _sendInterruptCustomMessageNow; _ensureActiveInterruptQueueHold: typeof _ensureActiveInterruptQueueHold; _restoreAndClearActiveInterruptQueueHold: typeof _restoreAndClearActiveInterruptQueueHold; pauseQueuedMessages: typeof pauseQueuedMessages; resumeQueuedMessages: typeof resumeQueuedMessages; _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