import type { SKYKOIConfig } from "../config/config.js"; export declare const CONTEXT_WINDOW_HARD_MIN_TOKENS = 16000; export declare const CONTEXT_WINDOW_WARN_BELOW_TOKENS = 32000; /** * Absolute context-token cap for auto-compaction. All catalog smart models * ship 1M-token windows; without a cap, compaction only kicks in relative to * the full window. The effective window used for compaction thresholds and * summarization budgets is min(model contextWindow, this cap). Override via * `kois.defaults.compaction.autoCompactTokens`. */ export declare const DEFAULT_AUTO_COMPACT_TOKENS = 500000; export type ContextWindowSource = "model" | "modelsConfig" | "koiContextTokens" | "autoCompactTokens" | "default"; export type ContextWindowInfo = { tokens: number; source: ContextWindowSource; }; /** Resolve the absolute auto-compaction token cap (config knob or 500k default). */ export declare function resolveAutoCompactTokenCap(cfg?: SKYKOIConfig): number; /** * Clamp a model's advertised context window to the auto-compaction cap. * * Pi's internal auto-compaction trigger (`shouldCompact`: contextTokens > * model.contextWindow - reserveTokens) reads the model object passed to * `createAgentSession`, so capping here makes the embedded runtime compact at * the absolute cap without patching pi. Returns the model unchanged when its * window is already at or below the cap. */ export declare function capModelContextWindowForAutoCompact(model: T, cfg?: SKYKOIConfig): T; export declare function resolveContextWindowInfo(params: { cfg: SKYKOIConfig | undefined; provider: string; modelId: string; modelContextWindow?: number; defaultTokens: number; }): ContextWindowInfo; export type ContextWindowGuardResult = ContextWindowInfo & { shouldWarn: boolean; shouldBlock: boolean; }; export declare function evaluateContextWindowGuard(params: { info: ContextWindowInfo; warnBelowTokens?: number; hardMinTokens?: number; }): ContextWindowGuardResult;