MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / updateAgentBlock

Function updateAgentBlock

cli/src/utils/message-block-helpers.ts:472–495  ·  view source on GitHub ↗
(block: ContentBlock)

Source from the content-addressed store, hash-verified

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.

Callers 1

moveSpawnAgentBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected