import { Tool } from "./tool-types.js";
import { AssistantMessage } from "../utils/types.js";
import { ToolExecutionStream } from "./ToolExecutionStream.js";

//#region src/core/tool/toolResultStream.d.ts
declare function unstable_runPendingTools(message: AssistantMessage, tools: Record<string, Tool> | undefined, abortSignal: AbortSignal, human: (toolCallId: string, payload: unknown) => Promise<unknown>): Promise<AssistantMessage>;
type ToolResultStreamOptions = {
  /** Called immediately before a frontend tool's `execute` function runs. */onExecutionStart?: (toolCallId: string, toolName: string) => void; /** Called after frontend tool execution finishes or fails. */
  onExecutionEnd?: (toolCallId: string, toolName: string) => void;
};
/**
 * Transform stream that executes frontend tools and appends tool results.
 *
 * The transform watches streamed tool-call arguments, runs the matching
 * frontend tool once its arguments are complete, and emits a result chunk for
 * the tool call. Backend and human tools pass through according to their tool
 * definition.
 *
 * @param tools Tool registry or function returning the current registry.
 * @param abortSignal Signal, or signal getter, used for the current run.
 * @param human Callback used to resolve human-tool requests from UI input.
 * @param options Optional execution lifecycle callbacks.
 */
declare function toolResultStream(tools: Record<string, Tool> | (() => Record<string, Tool> | undefined) | undefined, abortSignal: AbortSignal | (() => AbortSignal), human: (toolCallId: string, payload: unknown) => Promise<unknown>, options?: ToolResultStreamOptions): ToolExecutionStream;
//#endregion
export { ToolResultStreamOptions, toolResultStream, unstable_runPendingTools };
//# sourceMappingURL=toolResultStream.d.ts.map