import type { CompletedItem } from "./app-items.js";
export declare function compactHistory(items: CompletedItem[]): CompletedItem[];
export declare function getNextGeneratedItemId(items: readonly Pick<CompletedItem, "id">[]): number;
export declare function removeItemsWithIds<T extends Pick<CompletedItem, "id">>(items: readonly T[], removedIds: ReadonlySet<string>): T[];
export declare function uniqueItemsById<T extends Pick<CompletedItem, "id">>(items: readonly T[]): T[];
/** Check whether an item is still active (running spinner, pending result). */
export declare function isActiveItem(item: CompletedItem): boolean;
/**
 * Partition live items into completed (flushable to finalized history) and still-active.
 * Completed items precede active ones — we flush the longest contiguous prefix
 * of completed items to keep ordering stable.
 */
export declare function partitionCompleted(items: CompletedItem[]): {
    flushed: CompletedItem[];
    remaining: CompletedItem[];
};
export declare function normalizeAssistantText(text: string): string;
export declare function isSameAssistantText(item: CompletedItem, text: string): boolean;
export declare function pinStreamingTextBeforeToolBoundary({ items, visibleStreamingText, thinking, thinkingMs, makeId, }: {
    items: CompletedItem[];
    visibleStreamingText: string;
    thinking: string;
    thinkingMs: number;
    makeId: () => string;
}): CompletedItem[];
//# sourceMappingURL=item-helpers.d.ts.map