(
runtime: PiRuntime,
event: Extract<
RuntimeSessionEvent,
{ type: 'tool_execution_start' | 'tool_execution_update' | 'tool_execution_end' }
>,
)
| 168 | } |
| 169 | |
| 170 | function handleRuntimeToolEvent( |
| 171 | runtime: PiRuntime, |
| 172 | event: Extract< |
| 173 | RuntimeSessionEvent, |
| 174 | { type: 'tool_execution_start' | 'tool_execution_update' | 'tool_execution_end' } |
| 175 | >, |
| 176 | ) { |
| 177 | rememberRuntimeToolProgress(runtime, { |
| 178 | toolCallId: event.toolCallId, |
| 179 | toolName: event.toolName, |
| 180 | args: 'args' in event ? event.args : undefined, |
| 181 | partialResult: getRuntimeToolProgressPartial(event), |
| 182 | isError: event.type === 'tool_execution_end' ? event.isError : false, |
| 183 | terminal: event.type === 'tool_execution_end', |
| 184 | }) |
| 185 | scheduleLiveThreadUpdate(runtime, publishLiveThreadUpdate) |
| 186 | } |
| 187 | |
| 188 | function handleRuntimeSessionEvent(runtime: PiRuntime, event: RuntimeSessionEvent) { |
| 189 | const runtimeKey = getPersistedSessionPath(runtime.session.sessionFile) |
no test coverage detected