Skip to content

@sqlrooms/ai-core / collectHoistableRenderers

Function: collectHoistableRenderers()

collectHoistableRenderers(toolCalls, agentProgress, toolRenderers, hoistableToolNames): HoistableToolCall[]

Recursively walk an AgentToolCall tree and collect every tool call that has a registered renderer AND is in the explicit hoistable set. Results are returned in depth-first order so they appear in the natural execution sequence.

Agent tool calls (name starts with agent-) are never themselves hoisted — only their leaf tool calls with renderers are collected.

Parameters

ParameterTypeDescription
toolCallsAgentToolCall[]-
agentProgressRecord<string, AgentToolCall[]>-
toolRenderersToolRendererRegistry-
hoistableToolNamesReadonlySet<string>Set of tool names whose renderers should be hoisted. If empty, nothing is hoisted (safe default). This is typically the hoistedRenderers list from the parent context.

Returns

HoistableToolCall[]