export type ServiceName = 'telegram' | 'daemon'; export declare const SERVICE_NAMES: readonly ServiceName[]; export interface ServiceInstallOptions { noWatch?: boolean; dryRun?: boolean; environment?: Record; } export type ServiceInstallOutcome = { kind: 'installed'; configPath: string; label: string; autoRestartOnRebuild: boolean; notes?: string[]; } | { kind: 'already-installed'; configPath: string; label: string; } | { kind: 'failed'; reason: string; }; export type ServiceUninstallOutcome = { kind: 'uninstalled'; configPath: string; } | { kind: 'not-installed'; configPath: string; } | { kind: 'failed'; reason: string; }; export type ServiceRestartOutcome = { kind: 'restarted'; label: string; notes?: string[]; } | { kind: 'not-installed'; configPath: string; } | { kind: 'failed'; reason: string; }; export type ServiceUpgradeOutcome = { kind: 'upgraded'; configPath: string; label: string; } | { kind: 'already-current'; configPath: string; label: string; } | { kind: 'not-installed'; configPath: string; } | { kind: 'failed'; reason: string; }; export interface ServiceStatus { name: ServiceName; label: string; installed: boolean; configPath: string; pid?: number; lastExitStatus?: number; logFile: string; } export interface ServiceManager { readonly backend: 'launchd' | 'systemd'; readonly configKind: string; install(name: ServiceName, opts?: ServiceInstallOptions): ServiceInstallOutcome; uninstall(name: ServiceName): ServiceUninstallOutcome; status(name: ServiceName): ServiceStatus; restart(name: ServiceName, opts?: ServiceInstallOptions): ServiceRestartOutcome; upgrade(name: ServiceName, opts?: ServiceInstallOptions): ServiceUpgradeOutcome; isInstalled(name: ServiceName): boolean; configPath(name: ServiceName): string; logPath(name: ServiceName): string; label(name: ServiceName): string; readConfigFile(name: ServiceName): string | undefined; } export declare function serviceLogPath(name: ServiceName): string; export declare const SERVICE_TIMEOUT_MS = 8000;