/** * auto-compact dispatch. Appended at the end of `executeAutoCompact` * so the new 'peaks compact history' CLI + the * 'peaks statusline compact' indicator have a record. One file * per session (gitignored under `.peaks/_runtime//`). */ export interface CompactHistoryEvent { readonly schemaVersion: 1; readonly ts: string; readonly target: 'main' | 'sub-agent' | 'worker'; /** * The profile the run used. `eager` is the canonical name of the * earlier-firing profile; `partial` is its legacy alias and is still * accepted so an old row can be read; `aggressive` predates both. */ readonly mode: 'standard' | 'partial' | 'aggressive' | 'eager'; readonly ide: string; readonly pathway: string; readonly beforeRatio: number; readonly redLine: boolean; readonly ok: boolean; readonly checkpointPath: string; readonly dispatchMessage: string; /** * instrument. `windowTokens` is the denominator peaks-loop divided by * (`probe.capacityTokens`), so `beforeRatio * windowTokens` is the exact * TOKEN POINT peaks-loop asked the harness to compact at. That number is * the deliverable — NOT a hand-picked threshold: this slice could not run a * real Claude Code session, so the real trigger point of * `CLAUDE_CODE_AUTO_COMPACT_WINDOW` (documented as a window, observed to * fire near the window's end) has no measured answer yet. Recording the * intent lets the first real session produce one. */ readonly windowTokens?: number | null; /** Which layer produced `windowTokens` (see `ContextWindowSource`). */ readonly windowSource?: string | null; /** * `dispatch` (default, and the only kind earlier releases wrote) or * `observed` — a row appended when a later probe MEASURED the ratio after * a dispatched compact, proving one landed. The pair is what yields the * intent-vs-observed delta. */ readonly kind?: 'dispatch' | 'observed'; /** `observed` rows only: the measured post-compact ratio. */ readonly afterRatio?: number; } export declare function appendCompactHistoryEvent(input: { readonly projectRoot: string; readonly sessionId: string; readonly event: CompactHistoryEvent; }): void;