Function
mapStatus
(s: BackgroundTaskInfo['status'])
Source from the content-addressed store, hash-verified
| 61 | } |
| 62 | |
| 63 | function mapStatus(s: BackgroundTaskInfo['status']): BackgroundTaskStatus { |
| 64 | switch (s) { |
| 65 | case 'running': |
| 66 | return 'running'; |
| 67 | case 'completed': |
| 68 | return 'completed'; |
| 69 | case 'failed': |
| 70 | return 'failed'; |
| 71 | case 'timed_out': |
| 72 | // SCHEMAS §7 has no 'timed_out' literal; collapse to 'failed'. The |
| 73 | // optional `stop_reason`/`last_error` surface would carry the hint |
| 74 | // once SCHEMAS adds the field (deferred). |
| 75 | return 'failed'; |
| 76 | case 'killed': |
| 77 | return 'cancelled'; |
| 78 | case 'lost': |
| 79 | return 'failed'; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | const TERMINAL_WIRE_STATUSES: ReadonlySet<BackgroundTaskStatus> = new Set([ |
| 84 | 'completed', |
Tested by
no test coverage detected