{"version":3,"file":"runCustomRunner.cjs","names":["sandboxUserName"],"sources":["../../src/helpers/runCustomRunner.ts"],"sourcesContent":["import { killSandboxUserProcesses, sandboxUserName } from './sandboxUser.js';\n\n/**\n * Run a problem-supplied `runCommand` handler, then terminate every sandbox-user process it left\n * behind. A submission can daemonize and close its inherited streams so the handler returns while\n * its child keeps running; that child could otherwise modify the working directory while the\n * harness reads outputs, or survive into the next test case or request. The built-in run paths\n * sweep the same way in their own `finally`.\n */\nexport async function runCustomRunner<T>(run: () => Promise<T> | T): Promise<T> {\n  try {\n    return await run();\n  } finally {\n    if (sandboxUserName) killSandboxUserProcesses();\n  }\n}\n"],"mappings":"kDASA,eAAsB,EAAmB,EAAuC,CAC9E,GAAI,CACF,OAAO,MAAM,EAAI,CACnB,QAAU,CACJA,EAAAA,iBAAiB,EAAA,yBAAyB,CAChD,CACF"}