import { type CommandRunner } from './run-command.js';
export declare const XOPC_PACKAGE_NAME = "@xopcai/xopc";
export type GlobalInstallManager = 'npm' | 'pnpm';
export type ResolvedGlobalInstallCommand = {
    manager: GlobalInstallManager;
    command: string;
};
export type GlobalInstallRunResult = {
    exitCode: number;
    stdout: string;
    stderr: string;
    packageManager: GlobalInstallManager;
    usedFallback: boolean;
};
export declare function joinGlobalPackagePath(globalRoot: string): string;
export declare function resolveGlobalInstallCommand(manager: GlobalInstallManager, pkgRoot?: string | null): ResolvedGlobalInstallCommand;
export declare function createGlobalInstallEnv(env?: NodeJS.ProcessEnv): Promise<NodeJS.ProcessEnv | undefined>;
export declare function resolveGlobalInstallSpec(params: {
    version: string;
    env?: NodeJS.ProcessEnv;
}): string;
export declare function resolveGlobalRoot(managerOrCommand: GlobalInstallManager | ResolvedGlobalInstallCommand, runCommand: CommandRunner, timeoutMs: number, pkgRoot?: string | null): Promise<string | null>;
export declare function globalInstallArgs(managerOrCommand: GlobalInstallManager | ResolvedGlobalInstallCommand, spec: string, pkgRoot?: string | null): string[];
export declare function globalInstallFallbackArgs(managerOrCommand: GlobalInstallManager | ResolvedGlobalInstallCommand, spec: string, pkgRoot?: string | null): string[] | null;
export declare function detectGlobalInstallManagerForRoot(runCommand: CommandRunner, pkgRoot: string, timeoutMs: number): Promise<GlobalInstallManager | null>;
export declare function detectGlobalInstallManagerByPresence(runCommand: CommandRunner, timeoutMs: number): Promise<GlobalInstallManager | null>;
export declare function resolveGlobalManager(params: {
    root: string | null;
    timeoutMs?: number;
}): Promise<GlobalInstallManager>;
export declare function runGlobalPackageInstall(params: {
    manager: GlobalInstallManager;
    spec: string;
    pkgRoot: string | null;
    timeoutMs?: number;
    /** Echo install output to the parent process (CLI interactive). */
    echoToTerminal?: boolean;
}): Promise<GlobalInstallRunResult>;
export declare function formatGlobalInstallFailure(params: {
    packageManager: GlobalInstallManager;
    spec: string;
    exitCode: number;
    stderr: string;
    usedFallback: boolean;
}): string;
