/**
 * TurnExecutor
 *
 * Manages the per-session turn queue and the single-threaded turn execution
 * loop. The SDK stream is NOT concurrent-safe, so only one turn may execute
 * at a time per session. Additional turns are queued and drained FIFO after
 * the current turn completes.
 *
 * `enqueueTurn` is the public entry point. It:
 * 1. Pushes to `state.turnQueue` if a turn is already running.
 * 2. Otherwise sets `state.turnInProgress = true` and calls `executeTurn`.
 *
 * `executeTurn` (private):
 * 1. Calls `streamConsumer.consume(handle, state, 'turn', abort)`.
 * 2. Accumulates usage via `sessionRepo.accumulateUsage` when the result
 *    contains a usage payload.
 * 3. Marks the turn as `unread` and notifies subscribers.
 * 4. In `finally`, releases the turn lock and recursively drains the queue.
 *
 * Extracted from `interactive-session.service.ts` in phase 5 of the
 * strangler refactor documented at
 * `docs/plans/2026-04-14-interactive-session-service-refactor.md`.
 */
import type { IInteractiveSessionRepository } from '../../../../application/ports/output/repositories/interactive-session-repository.interface.js';
import type { SessionRegistry, SessionState } from '../core/session-registry.js';
import type { SessionPersistence } from '../core/session-persistence.js';
import type { StreamEventDispatcher } from '../core/stream-event-dispatcher.js';
import type { AgentStreamConsumer } from './agent-stream.consumer.js';
import type { ILogger } from '../../../../application/ports/output/services/logger.interface.js';
export declare class TurnExecutor {
    private readonly sessionRepo;
    private readonly registry;
    private readonly persistence;
    private readonly streamConsumer;
    private readonly logger;
    private readonly dispatcher;
    constructor(sessionRepo: IInteractiveSessionRepository, registry: SessionRegistry, persistence: SessionPersistence, streamConsumer: AgentStreamConsumer, logger: ILogger, dispatcher: StreamEventDispatcher);
    /**
     * Enqueue a prompt for execution. If a turn is already in progress, the
     * prompt is appended to `state.turnQueue` and will run when the current
     * turn completes. Otherwise the turn starts immediately.
     */
    enqueueTurn(state: SessionState, prompt: string): Promise<void>;
    /**
     * Execute a single turn: send the prompt to the SDK handle, consume the
     * stream, persist usage, notify done, and drain the queue.
     */
    private executeTurn;
}
//# sourceMappingURL=turn.executor.d.ts.map