/**
 * Output windowing.
 *
 * Tool output is fed to a model with a finite context, so a single tool must
 * never return an unbounded blob. This module collapses what used to be two
 * separate head/tail truncators into one {@link OutputBudget} description plus a
 * single {@link clamp} applier. A budget says how big the surviving window may
 * be (`maxBytes`), which end of the text to keep (`kind`), and optionally how to
 * announce what was dropped (`notice`).
 *
 * All measurement is in UTF-8 bytes via {@link Buffer}, and every cut is snapped
 * to a character boundary so a multibyte sequence is never sliced in half.
 */
/** Which slice of an over-budget string survives clamping. */
export type ClipEnd = "head" | "tail" | "middle";
/**
 * A request to bound a string's UTF-8 byte length.
 *
 * `kind` selects which portion to keep:
 *   - `head`   — keep the opening bytes, drop the tail.
 *   - `tail`   — keep the closing bytes, drop the head.
 *   - `middle` — drop a band from the center, keeping both ends.
 *
 * `maxBytes` is the ceiling for the *kept* text (the optional notice is appended
 * on top and is not counted against it). `notice`, when given, is called with
 * the number of omitted bytes and returns a marker spliced in at the cut point.
 */
export interface OutputBudget {
    readonly kind: ClipEnd;
    readonly maxBytes: number;
    readonly notice?: (omitted: number) => string;
}
/**
 * Bound `text` to `policy.maxBytes` UTF-8 bytes, keeping the end named by
 * `policy.kind` and splicing in a notice where bytes were removed.
 *
 * When the input already fits, it is returned untouched and no notice is added.
 * Cuts always fall on character boundaries, so the result is always valid UTF-8.
 */
export declare function clamp(text: string, policy: OutputBudget): string;
