/**
 * Post-turn queue — executes registered PostTurnHandlers after each turn_end.
 *
 * Handles:
 * - Priority ordering (lower priority number = runs first)
 * - Sequential execution
 * - Cancellation via AbortSignal (fires on user input)
 * - Error isolation (one handler failing doesn't block others)
 *
 * Lives in the extensions layer (app/extensions/), not core/.
 */
import type { ExtensionError, PostTurnContext, PostTurnHandler } from './types.js';
export interface PostTurnQueueOptions {
    /** Check whether the user has sent a new message. */
    hasPendingMessages: () => boolean;
    /** Report handler errors without crashing. */
    onError: (error: ExtensionError) => void;
    /** Resolve handler ownership for error reporting. */
    resolveExtensionPath?: (handler: PostTurnHandler) => string | undefined;
}
/**
 * Run all post-turn handlers that pass shouldRun(), respecting priority order.
 *
 * Execution model:
 * 1. Filter handlers via shouldRun() (sync, fast)
 * 2. Sort by priority (ascending)
 * 3. Execute handlers sequentially. Before each handler, check for user input
 *    and abort if pending.
 *
 * @returns The number of handlers that executed (including errored ones).
 */
export declare function runPostTurnHandlers(handlers: PostTurnHandler[], ctx: PostTurnContext, controller: AbortController, options: PostTurnQueueOptions): Promise<number>;
//# sourceMappingURL=post-turn-queue.d.ts.map