/**
 * Backpressure protections for the event router, wrapped around an inner
 * dispatcher. Two protections, both default-on:
 *
 *   1. Per-subscription concurrency cap = 1. If an event arrives while a
 *      previous run for the same subscription is in flight, drop the new
 *      one. Stops a `git pull` (1000 file-change events in 200ms) from
 *      blowing up into 1000 parallel subagent runs.
 *
 *   2. Trailing-edge debounce, 500ms, applied to `file.changed` events
 *      only. Events within the window reset the timer; on expiry, the most
 *      recent event is dispatched once. Cron and future kinds opt in as
 *      they prove noisy.
 *
 * Per the plan, neither protection has v1 config knobs (debounceMs is
 * available here only as a testing seam).
 *
 * See `agents/2026-05-20-skills-unification-plan.md` step 11.
 */
import type { SubscriptionDispatcher } from './event-router.js';
import type { Event, Subscription } from './types.js';
export interface BackpressureOptions {
    /** Override the trailing-edge debounce window. Defaults to 500ms. */
    debounceMs?: number;
    /**
     * Called when an event is dropped because a previous run for the same
     * subscription is in flight. Hook is for telemetry / debug-level logs.
     */
    onDrop?: (subscription: Subscription, event: Event) => void;
}
export declare class BackpressureDispatcher implements SubscriptionDispatcher {
    private readonly inner;
    private readonly options;
    private readonly inFlight;
    private readonly debouncers;
    private readonly pendingEvents;
    constructor(inner: SubscriptionDispatcher, options?: BackpressureOptions);
    dispatch(sub: Subscription, event: Event): void | Promise<void>;
    private scheduleDebounced;
    private dispatchImmediate;
    /**
     * Clear pending debouncers. The daemon calls this on shutdown so timers
     * don't keep the event loop alive. In-flight runs are not interrupted
     * (they're the inner dispatcher's responsibility).
     */
    dispose(): void;
}
//# sourceMappingURL=backpressure.d.ts.map