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

Function render

cli/src/components/tools/read-files.tsx:62–96  ·  view source on GitHub ↗
(toolBlock)

Source from the content-addressed store, hash-verified

60 toolName: 'read_files',
61
62 render(toolBlock): ToolRenderConfig {
63 const input = toolBlock.input as any
64
65 // Extract file paths from input
66 const filePaths: string[] = Array.isArray(input?.paths)
67 ? input.paths
68 .filter((path: any) => typeof path === 'string')
69 .map((path: string) => path.trim())
70 .filter((path: string) => path.length > 0)
71 : []
72
73 if (filePaths.length === 0) {
74 return { content: null }
75 }
76
77 // Check if any files need special labels
78 const hasSpecialFiles = filePaths.some(
79 (fp) => isSensitiveFile(fp) || isEnvTemplateFile(fp),
80 )
81
82 return {
83 content: (
84 <SimpleToolCallItem
85 name="Read"
86 description={
87 hasSpecialFiles ? (
88 <FilePathsDescription filePaths={filePaths} />
89 ) : (
90 filePaths.join(', ')
91 )
92 }
93 />
94 ),
95 }
96 },
97})

Callers

nothing calls this directly

Calls 2

isSensitiveFileFunction · 0.90
isEnvTemplateFileFunction · 0.90

Tested by

no test coverage detected