/** * PreCompact Hook - State Preservation Before Context Compaction * * Creates checkpoints before compaction to preserve critical state including: * - Active mode states (autopilot, ralph, ultrawork, swarm) * - TODO summary * - Wisdom from notepads * * This ensures no critical information is lost during context window compaction. */ export interface PreCompactInput { session_id: string; transcript_path: string; cwd: string; permission_mode: string; hook_event_name: "PreCompact"; trigger: "manual" | "auto"; custom_instructions?: string; } export interface CompactCheckpoint { created_at: string; trigger: "manual" | "auto"; active_modes: { autopilot?: { phase: string; originalIdea: string; }; ralph?: { iteration: number; prompt: string; }; ultrawork?: { original_prompt: string; }; swarm?: { session_id: string; task_count: number; }; ultrapilot?: { session_id: string; worker_count: number; }; ecomode?: { original_prompt: string; }; pipeline?: { preset: string; current_stage: number; }; ultraqa?: { cycle: number; prompt: string; }; }; todo_summary: { pending: number; in_progress: number; completed: number; }; wisdom_exported: boolean; } export interface HookOutput { continue: boolean; /** System message for context injection (Claude Code compatible) */ systemMessage?: string; } /** * Get the checkpoint directory path */ export declare function getCheckpointPath(directory: string): string; /** * Export wisdom from notepads to checkpoint */ export declare function exportWisdomToNotepad(directory: string): Promise<{ wisdom: string; exported: boolean; }>; /** * Save summary of active modes */ export declare function saveModeSummary(directory: string): Promise>; /** * Create a compact checkpoint */ export declare function createCompactCheckpoint(directory: string, trigger: "manual" | "auto"): Promise; /** * Format checkpoint summary for context injection */ export declare function formatCompactSummary(checkpoint: CompactCheckpoint): string; /** * Main handler for PreCompact hook */ export declare function processPreCompact(input: PreCompactInput): Promise; export default processPreCompact; //# sourceMappingURL=index.d.ts.map