| 47 | // --------------------------------------------------------------------------- |
| 48 | |
| 49 | function mapKind(k: BackgroundTaskInfo['kind']): BackgroundTaskKind { |
| 50 | switch (k) { |
| 51 | case 'process': |
| 52 | return 'bash'; |
| 53 | case 'agent': |
| 54 | return 'subagent'; |
| 55 | case 'question': |
| 56 | // SCHEMAS §7 has no 'question' literal; question background tasks are |
| 57 | // tool-spawned flows (Loop runs them as part of `Question` tool |
| 58 | // execution), so 'tool' is the closest spec literal. |
| 59 | return 'tool'; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | function mapStatus(s: BackgroundTaskInfo['status']): BackgroundTaskStatus { |
| 64 | switch (s) { |