/** * Cache Optimizer: Structures content for prompt caching */ import type { CacheConfig, CachedContent, CacheMetrics } from './cache-types.js'; export declare class CacheOptimizer { private config; private metrics; constructor(config?: Partial); /** * Wrap optimized TOON content with cache-friendly structure */ wrapWithCaching(toonContent: string, toolName: string, format: 'json' | 'csv' | 'yaml', originalTokens: number, optimizedTokens: number): CachedContent; /** * Create cacheable static prefix with TOON format instructions */ private createStaticPrefix; /** * Format TOON output with metadata */ private formatTOONOutput; /** * Format for Anthropic cache_control API */ formatForAnthropic(cached: CachedContent): Array<{ type: string; text: string; cache_control?: { type: string; }; }>; /** * Format for OpenAI (structured but no explicit cache control) */ formatForOpenAI(cached: CachedContent): { system: string; user: string; }; /** * Get current cache metrics */ getMetrics(): CacheMetrics; /** * Record a cache hit (when static prefix is reused) */ recordCacheHit(savedTokens: number): void; /** * Record a cache miss (when static prefix is not cached) */ recordCacheMiss(): void; /** * Update cache hit rate */ private updateHitRate; /** * Reset metrics */ resetMetrics(): void; } //# sourceMappingURL=cache-optimizer.d.ts.map