import { NodeConnectionTypes, type INodeType, type INodeDataBaseSchema } from '../Interface' export type LoopData = INodeDataBaseSchema & { /** * 循环次数 */ loop_count: number /** * 循环终止条件 */ break_conditions: Array<{ comparison_operator: | 'contains' | 'not_contains' | 'start_with' | 'end_with' | 'is' | 'is_not' | 'empty' | 'not_empty' | '=' | '!=' | '>' | '<' | '≥' | '≤' | 'all_of' left_value: string right_value: string varType: | 'string' | 'number' | 'boolean' | 'object' | 'array[string]' | 'array[number]' | 'array[boolean]' | 'array[object]' }> /** * 逻辑操作(and/or) */ logical_operator: 'and' | 'or' /** * 开始节点id */ start_node_id: string /** * 错误处理模式(terminated/continue-on-error/remove-abnormal-output) */ error_handle_mode: 'terminated' | 'continue-on-error' | 'remove-abnormal-output' } export const loopNode: INodeType = { version: ['1'], displayName: '循环', name: 'loop', description: '循环节点', group: '业务逻辑', icon: 'lucide:loop', iconColor: '#9373ee', inputs: [NodeConnectionTypes.main], outputs: [NodeConnectionTypes.main], // 业务数据 schema: { appAgentId: '', parentId: '', position: { x: 20, y: 30 }, width: 96, height: 96, selected: false, nodeType: 'loop', zIndex: 1, data: {} } }