import type { TurnSummaryStatus } from "./turn-summary-model.js"; import type { ActivityItem, TimelineGroup, ToolCallItem } from "./types.js"; import { type OpenGeniText } from "../messages/runtime.js"; export type ActivityGroup = Extract; export type TurnGroup = Extract; export declare function durationBetween(startedAt: string, endedAt: string): number | undefined; /** Compaction landmarks among a fold's groups (secondary summary facet). */ export declare function compactedLandmarkCount(groups: readonly TimelineGroup[]): number; export declare function clusterIsSettled(group: ActivityGroup): boolean; export declare function flattenActivityItems(groups: readonly TimelineGroup[]): ActivityItem[]; export type ReadableWorkOptions = { /** Host shows startup phases as ordinary details (web: startup-details context). */ startupDetails: boolean; /** Startup chrome was dismissed by the reader. */ startupDismissed: boolean; }; /** * A readable turn whose only work so far is environment preparation renders as one quiet * preparation surface instead of a "Working" fold. */ export declare function isPreparingWork(group: ActivityGroup, options: ReadableWorkOptions): boolean; /** * Whether a readable turn's work row has anything to reveal when expanded. * Unless the host shows startup phases as details, the work row's rail only * renders failed or cancelled preparation steps, so a detail made only of * completed or still-running steps (for example the queue phase before a turn * was parked on a usage limit) renders nothing and does not make the row * expandable. */ export declare function readableWorkHasDetails(group: ActivityGroup & { work: NonNullable; }, options: Pick): boolean; /** * Status of a readable turn's work row, minus the host-rendered live preview. * Time spent waiting for model capacity is not work: the worked duration and * the live working clock exclude it, and the wait itself shows no clock. A * wait's `detail` is its one quiet secondary line. */ export declare function readableWorkStatus(t: OpenGeniText, group: ActivityGroup & { work: NonNullable; }): Omit & { detail?: string | undefined; }; /** Whether a readable turn's work fold starts expanded. */ export declare function readableWorkDefaultOpen(group: ActivityGroup): true | undefined; /** Whether the live preview should show (images stay primary output instead). */ export declare function readableWorkShowsPreview(group: ActivityGroup): boolean; /** * The step a rolling preview shows: steps advance with event order (progress notes and * startup phases have their own surfaces). Mirrors the web RollingActivity selection. */ export declare function rollingActivityItem(items: readonly ActivityItem[], previousItem?: ActivityItem, mounted?: boolean): { item: ActivityItem; running: boolean; earlierCount: number; } | null; export declare function isToolCall(item: ActivityItem): item is ToolCallItem;