/** * Anthropic prompt-cache markers on the outbound request. The TypeScript port of * the Rust reference's `supports_anthropic_cache_control` + `apply_cache_control` * (llm.rs), and the wire half of {@link PromptCache}. * * Kept as a standalone module rather than inline in `agent.ts` so the agent's * body-assembly path only needs a single call — the marking rules live here. */ /** * Does the configured upstream understand Anthropic-shaped `cache_control`? * * True when the model id looks Claude-ish, or is one of the known semantic * gateway aliases that route to Claude, AND the api base looks like a * LiteLLM-style gateway or `anthropic.*` directly. * * We deliberately do NOT send these to bare OpenAI / Gemini / Groq endpoints — * they 400 on unknown extension fields. A LiteLLM gateway's * `cache_control_injection_points` config is what actually forwards the markers * to Anthropic; without that gateway-side change this is a no-op. */ export declare function supportsAnthropicCacheControl(model: string | undefined, apiBaseUrl: string | undefined): boolean; /** * Attach `cache_control: ephemeral` to the strategic prefix boundaries, in place: * * 1. The last system message — caches the system prompt. * 2. The last tool definition — caches the tool block + the system prefix ahead of it. * Highest-ROI breakpoint: the tool registry is large and near-constant within a run. * 3. The last message in history — caches the running conversation, so each turn * inside the 5-minute window pays only for the new delta. * * Marking a block caches THAT block plus everything before it, so only the last * block of each prefix we want to reuse needs a marker. */ export declare function applyCacheControl(body: Record): void; //# sourceMappingURL=cacheControl.d.ts.map