mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(copilot-subflows): copilot-added subflows id mismatch (#1977)
This commit is contained in:
committed by
GitHub
parent
5457d4bc7b
commit
b3caef1f31
@@ -5,6 +5,7 @@ import { getBlock } from '@/blocks'
|
||||
import type { SubBlockConfig } from '@/blocks/types'
|
||||
import type { SerializedBlock, SerializedWorkflow } from '@/serializer/types'
|
||||
import type { BlockState, Loop, Parallel } from '@/stores/workflows/workflow/types'
|
||||
import { generateLoopBlocks, generateParallelBlocks } from '@/stores/workflows/workflow/utils'
|
||||
import { getTool } from '@/tools/utils'
|
||||
|
||||
const logger = createLogger('Serializer')
|
||||
@@ -41,12 +42,15 @@ export class Serializer {
|
||||
serializeWorkflow(
|
||||
blocks: Record<string, BlockState>,
|
||||
edges: Edge[],
|
||||
loops: Record<string, Loop>,
|
||||
loops?: Record<string, Loop>,
|
||||
parallels?: Record<string, Parallel>,
|
||||
validateRequired = false
|
||||
): SerializedWorkflow {
|
||||
const safeLoops = loops || {}
|
||||
const safeParallels = parallels || {}
|
||||
const canonicalLoops = generateLoopBlocks(blocks)
|
||||
const canonicalParallels = generateParallelBlocks(blocks)
|
||||
const safeLoops = Object.keys(canonicalLoops).length > 0 ? canonicalLoops : loops || {}
|
||||
const safeParallels =
|
||||
Object.keys(canonicalParallels).length > 0 ? canonicalParallels : parallels || {}
|
||||
const accessibleBlocksMap = this.computeAccessibleBlockIds(
|
||||
blocks,
|
||||
edges,
|
||||
|
||||
Reference in New Issue
Block a user