/** * Port of the forgecode summary transformers. * * Operates on arrays of `ForgeMessage` (already converted from the opencode * payload) and mutates them in place so they can be fed into the * `summary-frame` template. * * Pipeline (matches `forge_app::transformers::SummaryTransformer`): * 1. drop(System) * 2. dedupeConsecutive(User) * 3. trimAssistant (one operation per resource) * 4. dedupeConsecutive(Assistant) * 5. stripWorkingDir */ import type { ForgeMessage, Role } from './types'; /** * Drops every message with the given role. * Mirrors `DropRole` from forgecode. */ export declare function dropRole(messages: ForgeMessage[], role: Role): ForgeMessage[]; /** * Keeps only the first message in any consecutive run of the given role, and * within that message keeps only the first content entry. * * Mirrors `DedupeRole` from forgecode (`contents.drain(1..)`). */ export declare function dedupeConsecutive(messages: ForgeMessage[], role: Role): ForgeMessage[]; /** * Within each assistant message, keep only the last tool call per * (operation-type, resource) pair. Mirrors `TrimContextSummary`. */ export declare function trimAssistant(messages: ForgeMessage[]): ForgeMessage[]; /** * Strip the working directory prefix from file paths inside tool calls. * Handles both POSIX and Windows paths so summaries remain portable. */ export declare function stripWorkingDir(messages: ForgeMessage[], workingDir: string): ForgeMessage[]; /** * Full transformer pipeline used by the compactor. */ export declare function summaryTransform(messages: ForgeMessage[], workingDir: string): ForgeMessage[]; //# sourceMappingURL=transformers.d.ts.map