/**
 * The tool-execution scheduler.
 *
 * The pure reducer never runs a tool; it emits `run_tool` effects and waits for
 * the matching `tool_settled` signals to come back. The scheduler is the driver
 * that bridges that gap for one dispatch round: it takes the batch of
 * {@link ToolCall}s the model asked for, hands each to the injected
 * {@link ToolRunner}, and streams back a {@link ToolSettledSignal} as each one
 * finishes — in completion order, not request order.
 *
 * Three properties define its behaviour:
 *
 * - **Per-call cancellation.** Every call is run under its own
 *   {@link AbortController}, all chained to the caller's outer `signal` (and to
 *   {@link createScheduler}'s own `cancel()`). Aborting tears down the whole
 *   round: every in-flight runner observes its private signal firing, and the
 *   generator stops once the calls already started have drained.
 *
 * - **Bounded concurrency.** At most {@link DEFAULT_CONCURRENCY} calls run at
 *   once; the rest wait in request order until a slot frees up. A queued call
 *   that is reached after an abort is skipped rather than started.
 *
 * - **Ordered in-flight tracking.** The set of calls currently `queued` or
 *   `running` is kept as an ordered array of {@link PendingTool}, mirroring the
 *   request order, so a host can render progress deterministically.
 */
import type { ToolCall, ToolRunner } from "../contract";
import type { ToolSettledSignal } from "../contract";
/** How many tool calls may execute simultaneously in one dispatch round. */
export declare const DEFAULT_CONCURRENCY = 8;
/** What {@link Scheduler.run} streams: one settled signal per finished call. */
type SettledSignal = ToolSettledSignal;
/** The driver returned by {@link createScheduler}. */
export interface Scheduler {
    /**
     * Execute one batch of calls, yielding a `tool_settled` signal as each call
     * finishes. Completion order — not request order — governs emission. The
     * passed `signal` aborts the whole round; so does {@link Scheduler.cancel}.
     */
    run(calls: ToolCall[], signal: AbortSignal): AsyncGenerator<SettledSignal>;
    /** Abort every dispatch round this scheduler has started. */
    cancel(): void;
}
/**
 * Build a tool-execution scheduler over a {@link ToolRunner}.
 *
 * The runner is the only side that performs real I/O; the scheduler owns
 * concurrency, cancellation wiring, and in-flight bookkeeping. One scheduler may
 * drive many sequential rounds; {@link Scheduler.cancel} fires the controllers
 * of every round started so far.
 */
export declare function createScheduler(runner: ToolRunner, concurrency?: number): Scheduler;
export {};
