/** Reverse-DNS label, shared by the launchd job and the scheduled task. */ export declare const SERVICE_LABEL = "one.cognitum.meta-proxy"; export interface ServiceCommand { command: string; args: string[]; } export interface CommandOutcome { ok: boolean; output: string; error?: string; } export type CommandRunner = (invocation: ServiceCommand) => CommandOutcome; export interface ServiceResult { ok: boolean; message: string; /** The unit/plist/task definition written, when one was. */ unitPath?: string; } export interface ServiceState { supported: boolean; /** The service manager currently has the job/unit/task loaded. */ installed: boolean; unitPath: string | null; managerState: 'enabled' | 'disabled' | 'unknown'; definitionPresent: boolean; /** Whether the service manager currently has the job/unit/task loaded. */ loaded: boolean | null; /** Whether the service remains configured to start on the user's next login. */ enabledAtLogin: boolean; /** null means the manager answered but does not expose a portable run state. */ running: boolean | null; pid: number | null; } export declare function launchAgentPath(home?: string, label?: string): string; export declare function systemdUnitPath(home?: string): string; /** The XML definition handed to `schtasks /create /xml`. */ export declare function scheduledTaskPath(home?: string, label?: string): string; export declare function serviceUnitPath(platform: NodeJS.Platform, home?: string, label?: string): string | null; /** * launchd job. `RunAtLoad` covers start-at-login and `KeepAlive.SuccessfulExit * = false` covers restart-after-crash while still letting a deliberate * `proxy stop` (SIGTERM, exit 0) stay stopped — a plain `KeepAlive: true` would * fight the user's own stop command forever. */ export declare function renderLaunchAgent(binaryPath: string, logPath: string, label?: string): string; /** * systemd **user** unit. `default.target` is the user-session target, so this is * start-at-login rather than start-at-boot; booting a machine nobody has logged * into should not run a user's proxy. `Restart=on-failure` matches the launchd * choice: a clean stop stays stopped. */ export declare function renderSystemdUnit(binaryPath: string): string; /** Task Scheduler definition — Windows has no launchd/systemd equivalent. */ export declare function renderScheduledTask(binaryPath: string): string; export declare function enableCommands(platform: NodeJS.Platform, unitPath: string, label?: string): ServiceCommand[]; export declare function disableCommands(platform: NodeJS.Platform, unitPath: string, label?: string): ServiceCommand[]; export declare function serviceStateCommand(platform: NodeJS.Platform, label?: string): ServiceCommand | null; export declare function metaProxyServiceState(platform?: NodeJS.Platform, home?: string, run?: CommandRunner, label?: string): ServiceState; export interface ServiceOptions { home?: string; platform?: NodeJS.Platform; run?: CommandRunner; /** Test/enterprise isolation hook; normal users always use SERVICE_LABEL. */ label?: string; /** Bounded synchronous polling seam; production waits without spawning. */ wait?: (milliseconds: number) => void; } export declare function enableMetaProxyService(options?: ServiceOptions): ServiceResult; export declare function startMetaProxyService(options?: ServiceOptions): ServiceResult; export declare function stopMetaProxyService(options?: ServiceOptions): ServiceResult; export declare function disableMetaProxyService(options?: ServiceOptions): ServiceResult; //# sourceMappingURL=meta-proxy-service.d.ts.map