/** * One `task.agentCompactionThresholdOverrides` or `compaction.modelThresholds` * entry: a positive token count (`90000`) or a percentage string (`"80%"`). * Model entries also accept a fixed token trigger (`"f90000"`). `null` clears * an entry inherited from a lower-priority settings layer. */ export type AgentCompactionThresholdOverride = number | string | null; /** Both compaction threshold fields, as consumed by `compaction.thresholdPercent`/`compaction.thresholdTokens`. */ export interface CompactionThresholdPair { thresholdPercent: number; thresholdTokens: number; /** * Model entries only: `thresholdTokens` is the exact trigger (`"f90000"`) * instead of the base the configured policy scales (see * {@link applyModelCompactionThreshold}). Agent entries are always triggers. */ fixed?: true; } /** Validate the exact-agent compaction threshold map and normalize each entry to both threshold fields. */ export declare function validateAgentCompactionThresholdOverrides(value: unknown): Record; /** * Validate `compaction.modelThresholds`: keys are an exact `provider/model-id` * or a `*`-terminated prefix of one (`deepseek/*`, `openrouter/anthropic/*`). */ export declare function validateModelCompactionThresholds(value: unknown): Record; /** The `compaction.modelThresholds` entry governing one model. */ export interface ModelCompactionThresholdMatch { /** The entry's key: the exact `provider/model-id`, or the longest matching `…*` prefix. */ key: string; threshold: CompactionThresholdPair; } /** * The `compaction.modelThresholds` entry for `model`: an exact `provider/model-id` * key wins, else the longest `*`-terminated prefix matching it. */ export declare function matchModelCompactionThreshold(raw: unknown, model: { provider: string; id: string; }): ModelCompactionThresholdMatch | undefined; /** One persisted `compaction.modelThresholds` value (`400000`, `"f400000"`, `"80%"`) as its threshold pair. */ export declare function parseModelCompactionEntry(entry: unknown): CompactionThresholdPair | undefined; /** * `settings` with one model entry applied. A token entry is the base the * configured policy scales (`baseWindowTokens`, standing in for the window: * `thresholdPercent` of it, else it minus the reserve) and drops a global fixed * `thresholdTokens`; a fixed entry (`"f90000"`) is the exact trigger; a * percentage entry replaces both threshold fields. */ export declare function applyCompactionThresholdPair(settings: T, threshold: CompactionThresholdPair): T; /** * `settings` with the `compaction.modelThresholds` entry governing `model` * applied ({@link applyCompactionThresholdPair}); the same object when no entry * applies. Results are cached per settings snapshot so hot paths allocate once * per entry. */ export declare function applyModelCompactionThreshold(settings: T, raw: unknown, model: { provider: string; id: string; } | null | undefined): T; /** * Parse a typed compaction point into its persisted entry: an integer token * count with an optional `k`/`m`/`b` suffix (any case) becomes a number (the * base), the same with an `f` prefix becomes a fixed trigger `"fN"`, a * percentage stays `"N%"`, and empty input is `null` (reset). Throws on * anything else. */ export declare function parseCompactionPointInput(input: string): number | string | null; /** A threshold pair as text {@link parseCompactionPointInput} reads back: `90k`, `f1500k`, `123456`, `80%`. */ export declare function formatCompactionPointInput(threshold: CompactionThresholdPair): string;