import type { KernelPacket } from "./kernel-packet.js"; /** * Compaction preservation packet — the minimal subset of session context * retained across compaction boundaries. Strips deep-module fields * (codemap, tool calls, etc.) that are expensive to carry forward. */ export type CompactionPreservationPacket = { packet_version: string; packet_type: "compaction"; session_id: string; parent_session_id: string | null; root_session_id: string | null; title: string; description: string; purpose_category: string | null; agent_type: string | null; model: string | null; constraints: string[]; non_goals: string[]; session_status: string; contract_status: string | null; lifecycle_phase: string; delegation_depth: number; queue_key: string | null; run_mode: string | null; todo_authority: "read" | "write" | "none" | null; return_contract: string | null; preserved_at: string; }; /** * Extra fields that belong to delegation context (not present on KernelPacket). * Passed as an optional second argument to {@link toCompactionPacket}. */ export type CompactionExtras = { /** Delegation-level todo authority. */ todo_authority?: "read" | "write" | "none" | null; /** Delegation-level return contract reference. */ return_contract?: string | null; }; /** * Convert a kernel packet into a compaction preservation packet. * * @param kernel - The source kernel packet. * @param extras - Optional delegation-level fields not present on KernelPacket. * @returns A compaction preservation packet with stripped-down context. */ export declare function toCompactionPacket(kernel: KernelPacket, extras?: CompactionExtras): CompactionPreservationPacket; /** * Restore a kernel packet from a compaction preservation packet. * * Fields that exist only on CompactionPreservationPacket (non_goals, * contract_status, todo_authority, return_contract) are intentionally * not mapped back because KernelPacket does not define them. * * @param compact - The compaction preservation packet to restore from. * @param base - The base kernel packet providing stripped fields. * @returns A kernel packet with restored compaction fields. */ export declare function fromCompactionPacket(compact: CompactionPreservationPacket, base: KernelPacket): KernelPacket; //# sourceMappingURL=compaction-preservation.d.ts.map