import type { ChatMessageMetadata, ChatUiMessageChunk } from "../../chat/protocol.js"; /** Check whether a durable chunk mirrors tool output. */ export declare function isDurableMirroredOutputChunk(chunk: ChatUiMessageChunk): boolean; /** State for mirrored tool chunk. */ export interface MirroredToolChunkState { startedToolCallIds: Set; inputAvailableToolCallIds: Set; outputAvailableToolCallIds: Set; outputErrorToolCallIds: Set; outputDeniedToolCallIds: Set; toolCallNames: Map; } /** State for create mirrored tool chunk. */ export declare function createMirroredToolChunkState(): MirroredToolChunkState; /** State for clone mirrored tool chunk. */ export declare function cloneMirroredToolChunkState(state: MirroredToolChunkState): MirroredToolChunkState; /** State for record mirrored tool chunk. */ export declare function recordMirroredToolChunkState(state: MirroredToolChunkState, chunk: ChatUiMessageChunk): void; /** Public API contract for open tool calls. */ export interface OpenToolCalls { needsInputClose: Array<{ toolCallId: string; toolName: string; }>; needsOutputClose: Array<{ toolCallId: string; toolName: string; }>; } /** Public API contract for hosted mirrored open tool call logger. */ export interface HostedMirroredOpenToolCallLogger { warn: (message: string, metadata?: Record) => void; } /** Public API contract for hosted mirrored UI stream logger. */ export interface HostedMirroredUiStreamLogger extends HostedMirroredOpenToolCallLogger { error: (message: string, metadata?: Record) => void; } /** Public API contract for hosted mirrored UI stream watchdog. */ export interface HostedMirroredUiStreamWatchdog { observe: (chunk: ChatUiMessageChunk) => void; dispose: () => void; } /** Input payload for create hosted mirrored UI stream. */ export interface CreateHostedMirroredUiStreamInput { sourceStream: AsyncIterable>; rootStreamWatchdog: HostedMirroredUiStreamWatchdog; mirroredToolChunkState: MirroredToolChunkState; appendChunk?: (chunk: ChatUiMessageChunk) => Promise | void; setMirroredOutput?: (value: boolean) => void; registerPendingDerivedSourceFlush?: (flush: () => Promise) => void; logger?: HostedMirroredUiStreamLogger; } /** Input payload for close hosted mirrored open tool calls. */ export interface CloseHostedMirroredOpenToolCallsInput { mirroredToolChunkState: MirroredToolChunkState; errorText: string; appendChunk: (chunk: ChatUiMessageChunk) => Promise | void; logger?: HostedMirroredOpenToolCallLogger; } /** Return hosted mirrored abort error text. */ export declare function getHostedMirroredAbortErrorText(streamError: unknown): string; /** Compute open tool calls. */ export declare function computeOpenToolCalls(state: MirroredToolChunkState): OpenToolCalls; /** Close hosted mirrored open tool calls helper. */ export declare function closeHostedMirroredOpenToolCalls(input: CloseHostedMirroredOpenToolCallsInput): Promise; /** Create hosted mirrored UI stream. */ export declare function createHostedMirroredUiStream(input: CreateHostedMirroredUiStreamInput): AsyncIterable>; //# sourceMappingURL=mirrored-tool-chunk-state.d.ts.map