| 136 | })) |
| 137 | |
| 138 | function createTestWorkflow( |
| 139 | blocks: Array<{ |
| 140 | id: string |
| 141 | name?: string |
| 142 | type?: string |
| 143 | outputs?: Record<string, any> |
| 144 | }> = [], |
| 145 | subflows: { loops?: Record<string, any>; parallels?: Record<string, any> } = {} |
| 146 | ) { |
| 147 | return { |
| 148 | version: '1.0', |
| 149 | blocks: blocks.map((b) => ({ |
| 150 | id: b.id, |
| 151 | position: { x: 0, y: 0 }, |
| 152 | config: { tool: b.type ?? 'function', params: {} }, |
| 153 | inputs: {}, |
| 154 | outputs: b.outputs ?? {}, |
| 155 | metadata: { id: b.type ?? 'function', name: b.name ?? b.id }, |
| 156 | enabled: true, |
| 157 | })), |
| 158 | connections: [], |
| 159 | loops: subflows.loops ?? {}, |
| 160 | parallels: subflows.parallels ?? {}, |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Creates a test ResolutionContext with block outputs. |