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

Function renderToolComponent

cli/src/components/tools/registry.ts:88–108  ·  view source on GitHub ↗
(
  toolBlock: ToolBlock,
  theme: ChatTheme,
  options: ToolRenderOptions,
)

Source from the content-addressed store, hash-verified

86 * @returns Render configuration, or null to use default rendering
87 */
88export function renderToolComponent(
89 toolBlock: ToolBlock,
90 theme: ChatTheme,
91 options: ToolRenderOptions,
92): ToolRenderConfig | undefined {
93 const component = getToolComponent(toolBlock.toolName)
94
95 if (component === undefined) {
96 return undefined
97 }
98
99 try {
100 return component.render(toolBlock as any, theme, options)
101 } catch (error) {
102 console.error(
103 `Error rendering tool component for ${toolBlock.toolName}:`,
104 error,
105 )
106 return undefined
107 }
108}
109
110/**
111 * Get all registered tool names.

Callers 2

tool-branch.tsxFile · 0.90

Calls 2

getToolComponentFunction · 0.85
renderMethod · 0.65

Tested by

no test coverage detected