import { must } from "../../../shared/src/must.js";
import { parentWorker, singleProcessMode } from "../types/processes.js";
import { exitAfter, runUntilKilled } from "../services/life-cycle.js";
import { getNormalizedZeroConfig } from "../config/zero-config.js";
import { createLogContext } from "./logging.js";
import { initEventSink } from "../observability/events.js";
import { Mutator } from "../workers/mutator.js";
//#region ../zero-cache/src/server/mutator.ts
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()) exitAfter(() => runWorker(must(parentWorker), process.env, ...process.argv.slice(2)));
//#endregion
export {};

//# sourceMappingURL=mutator.js.map