/** * The round warning: a user message the tool loop sends the model when * few tool rounds are left in an `llm()` call, set with the * `warnAtRoundsLeft` option. The message expires with the call. See "The * round warning" in docs/dev/agents/tool-loop-guards.md. */ /** The `warnAtRoundsLeft` option, on `llm()` and in `setLlmOptions`. */ export type WarnAtRoundsLeft = { /** The first warning goes out when this many rounds are left. 0 turns it off. */ remaining?: number; /** The first warning's text; `{remaining}` and `{limit}` are filled in. */ text?: string; /** Whether to warn when one round is left. */ finalWarning?: boolean; /** The final warning's text, with the same placeholders. */ finalWarningText?: string; }; export type RoundWarningSettings = Required; /** Which warnings an `llm()` call has already sent. Kept on runnerState. */ export type RoundWarningsSent = { first: boolean; final: boolean; }; /** A warning that is due, and its text with the placeholders filled. */ export type DueWarning = { kind: keyof RoundWarningsSent; text: string; }; export declare const DEFAULT_ROUND_WARNING: RoundWarningSettings; /** The call's value over the branch default over the defaults, field by * field, so a call that sets only `text` keeps the branch's threshold. */ export declare function roundWarningSettings(perCall: WarnAtRoundsLeft | null | undefined, branch: WarnAtRoundsLeft | null | undefined): RoundWarningSettings; /** Fills `{remaining}` and `{limit}`. Any other brace text is left as * written: the template is the user's text, so an unknown placeholder is * not an error. */ export declare function fillRoundWarning(template: string, values: { remaining: number; limit: number; }): string; /** Which warning, if any, is due at the boundary after `round` (counted * from 0) under a cap of `limit`, given which have already gone out. At * that boundary the model can still get `limit - (round + 1)` rounds of * tool calls run. The final warning goes out at 1 left; the first at the * first boundary at or under the threshold with more than 1 left, so the * two are never due at once. */ export declare function roundWarningDue(settings: RoundWarningSettings, round: number, limit: number, fired: RoundWarningsSent): DueWarning | null;