import { tryFastAbortFromMessage } from "./abort.js";
import { type DispatchMiddleware } from "./dispatch-middleware.js";
export interface WithFastAbortOptions {
    /**
     * Override the abort detector. Defaults to production
     * `tryFastAbortFromMessage`. Tests supply a fake.
     */
    detect?: typeof tryFastAbortFromMessage;
    /**
     * Optional notification when a fast-abort fires. Production records a
     * diagnostic event ("processed:fast_abort") via the chain's
     * `recordProcessed` hook.
     */
    onAbort?: (info: {
        stoppedSubagents?: number;
    }) => void;
}
/**
 * Returns a DispatchMiddleware that detects fast-abort patterns. When
 * detected, returns the "aborted" outcome with a synthetic abort reply
 * payload. Otherwise proceeds.
 */
export declare function withFastAbort(opts?: WithFastAbortOptions): DispatchMiddleware;
