(block: ContentBlock)
| 114 | // --------------------------------------------------------------------------- |
| 115 | |
| 116 | function resolveToolState(block: ContentBlock): PersistedToolState { |
| 117 | const tc = block.toolCall |
| 118 | if (!tc) return 'pending' |
| 119 | if (tc.result?.success !== undefined) { |
| 120 | return tc.result.success |
| 121 | ? MothershipStreamV1ToolOutcome.success |
| 122 | : MothershipStreamV1ToolOutcome.error |
| 123 | } |
| 124 | return tc.status as PersistedToolState |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Copy `timestamp` / `endedAt` from a source object onto a target object. |
no outgoing calls
no test coverage detected