( blocks: readonly T[], toolName: string | undefined, toolCallId?: string )
| 72 | } |
| 73 | |
| 74 | export 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 | |
| 91 | export function completeRenderOnlyToolPendingBlock<T>( |
| 92 | blocks: readonly T[], |
no test coverage detected