import { must } from "../../../shared/src/must.js";
import { getNormalizedZeroConfig } from "../config/zero-config.js";
import { initEventSink } from "../observability/events.js";
import { exitAfter, runUntilKilled } from "../services/life-cycle.js";
import { singleProcessMode, parentWorker } from "../types/processes.js";
import { Mutator } from "../workers/mutator.js";
import { createLogContext } from "./logging.js";
function runWorker(parent, env, ...args) {
  const config = getNormalizedZeroConfig({ env, argv: args.slice(1) });
  const lc = createLogContext(config, { worker: "mutator" });
  initEventSink(lc, config);
  return runUntilKilled(lc, parent, new Mutator());
}
if (!singleProcessMode()) {
  void exitAfter(
    () => runWorker(must(parentWorker), process.env, ...process.argv.slice(2))
  );
}
//# sourceMappingURL=mutator.js.map
