/** * Cross-platform service (daemon) abstraction. */ export interface LaunchSpec { /** Internal service id, e.g. "grok-telegram-bot". */ id: string; /** Human-readable name. */ displayName: string; /** Windows Scheduled Task name (unique per named instance). */ windowsTaskName?: string; /** launchd label (unique per named instance). */ macosLabel?: string; /** Named instance slug when using `--name`. */ slug?: string; /** Absolute path to the node binary that should run the bot. */ nodePath: string; /** Arguments after the node binary (tsx loader + entry file). */ args: string[]; /** Working directory (the installed bot folder). */ cwd: string; /** Extra environment variables for the service process. */ env?: Record; /** Absolute log file path. */ logFile: string; /** Log directory. */ logsDir: string; } export interface ServiceResult { ok: boolean; message: string; } export interface ServiceController { readonly platform: string; install(spec: LaunchSpec): Promise; uninstall(spec: LaunchSpec): Promise; start(spec: LaunchSpec): Promise; stop(spec: LaunchSpec): Promise; status(spec: LaunchSpec): Promise; }