import { ConfigManager } from '../config/manager.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;
    readonly logPath?: string;
    readonly commandPreview: string;
    readonly contents?: string;
    readonly suggestedCommands: readonly string[];
    readonly lastAction?: 'install' | 'uninstall' | 'start' | 'stop' | 'restart' | 'status';
    readonly actionError?: string;
}
export interface ManagedServiceActionResult {
    readonly status: number | null;
    readonly stdout?: string;
    readonly stderr?: string;
}
interface ManagedServicePaths {
    readonly workingDirectory: string;
    readonly homeDirectory: string;
}
export interface ManagedServiceManagerOptions extends ManagedServicePaths {
    readonly definitionOverride?: ManagedServiceDefinition;
    readonly actionRunner?: (command: string, args: readonly string[]) => ManagedServiceActionResult;
    readonly surfaceRoot?: string;
    readonly binaryBaseName?: string;
    readonly defaultServiceName?: string;
    readonly defaultServiceDescription?: string;
}
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?;
    constructor(configManager: ConfigManager, options: ManagedServiceManagerOptions);
    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