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