import type { Message } from "../llm/index.js"; import type { AgentMessage } from "../loop/types.js"; /** File paths touched by a session branch or compaction range. */ export interface FileOperations { /** Files read but not necessarily modified. */ read: Set; /** Files written by full-file write operations. */ written: Set; /** Files modified by edit operations. */ edited: Set; /** * Cross-set touch order for modified files (written ∪ edited), oldest→newest — a re-touch moves * the path to the end (Set insertion-order semantics via delete-then-add). This is what lets * working-file attachments pick the MOST RECENTLY touched files instead of the first N * alphabetically (the LONGRUN-2b miss: orders.js sorted out of the top-3). */ modifiedOrder: Set; } /** Create an empty file-operation accumulator. */ export declare function createFileOps(): FileOperations; /** Add file operations from assistant tool calls to an accumulator. */ export declare function extractFileOpsFromMessage(message: AgentMessage, fileOps: FileOperations): void; /** * Compute the file lists from accumulated operations: the display lists stay SORTED (stable * summary-tag output), `modifiedFilesByRecency` carries the same modified set most-recent-FIRST * for consumers that pick a top-N (working-file attachments). */ export declare function computeFileLists(fileOps: FileOperations): { readFiles: string[]; modifiedFiles: string[]; modifiedFilesByRecency: string[]; }; /** Format file lists as summary metadata tags (each list capped at {@link FILE_LIST_MAX_ENTRIES}). */ export declare function formatFileOperations(readFiles: string[], modifiedFiles: string[]): string; /** * Inverse of {@link formatFileOperations}: strip a TRAILING file-ops footer block from a stored summary. * Every summary persisted by `compact()` ends with this footer; when a prior summary is threaded verbatim * as the history of a later split-turn compaction (bug-hunt #1), the canonical superset footer is * re-appended — so the stale embedded one must be removed first to avoid a duplicate. Anchored at end-of- * string, so a ``/`` string that legitimately appears mid-body is untouched. */ export declare function stripFileOperationsFooter(summary: string): string; /** Serialize LLM messages to plain text for summarization prompts. */ export declare function serializeConversation(messages: Message[]): string; //# sourceMappingURL=utils.d.ts.map