import { ConfigManager } from '../config/manager.js';
import type { FeatureFlagReader } from '../runtime/feature-flags/index.js';
export type ManagedServicePlatform = 'systemd' | 'launchd' | 'windows' | 'manual';
export interface ManagedServiceDefinition {
    readonly name: string;
    readonly description: string;
    readonly workingDirectory: string;
    readonly command: string;
    readonly args: readonly string[];
    readonly env: Readonly<Record<string, string>>;
    readonly restartOnFailure: boolean;
}
export interface ManagedServiceStatus {
    readonly platform: ManagedServicePlatform;
    readonly path: string;
    readonly installed: boolean;
    readonly autostart: boolean;
    readonly running: boolean;
    readonly pid?: number | undefined;
    readonly logPath?: string | undefined;
    readonly commandPreview: string;
    readonly contents?: string | undefined;
    readonly suggestedCommands: readonly string[];
    readonly lastAction?: 'install' | 'uninstall' | 'start' | 'stop' | 'restart' | 'status' | undefined;
    readonly actionError?: string | undefined;
}
export interface ManagedServiceActionResult {
    readonly status: number | null;
    readonly stdout?: string | undefined;
    readonly stderr?: string | undefined;
}
interface ManagedServicePaths {
    readonly workingDirectory: string;
    readonly homeDirectory: string;
}
export interface ManagedServiceManagerOptions extends ManagedServicePaths {
    readonly definitionOverride?: ManagedServiceDefinition | undefined;
    readonly actionRunner?: ((command: string, args: readonly string[]) => ManagedServiceActionResult) | undefined;
    readonly surfaceRoot?: string | undefined;
    readonly binaryBaseName?: string | undefined;
    readonly defaultServiceName?: string | undefined;
    readonly defaultServiceDescription?: string | undefined;
    readonly featureFlags?: FeatureFlagReader | undefined;
}
export declare class PlatformServiceManager {
    private readonly configManager;
    private readonly workingDirectory;
    private readonly homeDirectory;
    private readonly definitionOverride?;
    private readonly actionRunner?;
    private readonly surfaceRoot?;
    private readonly binaryBaseName?;
    private readonly defaultServiceName?;
    private readonly defaultServiceDescription?;
    private readonly featureFlags;
    constructor(configManager: ConfigManager, options: ManagedServiceManagerOptions);
    private isEnabled;
    private requireEnabled;
    private getPaths;
    status(): ManagedServiceStatus;
    install(): ManagedServiceStatus;
    uninstall(): ManagedServiceStatus;
    start(): ManagedServiceStatus;
    stop(): ManagedServiceStatus;
    restart(): ManagedServiceStatus;
    private resolveDefinition;
    private startManual;
    private stopManual;
    private runPlatformAction;
    private readPid;
    private isPidRunning;
}
export {};
//# sourceMappingURL=service-manager.d.ts.map