import type { ImageContent, Message, TextContent } from "@bastani/pi-ai/compat"; import type { NumberedRegion } from "./compaction-types.js"; export declare const FILTERED_MARKER_RE: RegExp; export declare const LINE_NUMBER_SEPARATOR = "\u2192"; export declare const ROLE_HEADER_RE: RegExp; /** One piece of a serialized transcript: literal text, or an image kept at its position. */ export type TranscriptChunk = TextContent | ImageContent; export declare function filteredMarker(lineCount: number): string; /** Serialize provider messages using the durable verbatim-compaction section grammar. */ export declare function serializeConversationForCompaction(messages: Message[]): string; /** * Serialize retained messages without losing payloads: tool results keep their full text and * images stay as image blocks at their position in the transcript. */ export declare function serializeRetainedTranscript(messages: Message[]): TranscriptChunk[]; /** * One-based line numbers covered by `` spans, inclusive of the tag lines. * * Spans are scoped to a single message: a role header ends any span still open, and an unclosed * span protects through the end of its own message rather than the end of the region. Together * with the whole-line marker rule and the tool-result exclusion, that keeps the permissive * unclosed case safe — quoted or injected tag text costs at most its own message instead of * everything after it. Compaction that cannot reclaim is an overflow, not a safe failure. * * Nested openers flatten into the outermost span, and a closing tag with no opener is inert. */ export declare function keepContextLineNumbers(lines: readonly string[]): Set; export declare function createNumberedRegion(text: string, protectedLineNumbers?: ReadonlySet): NumberedRegion; export declare function createConversationRegion(messages: Message[], previousSummary?: string): NumberedRegion; export declare function numberRegionLines(region: NumberedRegion, start?: number, end?: number): string; //# sourceMappingURL=transcript-serialization.d.ts.map