import { type CallContext, type Scorer, type ShapeInput, type ShapeOutcome, type ShapeSink } from "../types.js"; import { type ShapeState } from "./state.js"; /** * The probe Spotlight scores output lines under: each line's relevance to the agent's current call. * Each line is appended right after it, so trailing whitespace (an editor's final newline) is trimmed. */ export declare const SHAPE_PROBE: string; /** The system-prompt paragraph telling the agent how shaped output reads (read narrowly, batch calls). */ export declare const SHAPE_RULE: string; /** Tokens of `text` as a result's trace counts them (`inTokens`, `outTokens`). */ export declare function countTokens(text: string): number; /** * Fewest tokens a changed text must save against what the agent gets without it: below this, the gap markers and * footers a cut adds, and the reads back they invite, outweigh the saving. */ export declare const MIN_SAVED_TOKENS = 100; /** * Shapes one tool result and records what the agent was shown in `state`. A changed text reports what became of its * subject's lines: scores, kept lines, the reasons its steps recorded and the ranking of the last cut by rank. Never * throws for a scorer that cannot answer. * * A changed text saving fewer than {@link MIN_SAVED_TOKENS} tokens against the input is dropped (`stats.reverted`). * `plain` is the unshaped text for the call (default: the input), which can be far less than the full output shaping * reads. A changed text saving fewer than {@link MIN_SAVED_TOKENS} tokens against it is capped: the outcome keeps the * would-be text, adds the `plain-cap` step and sets `capped`. A `plain` whose lines the sink cut to its column cap * (`widthCut`) lost text only a read of the saved output brings back, so a cut up to {@link VALVE_OVER} characters is * applied even when longer than it. With `holdout`, a changed text is the cut shaping would make. Either way, and for * a text shaping keeps, the agent is shown `plain`'s text: `state` records that, not what the cut hid. */ export declare function shapeResult(input: ShapeInput, ctx: CallContext, scorer: Scorer, state: ShapeState, sink: ShapeSink, signal?: AbortSignal, holdout?: boolean, plain?: { text: string; tokens: number; widthCut?: boolean; }): Promise;