import type { BaseMessage } from '@langchain/core/messages'; import type { StructuredToolInterface } from '@langchain/core/tools'; import { type StrReplacement } from '@n8n/ai-utilities/text-editor'; import type { WorkflowJSON } from '@n8n/workflow-sdk'; import type { TextEditorHandler } from './text-editor-handler'; import type { TextEditorToolHandler } from './text-editor-tool-handler'; import type { ValidateToolHandler } from './validate-tool-handler'; import type { StreamOutput } from '../../types/streaming'; import type { WarningTracker } from '../state/warning-tracker'; export declare function parseReplacements(raw: unknown): StrReplacement[]; export interface ToolCall { name: string; args: Record; id?: string; } export interface ToolDispatchHandlerConfig { toolsMap: Map; toolDisplayTitles?: Map; validateToolHandler: ValidateToolHandler; } export interface ToolDispatchParams { toolCalls: ToolCall[]; messages: BaseMessage[]; currentWorkflow?: WorkflowJSON; iteration: number; textEditorHandler?: TextEditorHandler; textEditorToolHandler?: TextEditorToolHandler; warningTracker: WarningTracker; } export interface ToolDispatchResult { workflow?: WorkflowJSON; workflowReady: boolean; sourceCode?: string; parseDuration?: number; validatePassedThisIteration: boolean; hasUnvalidatedEdits?: boolean; } export declare class ToolDispatchHandler { private toolsMap; private toolDisplayTitles?; private validateToolHandler; constructor(config: ToolDispatchHandlerConfig); dispatch(params: ToolDispatchParams): AsyncGenerator; private executeToolCall; private executeGeneralToolCall; private executeBatchStrReplace; }