(e: unknown)
| 241 | const userId = userIdFromProps(props) |
| 242 | |
| 243 | const errorCodeOf = (e: unknown): number => |
| 244 | typeof (e as { code?: unknown })?.code === 'number' ? (e as { code: number }).code : -1 |
| 245 | |
| 246 | // Our tool callbacks signal failure by returning `{ isError: true }` rather |
| 247 | // than throwing, so inspect the resolved result as well as the thrown path. |