import type { ChatMessageMetadata, ChatUiMessageChunk } from "../../chat/protocol.js"; import type { HostedStreamPartForUiChunkMapping } from "../../chat/hosted-ui-chunk-mapping.js"; /** Public API contract for hosted child chunk mirror. */ export interface HostedChildChunkMirror { handleChunk(chunk: ChatUiMessageChunk): Promise | void; } /** State for hosted child mirror. */ export interface HostedChildMirrorState { reasoningStarted: boolean; textStarted: boolean; } /** Context for hosted child mirror. */ export interface HostedChildMirrorContext { mirror: HostedChildChunkMirror | null; messageId: string | null; reasoningMessageId: string | null; state: HostedChildMirrorState; appendChunk: (chunk: ChatUiMessageChunk) => Promise; closeReasoningSegment: () => Promise; closeTextSegment: () => Promise; markStepStarted: () => void; hasStartedStep: () => boolean; hasEmittedProgress: () => boolean; } type CoreMirroredPartType = "reasoning-delta" | "text-delta" | "tool-input-start" | "tool-input-delta" | "tool-call" | "tool-result"; type MirroredPartType = CoreMirroredPartType | "source" | "tool-error" | "error"; type DurableMirrorChunkType = ChatUiMessageChunk["type"]; /** Check whether a hosted chunk was already mirrored. */ export declare function isAlreadyMirroredHostedChunk(partType: MirroredPartType, mirroredChunkType: DurableMirrorChunkType): boolean; type MirroredHostedStreamPart = Extract; type HostedMirrorBasePart = { type: "reasoning-delta"; text: string; } | { type: "text-delta"; text: string; } | { type: "tool-input-start"; toolCallId: string; toolName: string; } | { type: "tool-input-delta"; toolCallId: string; delta: string; } | { type: "tool-call"; toolCallId: string; toolName: string; input: unknown; } | { type: "tool-result"; toolCallId: string; toolName: string; input: unknown; output: unknown; } | { type: "tool-error"; toolCallId: string; toolName: string; input: unknown; error: Error; } | { type: "error"; error: Error; }; type ExtraMirroredHostedStreamPart = Extract; /** Public API contract for hosted child mirror part. */ export type HostedChildMirrorPart = HostedMirrorBasePart | ExtraMirroredHostedStreamPart; /** Converts a value to mirrored hosted stream part. */ export declare function toMirroredHostedStreamPart(part: HostedChildMirrorPart, ids: { messageId: string | null; reasoningMessageId: string | null; }): MirroredHostedStreamPart; /** Append hosted child mirror chunk. */ export declare function appendHostedChildMirrorChunk(input: { mirror: HostedChildChunkMirror | null; chunk: ChatUiMessageChunk; }): Promise; /** Close hosted child reasoning segment helper. */ export declare function closeHostedChildReasoningSegment(input: { mirror: HostedChildChunkMirror | null; reasoningMessageId: string | null; state: HostedChildMirrorState; }): Promise; /** Close hosted child text segment helper. */ export declare function closeHostedChildTextSegment(input: { mirror: HostedChildChunkMirror | null; messageId: string | null; state: HostedChildMirrorState; }): Promise; /** Context for create hosted child mirror. */ export declare function createHostedChildMirrorContext(input: { mirror: HostedChildChunkMirror | null; messageId?: string | null; reasoningMessageId?: string | null; }): HostedChildMirrorContext; export {}; //# sourceMappingURL=child-mirror.d.ts.map