import type { INodeParameters } from 'n8n-workflow'; import type { ZodIssue } from 'zod'; import type { AddedNode, NodeDetails, NodeSearchResult } from './nodes'; import type { SimpleWorkflow } from './workflow'; export type ProgressUpdateType = 'input' | 'output' | 'progress' | 'error'; export interface ProgressUpdate> { type: ProgressUpdateType; data: T; timestamp?: string; } export interface ToolProgressMessage { type: 'tool'; toolName: TToolName; toolCallId?: string; status: 'running' | 'completed' | 'error'; updates: ProgressUpdate[]; displayTitle?: string; customDisplayTitle?: string; } export interface ToolError { message: string; code?: string; details?: ZodIssue[] | Record; } export interface ProgressReporter { start: (input: T, options?: { customDisplayTitle: string; }) => void; progress: (message: string, data?: Record) => void; complete: (output: T) => void; error: (error: ToolError) => void; setCustomTitle: (title: string) => void; createBatchReporter: (scope: string) => BatchReporter; } export interface BatchReporter { init: (total: number) => void; next: (itemDescription: string) => void; complete: () => void; } export interface UpdateNodeParametersOutput { nodeId: string; nodeName: string; nodeType: string; updatedParameters: INodeParameters; appliedChanges: string[]; message: string; } export interface AddNodeOutput { addedNode: AddedNode; message: string; } export interface ConnectNodesOutput { sourceNode: string; targetNode: string; connectionType: string; swapped: boolean; message: string; found: { sourceNode: boolean; targetNode: boolean; }; } export interface RemoveNodeOutput { removedNodeId: string; removedNodeName: string; removedNodeType: string; connectionsRemoved: number; message: string; } export interface NodeDetailsOutput { details: NodeDetails; found: boolean; message: string; } export interface NodeSearchOutput { results: Array<{ query: string; results: NodeSearchResult[]; }>; totalResults: number; message: string; } export interface GetNodeParameterOutput { message: string; } export interface RemoveConnectionOutput { sourceNode: string; targetNode: string; connectionType: string; sourceOutputIndex: number; targetInputIndex: number; message: string; } export interface RenameNodeOutput { nodeId: string; oldName: string; newName: string; message: string; } export interface WorkflowMetadata { templateId: number; name: string; description?: string; workflow: SimpleWorkflow; } export interface NodeConfigurationEntry { version: number; parameters: INodeParameters; } export type NodeConfigurationsMap = Record; export interface GetNodeConfigurationExamplesOutput { nodeType: string; totalFound: number; message: string; } export interface GetExecutionSchemaOutput { found: boolean; count: number; message: string; } export interface GetExecutionLogsOutput { hasError: boolean; lastNodeExecuted?: string; nodesWithData: number; message: string; } export interface GetExpressionDataMappingOutput { found: boolean; nodesWithExpressions: number; message: string; }