import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { AssistantMessage, ImageContent } from "@oh-my-pi/pi-ai"; import { type Component } from "@oh-my-pi/pi-tui"; import type { InteractiveModeContext, RenderInitialMessagesOptions, RenderSessionContextOptions, ShowStatusOptions } from "../../modes/types.js"; import type { SessionContext } from "../../session/session-context.js"; type AddMessageOptions = { imageLinks?: readonly (string | undefined)[]; reuseSettledComponent?: boolean; }; type ImageChipSessionManager = Pick; /** Chip targets for attached images: each file on disk, else a blob copy of the original bytes (or the payload). */ export declare function materializeImageChipLinks(images: readonly ImageContent[], sessionManager: ImageChipSessionManager): Promise<(string | undefined)[]>; export declare class UiHelpers { #private; private ctx; constructor(ctx: InteractiveModeContext); /** * Show a status message in the chat. * * If multiple status messages are emitted back-to-back (without anything else being added to the chat), * we update the previous status line instead of appending new ones to avoid log spam. A repeat of the * exact same text replaces the line with a fresh notice: an in-place update with identical props sends * nothing to a native terminal, so its expired toast would never show again. */ showStatus(message: string, options?: ShowStatusOptions): void; addMessageToChat(message: AgentMessage, options?: AddMessageOptions): Component[]; /** * Render session context to chat. Used for initial load and rebuild after compaction. * @param sessionContext Session context to render * @param options.updateFooter Update footer state * @param options.populateHistory Add user messages to editor history */ renderSessionContext(sessionContext: SessionContext, options?: RenderSessionContextOptions): void; /** Build a session context in bounded chunks so terminal input runs between event-loop turns. */ renderSessionContextIncrementally(sessionContext: SessionContext, options: RenderSessionContextOptions, renderChunk?: () => void): Promise; /** * Fast-path history rewind (esc-esc branch, /tree rewind to an ancestor): * drop the rendered components at/after `message` in place instead of the * destructive clear-scrollback replay. Rows already committed to native * scrollback are immutable, so the drop is expressible only while every * affected block is still wholly inside the visible window; returns false * when the caller must fall back to * `renderInitialMessages({ clearTerminalHistory: true })`. * * Callers must have already rewound the session so that `message` and * everything after it are no longer part of the view session's transcript. */ truncateTranscriptFromMessage(message: AgentMessage): boolean; /** * Rebuild the transcript from the view session. Calls run one at a time; a call * superseded by a newer one before or during its replay rolls back without * committing or clearing terminal history, so only the latest request paints. */ renderInitialMessages(options?: RenderInitialMessagesOptions): Promise; /** * Make a transcript replay still in flight rebuild its components with the current extension * text renderers and link schemes before it commits. Components take both when built, so a * change while a replay yields would otherwise stay on the committed transcript. Returns * whether a replay was in flight; the caller then leaves the redraw to it. */ restartTranscriptReplay(): boolean; clearEditor(): void; showError(errorMessage: string): void; showWarning(warningMessage: string, options?: { hideWithToolActivity?: boolean; }): void; showNewVersionNotification(newVersion: string): void; updatePendingMessagesDisplay(): void; queueCompactionMessage(text: string, mode: "steer" | "followUp", images?: ImageContent[], options?: { preserveDraft?: boolean; }): void; isKnownSlashCommand(text: string): boolean; flushCompactionQueue(options?: { willRetry?: boolean; }): Promise; /** Move pending bash components from pending area to chat */ flushPendingBashComponents(): void; findLastAssistantMessage(): AssistantMessage | undefined; extractAssistantText(message: AssistantMessage): string; } export {};