/** * kosha-discovery — Context-management strategy advisor. * * Pure synthesis over the model + provider catalog: given where a caller is * in their conversation, return ranked options (continue / cache / compact / * switch model / long-context tier / batch offload) with rough cost math. * * No tokenization, no model inference — just arithmetic over the registry. * @module */ import type { ModelCard, ProviderCacheBehavior } from "./types.js"; export interface ContextStrategyInput { model: ModelCard; currentTokens: number; expectedRemainingTurns?: number; expectedOutputTokens?: number; candidateAlternatives?: ModelCard[]; } export interface ContextSituation { tokensUsed: number; contextWindow: number; headroomTokens: number; headroomPercent: number; inLongContextTier: boolean; longContextThresholdTokens?: number; } export interface StrategyOption { strategy: "continue" | "enable_prompt_cache" | "compact_and_continue" | "switch_to_long_context_tier" | "switch_model" | "batch_offload"; viable: boolean; costPerTurnUsd?: number; savingsPerTurnUsd?: number; notes: string; details?: Record; } export interface ContextStrategy { model: { id: string; provider: string; contextWindow: number; }; situation: ContextSituation; cacheBehavior?: ProviderCacheBehavior; options: StrategyOption[]; recommended: StrategyOption["strategy"]; } /** Compute ranked context-management options for the given conversation state. */ export declare function computeContextStrategy(input: ContextStrategyInput): ContextStrategy; //# sourceMappingURL=context-strategy.d.ts.map