import type { Paths } from "./paths.js"; export declare const SERVICE_LABEL = "co.meterapp.skillhook"; /** Absolute path to the compiled CLI (`dist/cli.js`), which services must point at. */ export declare function cliEntrypoint(): { path: string; exists: boolean; }; export interface ServiceSpec { label: string; node: string; cli: string; home: string; logFile: string; pathVar: string; user: string; } export declare function serviceSpec(paths: Paths, label?: string): ServiceSpec; export declare function renderLaunchdPlist(spec: ServiceSpec): string; export declare function renderSystemdUnit(spec: ServiceSpec): string; export declare function launchdPlistPath(label?: string): string; export declare function systemdUnitPath(label?: string): string; export interface ServiceStatus { platform: "launchd" | "systemd" | "unsupported"; installed: boolean; running: boolean; pid?: number; file: string; detail?: string; logFile: string; } export declare function installService(paths: Paths, label?: string): Promise<{ ok: boolean; file: string; output: string; }>; export declare function uninstallService(label?: string): Promise<{ ok: boolean; output: string; }>; export declare function restartService(label?: string): Promise<{ ok: boolean; output: string; }>; export declare function serviceStatus(paths: Paths, label?: string): Promise; export type Linger = "yes" | "no" | "unknown"; /** Parse `loginctl show-user --property=Linger --value`: anything but a clean yes/no is "unknown". */ export declare function parseLinger(code: number, stdout: string): Linger; /** * Whether systemd keeps this user's services running without a login session (read-only, never sudo). * With Linger=no a `systemctl --user` service stops at logout, which the cloud only sees as link.stopped. */ export declare function lingerStatus(user?: string): Promise; /** How this server process runs: under the launchd/systemd service, or started by hand (a terminal, another supervisor). */ export type RunMode = "service" | "foreground" | "unknown"; export declare function runModeOf(service: { running: boolean; pid?: number; }, serverPid: number | undefined): RunMode; export declare function readServiceLog(paths: Paths, lines?: number): string; /** * The node binary the service should run. Homebrew's `Cellar/node//bin/node` breaks on * every `brew upgrade node`, so prefer the stable `/opt/homebrew/bin/node` (or `/usr/local/bin/node`) * symlink when it resolves to the same binary. */ export declare function stableNodePath(execPath?: string): string;