(block: ContentBlock)
| 470 | realAgentType?: string, |
| 471 | ): ContentBlock[] => { |
| 472 | const updateAgentBlock = (block: ContentBlock): ContentBlock => { |
| 473 | if (block.type !== 'agent') { |
| 474 | return block |
| 475 | } |
| 476 | const updatedBlock: ContentBlock = { |
| 477 | ...block, |
| 478 | agentId: realId, |
| 479 | } |
| 480 | |
| 481 | if (params) { |
| 482 | updatedBlock.params = params |
| 483 | } |
| 484 | |
| 485 | if (prompt && block.initialPrompt === '') { |
| 486 | updatedBlock.initialPrompt = prompt |
| 487 | } |
| 488 | |
| 489 | if (realAgentType) { |
| 490 | updatedBlock.agentType = realAgentType |
| 491 | updatedBlock.agentName = realAgentType |
| 492 | } |
| 493 | |
| 494 | return updatedBlock |
| 495 | } |
| 496 | |
| 497 | // If there's a parentId, we need to move the block under the parent. |
| 498 | // First check if the block is already under the correct parent. |
no outgoing calls
no test coverage detected