import type { TextBlock } from '../types/blocks.js'; /** * Derive a stable, provider-agnostic cache-partition key from a frozen * system-prompt epoch. Requests that share the same stable prefix produce the * same key, so provider backends route them to the same automatic-cache * partition — this is what OpenAI's `prompt_cache_key` (and Gemini implicit * routing) needs to actually hit the cache on load-balanced deployments. * * Keyed off the volatile-free `ctx.systemPrompt` epoch array (the per-turn * ledger/next-steps blocks are appended AFTER this array, so they never enter * the key). Cached by array identity in a WeakMap — the sha-256 runs once per * epoch (a new array = a new epoch, e.g. on mode switch), not per request. * * Anthropic ignores this field (it uses `ttl` + `cache_control` markers), so * setting it is harmless there; only the wires that read `req.cache.key` act on * it, gated by their own capability flags. */ export declare function deriveCachePrefixKey(systemPrompt: readonly TextBlock[]): string; //# sourceMappingURL=cache-key.d.ts.map