import type { UpstreamInterceptor } from './types.js'; /** * Regex to match a trailing block at the end of a string. * Allows optional trailing whitespace after the closing tag. */ export declare const TRAILING_SMOOSH: RegExp; /** * Sub-step 1: smoosh-split * * Peel trailing blocks from tool_result content into standalone text blocks. */ export declare function splitSmooshedReminders(messages: any[] | null | undefined): { messages: any[] | null | undefined; stats: { peeled: number; } | null; }; /** * Check if a text is a skills block (contains "User-invocable skills"). */ export declare function isSkillsBlock(text: any): boolean; /** * Check if a text is a deferred tools block (contains "deferred tools are now available"). */ export declare function isDeferredToolsBlock(text: any): boolean; /** * Sort skill entries within a skills block. * Expects format: header\n\n- item1\n- item2\n... */ export declare function sortSkillsBlock(text: string): string; /** * Sort tool names within a deferred tools block. * Expects format: \nThe following deferred tools...\ntool1\ntool2\n */ export declare function sortDeferredToolsBlock(text: string): string; /** * Process system array: sort skills and deferred tools blocks. */ export declare function sortSystemBlocks(system: any[] | undefined): any[] | undefined; /** * Sort tools array by name. */ export declare function sortTools(tools: any[] | undefined): any[] | undefined; /** * Strip clear artifacts from content blocks. */ export declare function stripClearArtifacts(content: any[]): any[]; /** * Check if a text block is a relocatable block (hooks, skills, deferred, or MCP). */ export declare function isRelocatableBlock(text: any): boolean; /** * Get the block type for a relocatable block. */ export declare function getBlockType(text: string): string | null; /** * Fix a block text based on its type (sort, strip session knowledge, pin). */ export declare function fixBlockText(blockType: string, text: string): string; /** * Sub-step 3: fresh-session-sort * * Strip clear artifacts from the first user message. * If there are scattered relocatable blocks outside the first user message, * relocate them to the first user message in deterministic order. * Otherwise, sort and pin blocks in-place. */ export declare function freshSessionSort(messages: any[]): void; /** * Check if a block is a "Continue from where you left off." trailer. */ export declare function isContinueTrailerBlock(block: any): boolean; /** * Check if a text is a bookkeeping reminder (match any bookkeeping pattern). */ export declare function isBookkeepingReminder(text: any): boolean; /** * Sub-step 4: content-strip * * Strip continue trailers and bookkeeping reminders from user messages. */ export declare function stripContentBlocks(messages: any[] | null | undefined): { messages: any[] | null | undefined; stats: { trailerCount: number; reminderCount: number; } | null; }; /** * Main Claude Code Cache interceptor. * Combines all 4 sub-steps in order: * 1. smoosh-split: peel system-reminders from tool_result content * 2. sort-stabilization: sort skills, deferred tools, and tool definitions * 3. fresh-session-sort: relocate, sort, and pin blocks in first user message * 4. content-strip: remove continue trailers and bookkeeping reminders */ export declare const claudeCodeCache: UpstreamInterceptor; //# sourceMappingURL=claude-code-cache.d.ts.map