/**
 * Crewly service management command.
 *
 * Installs, uninstalls, and checks the status of Crewly as a platform-native
 * background service:
 *
 * **macOS** — Login Item `.command` file (runs inside Terminal.app)
 *   Why not a LaunchAgent plist? macOS TCC grants permissions based on the
 *   "responsible process." LaunchAgent children do NOT inherit Full Disk
 *   Access, so they cannot access ~/Desktop/ or other protected directories.
 *   A `.command` file runs inside Terminal.app whose TCC permissions propagate
 *   to child processes. It also sources the user's shell profile, picking up
 *   NVM/Homebrew paths that LaunchAgents miss.
 *
 * **Linux** — systemd user service (`systemctl --user`)
 *   No TCC equivalent on Linux, so a standard systemd unit file works.
 *   The service sources the user's shell profile for NVM/PATH consistency.
 */
interface ServiceOptions {
    force?: boolean;
    session?: string;
    app?: boolean;
    lines?: string;
    follow?: boolean;
    /** Target version for upgrade (e.g. "1.4.48" or "latest") */
    version?: string;
}
/**
 * Entry point for the `crewly service` subcommand.
 *
 * Dispatches to install / uninstall / status based on the positional argument.
 * Platform detection routes to macOS or Linux implementations.
 *
 * @param action - One of "install", "uninstall", or "status"
 * @param options - Command options (e.g. --force)
 */
export declare function serviceCommand(action: string, options: ServiceOptions): Promise<void>;
/**
 * Generates the systemd unit file content.
 *
 * Uses a wrapper script as ExecStart so the user's shell profile is sourced,
 * ensuring NVM and other PATH additions are available.
 *
 * @param projectRoot - Absolute path to the Crewly project directory
 * @returns The systemd unit file content
 */
export declare function generateSystemdUnit(projectRoot: string): string;
/**
 * Generates the Linux wrapper script that sources the shell profile
 * before starting node, ensuring NVM/PATH are available.
 *
 * @param projectRoot - Absolute path to the Crewly project directory
 * @returns The shell script content
 */
export declare function generateLinuxWrapper(projectRoot: string): string;
/**
 * Queries systemd for the current state of the crewly service.
 *
 * @returns "active", "enabled", "inactive", or null if not registered
 */
export declare function getSystemdState(): Promise<string | null>;
/**
 * Generates the content of the .command wrapper script (macOS).
 *
 * The script sources the user's shell profile (for NVM/PATH), prevents
 * duplicate instances via a PID file, and auto-restarts on crash.
 *
 * @param projectRoot - Absolute path to the Crewly project directory
 * @returns The shell script content
 */
export declare function generateCommandFile(projectRoot: string): string;
/**
 * Checks whether the Crewly Login Item is currently registered.
 *
 * @returns true if registered
 */
export declare function isLoginItemRegistered(): Promise<boolean>;
/**
 * Finds the Crewly project root by walking up from cwd looking for
 * a package.json with `"name": "crewly"`.
 *
 * @returns Absolute path to the project root, or null if not found
 */
export declare function findProjectRoot(): string | null;
/**
 * Reads the PID file and verifies the process is still alive.
 * Falls back to detecting the process by port if the PID file is stale
 * (e.g. when Crewly was started via `npm run dev` instead of the service wrapper).
 *
 * @returns The PID if the process is running, or null
 */
export declare function getRunningPid(): number | null;
/**
 * Detects the PID of a process listening on the Crewly web port.
 * Uses `lsof` to find the listener, which works for any start method.
 *
 * @returns The PID if a process is listening on the port, or null
 */
export declare function getRunningPidByPort(): number | null;
export {};
//# sourceMappingURL=service.d.ts.map