// A bus host with its launcher in a process of its own, so a test can kill // it hard. It launches the PM, prints the launch result as one JSON line and // runs until it is killed. argv: the adapter to use for both harnesses. import { bootConfig, loadSystem } from "../../src/config.mjs"; import { startHost } from "../../src/host.mjs"; import { createLauncher } from "../../src/launcher.mjs"; const [adapter] = process.argv.slice(2); const system = loadSystem({ env: process.env }); const boot = bootConfig({ system, businessId: "acme", env: process.env }); const host = await startHost({ boot, business: "acme", log: () => {} }); const launcher = createLauncher({ host, system, env: process.env, adapters: { pi: adapter, "claude-code": adapter }, sessionDefaults: { pollInterval: 100 }, versions: { pi: "0.85.1", claude: null }, log: () => {}, }); await launcher.listen(); process.stdout.write(`${JSON.stringify(await launcher.launchPm())}\n`);