export type ServiceScope = 'user' | 'system';
export type ServicePlatform = 'darwin' | 'linux';
export type ServiceInstallMetadata = {
    installId: string;
    root: string;
    host: string;
    port: number;
    scope: ServiceScope;
    platform: ServicePlatform;
    serviceName: string;
    serviceFilePath: string;
    launcherPath: string;
    installedAt: string;
};
export type RootPromptDefault = {
    value: string | null;
    reason: 'git' | 'workspace-marker' | 'nested-git-projects' | 'none';
    shouldConfirm: boolean;
};
export type HostPromptDefault = {
    value: string;
    source: 'explicit' | 'tailscale' | 'wildcard';
    warning: string | null;
};
export type CommandResult = {
    exitCode: number | null;
    stdout: string;
    stderr: string;
};
export type CommandRunner = (command: string, args: string[]) => Promise<CommandResult>;
export type LauncherScriptInput = {
    installId: string;
    root: string;
    host: string;
    port: number;
    scope: ServiceScope;
    nodePath: string;
    npxPath: string;
};
export type ServicePrompt = {
    input: (message: string, defaultValue?: string) => Promise<string>;
    confirm: (message: string, defaultValue: boolean) => Promise<boolean>;
    close: () => Promise<void> | void;
};
export type ServiceCommandName = 'install-service' | 'setup-service' | 'restart-service' | 'uninstall-service';
export type ServiceCommandOptions = {
    root?: string;
    host?: string;
    port?: string | number;
    scope?: string;
    yes?: boolean;
};
export type ServiceCommandDependencies = {
    cwd?: string;
    homeDir?: string;
    platform?: NodeJS.Platform;
    nodePath?: string;
    npxPath?: string;
    stdin?: NodeJS.ReadableStream;
    stdout?: NodeJS.WritableStream;
    runCommand?: CommandRunner;
    prompt?: ServicePrompt;
    now?: () => Date;
};
export type ServiceOperationResult = {
    action: 'install' | 'restart' | 'uninstall';
    metadata: ServiceInstallMetadata;
};
export declare const CODORI_SERVICE_MANAGED_ENV = "CODORI_SERVICE_MANAGED";
export declare const CODORI_SERVICE_INSTALL_ID_ENV = "CODORI_SERVICE_INSTALL_ID";
export declare const CODORI_SERVICE_SCOPE_ENV = "CODORI_SERVICE_SCOPE";
export declare const toServiceInstallId: (root: string) => string;
export declare const getServiceMetadataDirectory: (installId: string, homeDir?: string) => string;
export declare const getServiceMetadataPath: (installId: string, homeDir?: string) => string;
export declare const getServiceLauncherPath: (installId: string, homeDir?: string) => string;
export declare const detectRootPromptDefault: (cwd: string) => RootPromptDefault;
export declare const resolveServiceScope: (value: string | undefined) => ServiceScope;
export declare const parseServicePort: (value: string | number | undefined) => number | undefined;
export declare const resolveDefaultServicePort: (value: number | undefined) => number;
export declare const getWildcardHostWarning: () => string;
export declare const detectTailscaleIpv4: (runCommand?: CommandRunner) => Promise<string | null>;
export declare const resolveHostPromptDefault: (explicitHost: string | undefined, runCommand?: CommandRunner) => Promise<HostPromptDefault>;
export declare const buildLauncherScript: ({ installId, root, host, port, scope, nodePath, npxPath }: LauncherScriptInput) => string;
export declare const installService: (options?: ServiceCommandOptions, dependencies?: ServiceCommandDependencies) => Promise<ServiceOperationResult>;
export declare const restartService: (options?: ServiceCommandOptions, dependencies?: ServiceCommandDependencies) => Promise<ServiceOperationResult>;
export declare const uninstallService: (options?: ServiceCommandOptions, dependencies?: ServiceCommandDependencies) => Promise<ServiceOperationResult>;
