( blocks: readonly T[], toolName: string | undefined, toolCallId: string | undefined, status: 'done' | 'error' )
| 89 | } |
| 90 | |
| 91 | export function completeRenderOnlyToolPendingBlock<T>( |
| 92 | blocks: readonly T[], |
| 93 | toolName: string | undefined, |
| 94 | toolCallId: string | undefined, |
| 95 | status: 'done' | 'error' |
| 96 | ): T[] { |
| 97 | const next = blocks.map((block) => { |
| 98 | if (!isMatchingPendingRenderOnlyToolBlock(block, toolName, toolCallId)) return block |
| 99 | return { |
| 100 | ...block, |
| 101 | tool: { |
| 102 | ...block.tool, |
| 103 | status, |
| 104 | }, |
| 105 | } |
| 106 | }) |
| 107 | return next as T[] |
| 108 | } |
| 109 | |
| 110 | function isRecord(value: unknown): value is Record<string, unknown> { |
| 111 | return typeof value === 'object' && value !== null && !Array.isArray(value) |
nothing calls this directly
no test coverage detected