/** * ADR 0009 / #241: muse's compaction signal, read from the MSP view. * * `muse exec --json` emits NOTHING on a successful compaction - a turn that * compacted 68,376 tokens to 22,388 produced a stdout stream identical, * record for record, to a turn that compacted nothing. The signal lives on * the `muse serve` MSP view, which hcn already attaches to for the approval * observer (docs/research/2026-09-22-compaction-signals/muse). * * Compaction is a first-class view item, emitted as a started/completed * pair. Only the terminal half carries an outcome, so only the terminal * half reports: muse announces `compacted`, `noop`, `failed` and `aborted`, * and never a `started`. * * Pure: this module maps one view item to one event and decides nothing * about polling, cursors or process lifecycle. The observer in * src/execution/muse-approvals.ts owns those. */ import type { CompactionState, CompactionTrigger } from "../knowledge/descriptor.js"; /** One terminal compaction item, normalized. `itemId` is the view's own * identity for the compaction; a caller dedupes on it so one compaction * reports once across repeated pages. */ export interface MuseCompaction { readonly itemId: string; readonly state: CompactionState; readonly trigger?: CompactionTrigger; readonly tokensBefore?: number; readonly tokensAfter?: number; readonly detail?: string; } /** * One MSP view item to one compaction, or null when the item is not a * terminal compaction. Null covers three cases a caller treats alike: a * non-compaction item, the `inProgress` half of the pair, and an outcome * word this version has no arm for. */ export declare const museCompactionOf: (value: unknown) => MuseCompaction | null; /** * Every terminal compaction on one `view/page` reply, in view order, with * the page's next cursor. A reply hcn cannot read returns null, which the * caller treats as a skipped sample rather than a verdict - the view fold * is additive to the approval observer and never decides a turn. */ export interface MuseViewPage { readonly compactions: readonly MuseCompaction[]; readonly nextCursor: string | null; } export declare const museViewPageOf: (result: unknown) => MuseViewPage | null; //# sourceMappingURL=muse-compaction.d.ts.map