MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / reconnectRuntimeProcess

Function reconnectRuntimeProcess

projects/electron/src/modules/code/process.ts:598–623  ·  view source on GitHub ↗
(processId: string)

Source from the content-addressed store, hash-verified

596}
597
598export 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
625export async function killAllRuntimeProcesses(): Promise<{ ok: true }> {
626 cleanup()

Callers

nothing calls this directly

Calls 2

scheduleCleanupFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected