(data: MothershipStreamV1ToolResultPayload | undefined)
| 284 | } |
| 285 | |
| 286 | export function inferToolSuccess(data: MothershipStreamV1ToolResultPayload | undefined): { |
| 287 | success: boolean |
| 288 | hasResultData: boolean |
| 289 | hasError: boolean |
| 290 | } { |
| 291 | const errorMessage = getToolResultErrorMessage(data) |
| 292 | const hasResultData = data?.output !== undefined |
| 293 | const hasError = Boolean(errorMessage) |
| 294 | const success = data?.success === true |
| 295 | return { success, hasResultData, hasError } |
| 296 | } |
| 297 | |
| 298 | export function ensureTerminalToolCallState( |
| 299 | context: StreamingContext, |
no test coverage detected