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

Function completeRenderOnlyToolPendingBlock

src/stores/aiChatChartBlocks.ts:91–108  ·  view source on GitHub ↗
(
  blocks: readonly T[],
  toolName: string | undefined,
  toolCallId: string | undefined,
  status: 'done' | 'error'
)

Source from the content-addressed store, hash-verified

89}
90
91export 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
110function isRecord(value: unknown): value is Record<string, unknown> {
111 return typeof value === 'object' && value !== null && !Array.isArray(value)

Callers

nothing calls this directly

Tested by

no test coverage detected