#!/usr/bin/env node /** * @file service-manager.js * @description Picks the per-user service manager that keeps the dashboard * running without Claude Code: a LaunchAgent on macOS (`launchd-service.js`), * a systemd `--user` unit everywhere else (`systemd-service.js`, which reports * itself unavailable off Linux). Both export the same API — and so does the * third, `systemd-system-service.js`, chosen while the server-mode SYSTEM unit * `sudo agenthub server install-system` wrote exists (pure fs check). * Require THIS module, never one of the three directly. * @author Nguyễn Ngọc Trí Vĩ */ function pick() { if (process.platform === "darwin") return require("./launchd-service"); const system = require("./systemd-system-service"); return system.unitIsOurs("agenthub") ? system : require("./systemd-service"); } module.exports = pick();