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

Function removeRenderOnlyToolPendingBlock

src/stores/aiChatChartBlocks.ts:74–89  ·  view source on GitHub ↗
(
  blocks: readonly T[],
  toolName: string | undefined,
  toolCallId?: string
)

Source from the content-addressed store, hash-verified

72}
73
74export function removeRenderOnlyToolPendingBlock<T>(
75 blocks: readonly T[],
76 toolName: string | undefined,
77 toolCallId?: string
78): T[] {
79 let removed = false
80 const next = [...blocks]
81 for (let index = next.length - 1; index >= 0; index--) {
82 if (isMatchingPendingRenderOnlyToolBlock(next[index], toolName, toolCallId)) {
83 next.splice(index, 1)
84 removed = true
85 break
86 }
87 }
88 return removed ? next : [...blocks]
89}
90
91export function completeRenderOnlyToolPendingBlock<T>(
92 blocks: readonly T[],

Callers 1

Tested by

no test coverage detected