import { homedir } from "node:os"; import { join } from "node:path"; import { VERSION } from "../../version.js"; import { runServiceCommand } from "../service.js"; import { printJson } from "../printer.js"; import type { CliRuntime } from "../types.js"; export const STATE_DIR = join(homedir(), ".config", "seal-home"); export async function handleServiceCommand(action: string | undefined, runtime: CliRuntime) { const result = await runServiceCommand(action, { appRoot: runtime.appRoot, entryFile: runtime.entryFile, stateDir: STATE_DIR, version: VERSION, launcher: runtime.launcher }); if (result !== undefined) printJson(result); }