export type Platform = 'linux' | 'darwin' | 'win32' | 'other'; export interface ServicePaths { /** Absolute path to the unit/plist/task definition (or null on Windows). */ definitionPath: string | null; /** Absolute path to the log file the service writes stdout+stderr to. */ logFile: string; } /** Detect whether the per-user service is currently installed+running. */ export declare function isServiceRunning(): boolean; /** * Install + start the per-user background service. Returns the paths written * (for status messaging) or throws on platform/manager failure. */ /** * Rewrite the service definition when the installed one no longer matches what * this version renders. * * WHY THIS IS NOT JUST installService(). That runs only when someone types * `chat-recall watch --install-service`. An upgrade never rewrote the unit, so * every supervision fix shipped to nobody: machines installed before it kept * the old file, including the start limiter that lets systemd abandon a * crash-looping collector permanently. The daemon calls this on startup, and a * daemon start is what an upgrade produces, so the fix arrives with the code * that needs it. * * Compares the rendered text and returns false when it already matches, so the * common path writes nothing and restarts nothing. Best-effort by contract: a * collector that cannot rewrite its own unit must keep collecting. */ export declare function refreshServiceDefinition(): boolean; export declare function installService(): ServicePaths; /** Render the systemd --user unit file body (pure — no FS, no exec). */ export declare function renderSystemdUnit(watchJs: string, node: string, logFile: string): string; /** Render the launchd plist body (pure — no FS, no exec). */ export declare function renderLaunchdPlist(watchJs: string, node: string, logFile: string, label?: string): string; /** Render the schtasks /create command (pure — no exec). */ export declare function renderWindowsTaskCommand(watchJs: string, node: string, taskName?: string, logFile?: string): string; /** * Stop + remove the per-user background service. Idempotent — no error if * the service isn't installed. Returns true if something was removed. */ export declare function uninstallService(): boolean; /** Human-readable platform name for messaging. */ export declare function platformName(): string; export declare class ServiceInstallError extends Error { hint?: string; constructor(message: string, hint?: string); } //# sourceMappingURL=service-installer.d.ts.map