/**
 * Sub-Agent Message Queue Service
 *
 * Buffers messages destined for sub-agents that have not yet completed
 * initialization (agentStatus !== 'active'). Messages are flushed once
 * the agent registers via the MCP `register_agent_status` tool.
 *
 * The orchestrator is excluded from this queue because it already has
 * its own deferral mechanism via QueueProcessorService.
 *
 * @module sub-agent-message-queue
 */
/**
 * A single queued message destined for a sub-agent.
 */
export interface QueuedAgentMessage {
    /** The raw data string to write to the agent's terminal */
    data: string;
    /** Timestamp (ms since epoch) when the message was enqueued */
    queuedAt: number;
    /** The target session name */
    sessionName: string;
}
/**
 * Singleton service that holds pending messages per agent session.
 *
 * Messages are enqueued when a `mode: 'message'` write arrives at
 * the terminal controller for an agent that is not yet active.
 * They are dequeued and delivered sequentially when the agent
 * registers (status becomes 'active').
 */
export declare class SubAgentMessageQueue {
    private static instance;
    private pendingMessages;
    private logger;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns The SubAgentMessageQueue singleton
     */
    static getInstance(): SubAgentMessageQueue;
    /**
     * Reset the singleton instance (for testing only).
     */
    static resetInstance(): void;
    /**
     * Enqueue a message for a session that is not yet active.
     * If the queue exceeds MAX_QUEUE_SIZE, the oldest message is dropped.
     *
     * @param sessionName - The target agent session name
     * @param data - The raw data string to deliver later
     */
    enqueue(sessionName: string, data: string): void;
    /**
     * Dequeue all pending messages for a session (FIFO order).
     * The queue is cleared after dequeuing.
     *
     * @param sessionName - The agent session name
     * @returns Array of queued messages in insertion order, or empty array
     */
    dequeueAll(sessionName: string): QueuedAgentMessage[];
    /**
     * Check if there are pending messages for a session.
     *
     * @param sessionName - The agent session name
     * @returns True if there are pending messages
     */
    hasPending(sessionName: string): boolean;
    /**
     * Clear all pending messages for a session (e.g. on agent stop/exit).
     *
     * @param sessionName - The agent session name
     */
    clear(sessionName: string): void;
    /**
     * Get the number of pending messages for a session.
     *
     * @param sessionName - The agent session name
     * @returns Number of pending messages
     */
    getQueueSize(sessionName: string): number;
}
//# sourceMappingURL=sub-agent-message-queue.service.d.ts.map