import { type WireMessage } from "../statelog/wireAccessors.js"; import type { Round } from "./timeline/rounds.js"; export type { WireMessage, ToolCallRequest } from "../statelog/wireAccessors.js"; export type HistoryRewrite = { messagesBefore: number; messagesAfter: number; tokensBefore: number; tokensAfter: number; /** Position of the first message that differs from the previous round. */ firstChangedAt: number; }; export type RoundDelta = { roundId: string; /** The round this one was compared with: the last on the same thread * at the same tool path, else the last on the thread. Undefined for * the first round on a thread. */ previousRoundId: string | undefined; added: WireMessage[]; rewrite?: HistoryRewrite; }; export declare function messagesOf(round: Round): WireMessage[]; /** Messages compare as the text the model sees. A tool result saved as a * value (an array of records, say) and the same result rebuilt as its * JSON text are one message, because smoltalk turns any non-string * content into `JSON.stringify` of it before a provider sees it. smoltalk * PR #70 exports that rule as `contentToString`; `contentKey` restates it * until the pinned smoltalk carries the export, then should import it. */ export declare function messageKey(message: WireMessage): string; /** A sub-agent that runs on its caller's thread extends the caller's * messages, and the caller continues from its own last call afterwards, * not from the sub-agent's. So a round compares with the last round on * its thread at the same tool path, and only a thread's first round at a * path compares with the thread's last round anywhere. */ export declare function roundDeltas(rounds: Round[]): RoundDelta[];