( toolCallState: ToolCallState | undefined, )
| 83 | } |
| 84 | |
| 85 | export function toolCallStateToContextItems( |
| 86 | toolCallState: ToolCallState | undefined, |
| 87 | ): ContextItemWithId[] { |
| 88 | if (!toolCallState) { |
| 89 | return []; |
| 90 | } |
| 91 | return ( |
| 92 | toolCallState.output?.map((ctxItem) => |
| 93 | toolCallCtxItemToCtxItemWithId(ctxItem, toolCallState.toolCallId), |
| 94 | ) ?? [] |
| 95 | ); |
| 96 | } |
| 97 | |
| 98 | export function toolCallCtxItemToCtxItemWithId( |
| 99 | ctxItem: ContextItem, |
no test coverage detected