/** * Writing a canonical session into a new Pi session file (FR-41). * * Two shapes were deliberately not used: * * - a `compaction` entry for a summary turn. Pi's `buildContextEntries` treats the latest * compaction as authoritative and drops everything before its `firstKeptEntryId`, so a * summary written that way would hide every imported turn from the model. * - a `toolCall` content block for a tool-call turn. Pi — and the provider behind it — * expects a matching `toolResult`, and FR-24 dropped the body that result would need. * An imported tool call is therefore one assistant text entry carrying its outcome line, * which also gives T-PI-4 its "one message entry per canonical turn". */ import type { CanonicalSession, ProvenanceMarker, SerializedSession, TargetProfile } from "./contract.js"; export interface PiSerializeDeps { /** The repository the new session belongs to. Pi buckets its sessions by it. */ cwd(): string; now(): Date; newSessionId(): string; newEntryId(): string; } export declare function serializeSession(session: CanonicalSession, target: TargetProfile, marker: ProvenanceMarker, deps: PiSerializeDeps): SerializedSession;