import type { ConversationState } from "#client/conversation-state.js"; import { type SessionCallStatus } from "#protocol/session-projection.js"; /** * Where a tool call stands. `interrupted` is a call still running when its turn ended without an * outcome, or when the reader's stream stopped; `cancelled` follows task or input cancellation. */ export type ToolCallStatus = SessionCallStatus | "interrupted"; export interface ToolCallState { readonly status: ToolCallStatus; /** The call's output, or its latest partial output while it runs. */ readonly output?: unknown; readonly errorText?: string; /** A reported execution error code, when available. */ readonly errorCode?: string; } /** * A tool call's state for rendering: its status from the session projection, which every reader * shares, and its content from the message part. Pass `streaming: false` once the reader's stream * stopped, so a call left running reads as interrupted. */ export declare function toolCallState(conversation: ConversationState, callId: string, options?: { readonly streaming?: boolean; }): ToolCallState | undefined;