MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / isMatchingPendingRenderOnlyToolBlock

Function isMatchingPendingRenderOnlyToolBlock

src/stores/aiChatChartBlocks.ts:60–72  ·  view source on GitHub ↗
(
  block: unknown,
  toolName: string | undefined,
  toolCallId?: string
)

Source from the content-addressed store, hash-verified

58}
59
60function isMatchingPendingRenderOnlyToolBlock(
61 block: unknown,
62 toolName: string | undefined,
63 toolCallId?: string
64): block is RenderOnlyToolPendingBlock {
65 if (!isRecord(block)) return false
66 const candidate = block as BlockWithTool
67 if (candidate.type !== 'tool' || !candidate.tool) return false
68 if (candidate.tool.transient !== true) return false
69 if (candidate.tool.name !== toolName) return false
70 if (toolCallId && candidate.tool.toolCallId !== toolCallId) return false
71 return isRenderOnlyTool(String(candidate.tool.name))
72}
73
74export function removeRenderOnlyToolPendingBlock<T>(
75 blocks: readonly T[],

Calls 2

isRenderOnlyToolFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected