import type { InteractiveMessage } from '../../../../../../packages/core/src/domain/generated/output.js';
export interface TurnGroupView {
    id: string;
    title: string;
    userMessagePreview: string;
    messageIds: string[];
    assistantMessageCount: number;
    startedAt: number;
    endedAt: number;
    status: 'completed' | 'in-progress';
}
export interface TurnGroupsView {
    groups: TurnGroupView[];
    currentTurn: TurnGroupView | null;
    hiddenMessageIds: string[];
}
/**
 * Client-side turn grouping — mirrors
 * `GetChatTurnGroupsUseCase` so the web view has no stale-query
 * window. Step-tagged messages are ignored (they live inside the
 * StepTracker). Every non-step-tagged user message opens a new
 * turn; the subsequent non-step assistant messages attach to it
 * until the next user message.
 *
 * The LATEST turn becomes `currentTurn` (status `in-progress`)
 * ONLY when `isAgentBusy` is true — i.e. the chat runtime reports
 * live streaming, tool activity, or a pending-response awaiting
 * state. Otherwise the latest turn is demoted to `completed` so a
 * finished conversation doesn't leave a permanent "Working on
 * your request…" card pretending work is still happening.
 */
export declare function computeTurnGroupsFromMessages(messages: readonly InteractiveMessage[], isAgentBusy?: boolean): TurnGroupsView;
/** Live streaming state the in-progress card pins at its bottom edge. */
export interface TurnStreamingState {
    /** Persisted streaming text or the live SSE delta, whichever is longer. */
    text: string;
    /** Short "Reading file X" style indicator from tool events. */
    statusLog: string | null;
    /** True while we're between send and first delta. */
    awaiting: boolean;
    /** "booting" / "idle" / etc. */
    sessionStatus: string | null;
}
/**
 * useTurnGroupsView — the client-side grouping hook consumed by
 * `CurrentTurnCard` and `CompletedTurnGroupsList`. It folds the raw
 * message stream into the same shape the server use case returns,
 * but runs on every render so the UI is always optimistic against
 * the chat-state cache (no stale-query window).
 *
 * `isAgentBusy` controls whether the latest turn gets promoted to
 * `currentTurn` (in-progress fuchsia card) or stays as the last
 * `completed` card in the chronological list. Pass the chat
 * runtime's `status.isRunning` flag so finished conversations
 * never leave a stale "Working on your request…" surface pinned.
 */
export declare function useTurnGroupsView(messages: readonly InteractiveMessage[], isAgentBusy: boolean): TurnGroupsView;
export interface CurrentTurnCardProps {
    /** Pre-computed groups view (from `useTurnGroupsView`). */
    view: TurnGroupsView;
    /** Raw messages, used to hydrate the card children. */
    allMessages: readonly InteractiveMessage[];
    /** Live streaming state pinned at the bottom of the card. */
    streaming: TurnStreamingState;
}
/**
 * The in-progress "Working on your request…" card for the latest
 * user turn. Always renders at the chronological tail of the
 * timeline — never pinned at the top — so the conversation reads
 * top-to-bottom: setup → completed turns → current turn.
 */
export declare function CurrentTurnCard({ view, allMessages, streaming }: CurrentTurnCardProps): import("react/jsx-runtime").JSX.Element | null;
/**
 * Renders a SINGLE turn group (completed or in-progress) as a
 * standalone card. Used by `ChatTab` when it builds the unified
 * chronological timeline — the timeline interleaves user turns
 * with publish/deploy operation bubbles by `startedAt`, so each
 * turn has to be renderable on its own at an arbitrary position.
 *
 * The in-progress variant requires `streaming` so the live card
 * keeps its condensed "Thinking…" / "Working…" indicator. When the
 * agent finishes, the caller flips `status` to `completed` on the
 * SAME turn id and the card stays in place — React key stability
 * ensures no unmount / remount, matching the user's expectation
 * that "Working on" becomes a completed card without relocating.
 */
export declare function SingleTurnCard({ group, allMessages, streaming, }: {
    group: TurnGroupView;
    allMessages: readonly InteractiveMessage[];
    streaming?: TurnStreamingState;
}): import("react/jsx-runtime").JSX.Element;
export interface CompletedTurnGroupsListProps {
    /** Pre-computed groups view (from `useTurnGroupsView`). */
    view: TurnGroupsView;
    /** Raw messages, used to hydrate card children. */
    allMessages: readonly InteractiveMessage[];
}
/**
 * The list of COMPLETED, collapsed-by-default turn group cards.
 * Rendered chronologically between the StepTracker and the
 * in-progress card so the whole conversation reads top-to-bottom.
 */
export declare function CompletedTurnGroupsList({ view, allMessages }: CompletedTurnGroupsListProps): import("react/jsx-runtime").JSX.Element | null;
//# sourceMappingURL=turn-group-list.d.ts.map