import type { VertexAnthropicCacheInput, VertexAnthropicCacheOutput, VertexAnthropicMessage } from "../types/index.js"; /** Anthropic allows at most four `cache_control` breakpoints per request. */ export declare const ANTHROPIC_MAX_CACHE_BREAKPOINTS = 4; /** * Annotate a native Vertex+Claude request with prompt-cache breakpoints. * * Budget allocation (max 4 markers): * 1. The stable prefix — the last system block when a system prompt is * present (this single marker caches `tools + system`, since system * renders after tools); otherwise the last tool definition. * 2-4. A rolling breakpoint on the last few messages, so the * growing-but-now-stable conversation history is cached and only the * newest turn is billed as fresh input. * * Pure: the inputs are cloned, never mutated. */ export declare function applyVertexAnthropicCacheBreakpoints(input: VertexAnthropicCacheInput): VertexAnthropicCacheOutput; /** * Count the `cache_control` markers already present on a request. The direct * Anthropic path (AI-SDK pipeline) arrives with markers the upstream layers * placed — MessageBuilder tags the system prompt, GenerationHandler tags the * last tool definition, and message content blocks may carry translated * AI-SDK markers. Anthropic rejects requests with more than four markers, so * any additional history breakpoints must fit in the remaining budget. */ export declare function countAnthropicCacheMarkers(input: { system?: string | ReadonlyArray<{ cache_control?: unknown; }> | undefined; tools?: ReadonlyArray<{ cache_control?: unknown; }> | undefined; messages: ReadonlyArray; }): number; /** * Rolling history breakpoints for request paths whose stable-prefix markers * are managed upstream (direct Anthropic: system via MessageBuilder, last * tool via GenerationHandler). Marks the last content block of up to `budget` * tail messages; a tail block that already carries a marker is left as-is * without consuming budget (it already serves as that breakpoint). Pure — * the input array is cloned, never mutated. */ export declare function applyAnthropicHistoryCacheBreakpoints(input: ReadonlyArray, budget: number): VertexAnthropicMessage[];