| 1 | // Track which processes have been backgrounded |
| 2 | const processTerminalBackgroundStates = new Map<string, boolean>(); |
| 3 | |
| 4 | // Function to mark a process as backgrounded |
| 5 | export function markProcessAsBackgrounded(toolCallId: string): void { |
| 6 | processTerminalBackgroundStates.set(toolCallId, true); |
| 7 | } |
| 8 | |
| 9 | // Function to check if a process is backgrounded |
| 10 | export function isProcessBackgrounded(toolCallId: string): boolean { |
| 11 | return processTerminalBackgroundStates.has(toolCallId); |
| 12 | } |
| 13 | |
| 14 | // Function to remove a process from the backgrounded processes map |
| 15 | export function removeBackgroundedProcess(toolCallId: string): void { |
| 16 | processTerminalBackgroundStates.delete(toolCallId); |
| 17 | } |