/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import { type IContent } from '../../services/history/IContent.js'; /** * Interface for cancelled tool information */ export interface CancelledToolInfo { toolCallId: string; toolName?: string; timestamp?: string; } export declare class SyntheticToolResponseHandler { /** * Creates synthetic tool responses for cancelled tools * @param cancelledTools Array of cancelled tool information * @returns Array of synthetic tool response messages */ static createSyntheticResponses(cancelledTools: CancelledToolInfo[]): IContent[]; /** * Identifies tool calls that need synthetic responses by comparing * assistant messages with tool_calls against existing tool responses * @param messages The conversation history * @returns Array of tool call IDs that need synthetic responses */ static identifyMissingToolResponses(messages: IContent[]): string[]; /** * Patches a message history to include synthetic responses for any * tool calls that don't have corresponding tool responses * @param messages The original message history * @returns Patched message history with synthetic responses added */ static patchMessageHistory(messages: IContent[]): IContent[]; /** * Adds a user-facing cancellation notice to the message history * @param messages The message history * @param cancelledCount Number of tools that were cancelled * @returns Message history with cancellation notice added */ static addCancellationNotice(messages: IContent[], cancelledCount: number): IContent[]; }