()
| 766 | |
| 767 | // Helper to spawn a background task and return its ID |
| 768 | async function spawnBackgroundTask(): Promise<string> { |
| 769 | const handle = await spawnShellTask({ |
| 770 | command, |
| 771 | description: description || command, |
| 772 | shellCommand, |
| 773 | toolUseId, |
| 774 | agentId |
| 775 | }, { |
| 776 | abortController, |
| 777 | getAppState: () => { |
| 778 | throw new Error('getAppState not available in runPowerShellCommand context'); |
| 779 | }, |
| 780 | setAppState |
| 781 | }); |
| 782 | return handle.taskId; |
| 783 | } |
| 784 | |
| 785 | // Helper to start backgrounding with logging |
| 786 | function startBackgrounding(eventName: string, backgroundFn?: (shellId: string) => void): void { |
no test coverage detected