import type { UpstreamInterceptor } from './types.js'; /** * Strip all `cache_control` markers from a user message's content blocks. * * MUTATES the message in place. Returns the number of markers stripped. * Only processes messages with role === 'user' and an Array `content`. * * @param msg - A message object from the Anthropic messages array * @returns The number of cache_control markers removed */ export declare function stripCacheControlMarkers(msg: any): number; /** * Count all `cache_control` markers present in user messages within the body. * * Non-destructive read-only check. Only counts markers on messages with * role === 'user' and an Array `content`. * * @param body - The full upstream request body (Anthropic /v1/messages format) * @returns The total number of cache_control markers found */ export declare function countUserCacheControlMarkers(body: any): number; /** * Cache Control Normalize 拦截器。 * * 1. 仅处理 Anthropic /v1/messages 请求(通过 URL 判断) * 2. 统计所有 user message 中的 cache_control 标记数量 * 3. 若标记数为 0,跳过不做任何修改 * 4. 剥离所有 user message 中的 cache_control 标记 * 5. 在最后一条 user message 的最后一个 content block 上应用规范的 cache_control * 6. 返回修改后的 upstream */ export declare const cacheControlNormalize: UpstreamInterceptor; //# sourceMappingURL=cache-control-normalize.d.ts.map