blob: 3161c1c3a6b7cecbe8bf8962452387110c5fe1d9 [file]
#!/usr/bin/env node
import { parseInteractiveRuntimeHostCandidateArguments } from './candidate-cli.js';
import { startExecutionRuntimeHostCandidate } from './server/execution-candidate.js';
import { runRuntimeHostProcessLifecycle } from './server/process-lifecycle.js';
import { installRuntimeHostLogCapture } from './process-diagnostics.js';
installRuntimeHostLogCapture();
const options = parseInteractiveRuntimeHostCandidateArguments(process.argv.slice(2));
const result = await startExecutionRuntimeHostCandidate(options);
if (result.kind === 'loser') process.exit(2);
try {
await runRuntimeHostProcessLifecycle(result.host);
} catch {
process.exitCode = 1;
}