(block: PersistedContentBlock)
| 33 | } |
| 34 | |
| 35 | function toToolCallInfo(block: PersistedContentBlock): ToolCallInfo | undefined { |
| 36 | const tc = block.toolCall |
| 37 | if (!tc) return undefined |
| 38 | if (isToolHiddenInUi(tc.name)) return undefined |
| 39 | const status: ToolCallStatus = STATE_TO_STATUS[tc.state] ?? ToolCallStatus.error |
| 40 | return { |
| 41 | id: tc.id, |
| 42 | name: tc.name, |
| 43 | status, |
| 44 | displayTitle: status === ToolCallStatus.cancelled ? 'Stopped by user' : tc.display?.title, |
| 45 | params: tc.params, |
| 46 | calledBy: tc.calledBy, |
| 47 | result: tc.result, |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | function toDisplayBlock(block: PersistedContentBlock): ContentBlock | undefined { |
| 52 | const displayed = toDisplayBlockBody(block) |
no test coverage detected