(processId: string)
| 596 | } |
| 597 | |
| 598 | export async function reconnectRuntimeProcess(processId: string): Promise<RuntimeReconnectResponse> { |
| 599 | const proc = activeProcesses.get(processId) |
| 600 | if (!proc) { |
| 601 | return { ok: false, found: false, output: [] } |
| 602 | } |
| 603 | |
| 604 | if (proc.cleanupTimeoutId) { |
| 605 | clearTimeout(proc.cleanupTimeoutId) |
| 606 | proc.cleanupTimeoutId = undefined |
| 607 | } |
| 608 | |
| 609 | if (proc.completed) { |
| 610 | scheduleCleanup(processId) |
| 611 | } |
| 612 | |
| 613 | return { |
| 614 | ok: true, |
| 615 | found: true, |
| 616 | completed: proc.completed, |
| 617 | exitCode: proc.exitCode, |
| 618 | signal: proc.signal, |
| 619 | error: proc.error, |
| 620 | outputCount: proc.outputBuffer.length, |
| 621 | output: [...proc.outputBuffer], |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | export async function killAllRuntimeProcesses(): Promise<{ ok: true }> { |
| 626 | cleanup() |
nothing calls this directly
no test coverage detected