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

Function isCreateFile

cli/src/utils/implementor-helpers.ts:422–431  ·  view source on GitHub ↗
(toolBlock: ToolContentBlock)

Source from the content-addressed store, hash-verified

420 * Check if a tool is a "create new file" operation.
421 */
422export function isCreateFile(toolBlock: ToolContentBlock): boolean {
423 const outputStr = typeof toolBlock.output === 'string' ? toolBlock.output : ''
424 const message = extractValueForKey(outputStr, 'message')
425 return (
426 typeof message === 'string' &&
427 (message.startsWith('Created file successfully') ||
428 message.startsWith('Created new file') ||
429 message.startsWith('Proposed new file'))
430 )
431}
432
433function hasToolResultOutput(toolBlock: ToolContentBlock): boolean {
434 const outputStr = typeof toolBlock.output === 'string' ? toolBlock.output : ''

Callers 4

renderFunction · 0.90
shouldShowEditDiffFunction · 0.85
getFileChangeTypeFunction · 0.85
buildActivityTimelineFunction · 0.85

Calls 1

extractValueForKeyFunction · 0.85

Tested by

no test coverage detected