/** * The PUBLIC auto-compact profiles. * * Two profiles, and BOTH are public: any project, in any mode, can pick * either one. Nothing here belongs to the 24h long-run mode any more — a * profile is a THRESHOLD choice, not a mode. * * `'standard'` keeps the v2.13.0 zero-pause contract thresholds * (autoFire=0.80, preCompact=0.85, redLine=0.95). * * `'eager'` fires EARLIER (autoFire=0.65, preCompact=0.70, redLine=0.85). * * WHY THE NAME CHANGED. The profile used to be called `'partial'`, and that * name promised a behaviour this product does not have: there is NO * partial-compaction pathway — the profile only moves the THRESHOLDS at * which the orchestrator fires. A public name that promises behaviour the * product does not implement is a lie in the CLI surface, so the profile is * named after what it actually does: it fires earlier. `'partial'` stays * ACCEPTED as a compatibility alias — `--mode partial` is a published CLI * surface, and dropping it would break existing callers harder than a * no-op — and `normalizeAutoCompactMode` is the ONE place that maps it onto * `'eager'`. * * `autoFire` tier is added between soft-warn and preCompact. peaks-loop * preempts and runs `peaks code auto-compact` itself when * context crosses `autoFire`; the LLM is NOT asked to "decide" * (the LLM-judged 0.85–0.95 zone was the source of false-positive * "context too low" reports at 60%+ free — the LLM was guessing). */ /** The canonical profile names. */ export type AutoCompactProfile = 'standard' | 'eager'; /** * Every mode name this build ACCEPTS. * * `'partial'` is the legacy alias of `'eager'`. It stays in the type so a * caller that still passes it keeps compiling, and it is collapsed to * `'eager'` by `normalizeAutoCompactMode` before anything is stored or * reported — the alias is a spelling, never a second profile. */ export type AutoCompactMode = AutoCompactProfile | 'partial'; /** The canonical profile names, in the order the CLI lists them. */ export declare const AUTO_COMPACT_PROFILES: readonly AutoCompactProfile[]; export interface AutoCompactThresholds { readonly autoFire: number; readonly preCompact: number; readonly redLine: number; } /** * The threshold table. `partial` is the legacy alias and points at the SAME * row as `eager` — the numbers are written once, so the alias cannot drift * away from the profile it names. */ export declare const AUTO_COMPACT_THRESHOLDS: Readonly>; /** * Normalize a mode name to its canonical profile, or `null` when the name is * not a mode this build knows. * * This is the single entry point for the alias mapping: `'partial'` in, * `'eager'` out, and every caller that needs the canonical name goes * through here. */ export declare function normalizeAutoCompactMode(value: string): AutoCompactProfile | null; /** True when `value` names a mode this build accepts (a canonical name or the legacy alias). */ export declare function isValidMode(value: string): value is AutoCompactMode; /** The threshold a mode fires at. */ export declare function thresholdFor(mode: AutoCompactMode, kind: 'autoFire' | 'preCompact' | 'redLine'): number; /** * Human-readable form of a profile's threshold row. * * Derived from `AUTO_COMPACT_THRESHOLDS` rather than hand-written. Diagnosis * 2026-09-15 (C1) found this string advertising `0.85/0.95` for `standard` * while the table had auto-fired at `0.80` since slice * description named only the two thresholds that were left over from the * v2.13.0 contract, and skipped the one that actually fires. Reading the * numbers out of the table makes that drift unrepresentable. */ export declare function describeMode(mode: AutoCompactMode): string; /** True when the context percentage has reached the `eager` profile's pre-compact line. */ export declare function isEagerModeEligible(contextPercent: number): boolean; /** * @deprecated The profile was renamed; `eager` is the canonical name. Kept * so an existing caller keeps working — it now means the same thing. */ export declare const isPartialModeEligible: typeof isEagerModeEligible;