/** * Type definitions for prompt caching integration */ export interface CacheConfig { enabled: boolean; provider: 'anthropic' | 'openai' | 'auto'; ttl?: '5min' | '1hour'; cacheStaticPrompts: boolean; minCacheableTokens?: number; } export interface CachedContent { staticPrefix: string; dynamicContent: string; cacheBreakpoint: boolean; cacheMetadata?: CacheMetadata; } export interface CacheMetadata { provider: 'anthropic' | 'openai'; estimatedCacheSize: number; cacheKey?: string; ttl?: string; } export interface CacheMetrics { cacheHits: number; cacheMisses: number; cacheHitRate: number; estimatedCacheSavings: number; totalCacheableTokens: number; averageCacheReuseCount: number; } /** * Anthropic message content block format */ export interface AnthropicContentBlock { type: 'text'; text: string; cache_control?: { type: 'ephemeral'; }; } /** * OpenAI structured message format */ export interface OpenAIMessageFormat { system: string; user: string; } /** * Union type for provider-specific cache structures */ export type CacheStructure = AnthropicContentBlock[] | OpenAIMessageFormat; export interface CacheStrategy { name: string; shouldCache: (content: string, tokens: number) => boolean; formatCacheStructure: (content: CachedContent) => CacheStructure; } /** * LRU Cache Configuration */ export interface LRUCacheConfig { enabled: boolean; maxSize: number; ttl: number; persistent: boolean; persistPath?: string; } /** * LRU Cache Entry */ export interface LRUCacheEntry { key: string; value: T; timestamp: number; lastAccessed: number; accessCount: number; expiresAt: number; } /** * LRU Cache Statistics */ export interface LRUCacheStats { hits: number; misses: number; evictions: number; expirations: number; currentSize: number; maxSize: number; hitRate: number; averageAccessCount: number; } //# sourceMappingURL=cache-types.d.ts.map