import type { TMessageContentParts } from './types/assistants'; import type { TFile } from './types/files'; import type { TMessage } from './types'; /** A generated reasoning title describes the text as it existed at generation time. * Any manual edit or merge into a different reasoning step invalidates the entire * title revision domain while preserving unrelated content metadata. */ export declare function stripReasoningLabelMetadata(part: TMessageContentParts): TMessageContentParts; export type ParentMessage = TMessage & { children: TMessage[]; depth: number; }; /** * Builds the render tree from the flat messages array. Order-robust: live * stream/steer/preempt cache writes can momentarily place a child before its * parent, and a single-pass link would hoist such rows into phantom root * branches — folding the visible thread to one dangling branch until a * refetch restores creation order. Linking happens only after every message * is indexed, so array order never changes the tree shape. */ export declare function buildTree({ messages, fileMap, }: { messages: (TMessage | undefined)[] | null; fileMap?: Record; }): TMessage[] | null; /** The message with this id, resolved through the array's memoized index. */ export declare function findMessageById(messages: (TMessage | undefined)[] | null | undefined, messageId?: string | null): TMessage | undefined; /** * True when a turn carries the marker the server stamps on a manual compaction: * `markCompactionSummary` sets `initiatedBy: 'user'` on the summary a Compact * action produced, and nothing else writes it, so an automatic summary detour is * not one. This is the compaction's own identity, independent of where it hangs: * Compact runs on whatever leaf the branch ends with, so its response can parent * onto a user message as easily as onto the answer it summarized. Redoing one is * the context indicator's Compact action, never a rerun of the turn behind it. */ export declare function isUserInitiatedCompaction(message?: Pick | null): boolean; /** * True when a message is a finished manual compaction: every content part is a * summary and at least one of them carries text. A part that is still streaming * or that failed contributes no text of its own, so an interrupted compaction * can be retried. */ export declare function isCompactedLeaf(message?: Pick | null): boolean;