import type { CompactLifecycleRead, CompactLifecycleRecord, CompactLifecycleStage } from './compact-lifecycle-types.js'; export type { CompactLifecycleRead, CompactLifecycleRecord, CompactLifecycleStage }; /** * Atomically write a compact lifecycle record. Uses a temp file in * the same directory plus `renameSync`, so a crash mid-write never * leaves a half-written record (atomic on POSIX, near-atomic on * Windows — same contract `24h-mode/store.ts` and * `session-checkpoint-service.ts` use). * * Side effects: * - creates `/` if missing * - clamps `errorSummary` to 160 characters (longer strings are * truncated at the head, not padded) * - removes the temp file on rename failure (best effort) * * Throws on I/O failure or validation rejection; the caller decides * whether to retry / log / surface to the user. */ export declare function writeCompactLifecycle(input: { readonly projectRoot: string; readonly sessionId: string; readonly record: CompactLifecycleRecord; }): void; /** * Read a compact lifecycle record and classify it. * * Return kinds: * - `missing` — no record has ever been written for this session * - `valid` — record parsed and validated; stage is terminal * (completed/failed), resting (`armed`) OR is active * but still fresh * - `invalid` — file exists but is malformed / wrong schema / out * of range. `reason` is a single-line English message * (no CLI verbs, no stack traces). The caller MUST * surface this to a human — we never silently turn * a corrupted record into `missing`. * - `stalled` — record is valid and is currently an ACTIVE stage, * but `updatedAt` is older than `staleAfterMs` (a * heartbeat that never arrived). Terminal stages * never go stalled. */ export declare function readCompactLifecycle(input: { readonly projectRoot: string; readonly sessionId: string; readonly nowMs: number; readonly staleAfterMs: number; }): CompactLifecycleRead;