/** * PreCompact hook handler — auto-writes a work-handoff right before the * context window is summarized away. * * Rules: * - Only when an increment is active (nothing to hand off otherwise). * - Hard 5 s budget: the builder dumps a git diff; a slow repo must never * stall compaction. On timeout the write is abandoned and `{}` returned. * - With 2+ active increments, the one this session or SpecWithCode thread * works on is used (its work marker, then its thread binding); the first * active one only when neither names an active increment here. * - Never blocks compaction; always returns `{}`. * * @module core/hooks/handlers/pre-compact */ import type { HandlerFn, HookContext, HookInput } from './types.js'; export declare const HANDOFF_BUDGET_MS = 5000; /** * The active increment this session works on: its work marker, then its * SpecWithCode thread binding, then the first active increment. A handoff for * another thread's increment would resume the wrong work. */ export declare function handoffIncrement(active: string[], projectRoot: string, input: HookInput, opts?: { env?: NodeJS.ProcessEnv; home?: string; }): string | undefined; /** * Write a handoff for this session's active increment within `budgetMs`. * Never throws. */ export declare function writeAutoHandoff(context: HookContext, input: HookInput, defaultReason: string, budgetMs?: number): Promise; export declare const handle: HandlerFn; //# sourceMappingURL=pre-compact.d.ts.map