export declare const SERVICE_LABEL = "com.owlcoda.daemon";
/** launchd is macOS-only. Linux (systemd) / Windows are out of scope this round. */
export declare function isLaunchdSupported(plat?: NodeJS.Platform): boolean;
/** Per-user LaunchAgent path: ~/Library/LaunchAgents/com.owlcoda.daemon.plist */
export declare function launchAgentPath(home?: string): string;
/**
 * Build the EnvironmentVariables for the launchd plist. launchd does NOT
 * inherit the shell environment, so capture the user's current OWLCODA_* config
 * (most importantly OWLCODA_HOME — otherwise the daemon writes pid/meta to the
 * wrong config root and clobbers the real daemon's pid file) and force the
 * launchd markers (OWLCODA_LAUNCHD + a stable OWLCODA_RUNTIME_TOKEN).
 */
export declare function buildLaunchdEnv(env: NodeJS.ProcessEnv, runtimeToken: string): Record<string, string>;
export interface LaunchAgentSpec {
    label?: string;
    programArgs: string[];
    stdoutPath: string;
    stderrPath: string;
    workingDir?: string;
    envVars?: Record<string, string>;
}
export declare function renderLaunchAgentPlist(spec: LaunchAgentSpec): string;
export interface InstallServiceOptions {
    programArgs: string[];
    stdoutPath: string;
    stderrPath: string;
    envVars?: Record<string, string>;
}
export interface ServiceActionResult {
    plistPath: string;
    loaded: boolean;
    note?: string;
}
/** Write the plist and (re)load it via launchctl. Throws on non-darwin. */
export declare function installLaunchdService(opts: InstallServiceOptions): ServiceActionResult;
/** Bootout the service and remove the plist. Throws on non-darwin. */
export declare function uninstallLaunchdService(): ServiceActionResult;
/** Kick the daemon to restart under launchd (used by version-drift restart in W4). */
export declare function kickstartLaunchdService(): void;
export interface LaunchdServiceStatus {
    supported: boolean;
    installed: boolean;
    plistPath: string;
    launchctl?: string;
}
/** Best-effort status: plist presence + `launchctl print` summary if loaded. */
export declare function getLaunchdServiceStatus(): LaunchdServiceStatus;
/** True when the plist exists (proxy for "launchd owns the daemon"). */
export declare function isLaunchdServiceInstalled(): boolean;
