import type { Compactor } from '../types/compactor.js'; import type { OneShotOrchestrator } from './one-shot-llm.js'; export type CompactorStrategy = 'hybrid' | 'intelligent' | 'selective'; export interface StrategyCompactorOptions { /** Which compactor to use. Defaults to 'hybrid' (lossless, no LLM). */ strategy?: CompactorStrategy | string | undefined; /** Recent user/assistant pairs to always preserve. */ preserveK?: number | undefined; /** Token threshold below which tool results are not elided. */ eliseThreshold?: number | undefined; /** * Enable content-aware smart digest for 'hybrid' strategy. When true, * collapsed ancient turns use buildSmartDigest: critical content (errors, * corrections, decisions) stays verbatim; normal exchanges get first-sentence * summaries; noise (repeated failures, large tool outputs) is aggressively * compressed. Defaults to false (lossless digest). */ smart?: boolean | undefined; /** Model used by the LLM-backed strategies for summarization/selection. */ summarizerModel?: string | undefined; /** Max output tokens for the selector LLM call in 'selective' strategy (default: 1024). */ selectorMaxOutputTokens?: number | undefined; /** * Legacy shortcut for `strategy: 'selective'`. When `strategy` is unset (or * 'hybrid') and this is true, the selective (LLM-driven) compactor is used. * An explicit `strategy` always wins. */ llmSelector?: boolean | undefined; /** * OneShotOrchestrator for LLM-backed compaction summarization. When set, * the intelligent/selective compactor uses it instead of direct provider * calls, gaining fallback chain support and a cheap default model. */ oneShotOrchestrator?: OneShotOrchestrator | undefined; } /** * Build the compactor named by `config.context.strategy`. * * - `hybrid` (default): lossless rule-based — no provider needed. * - `intelligent` / `selective`: LLM-backed. These need a `provider`, which is * only known per-run, so we return a thin wrapper that resolves the concrete * compactor from `ctx` at `compact()`-time. This deliberately avoids the * container/provider construction-ordering problem: `TOKENS.Compactor` is * resolved (and memoized) before `context.provider` exists, but `ctx.provider` * is always present once a run is actually compacting. If no provider is * available at compact-time the wrapper degrades to the lossless hybrid rules * rather than failing. */ export declare function createStrategyCompactor(opts?: StrategyCompactorOptions): Compactor; //# sourceMappingURL=strategy-compactor.d.ts.map