import { spawnSync } from 'node:child_process';
import type { AgentId, ProviderCliManagedInstallSpec, ProviderCliRuntimeInstallPlatform as ProviderCliInstallPlatform } from '@happier-dev/agents';
import { fetchGitHubLatestRelease } from '@happier-dev/release-runtime';
import { downloadGitHubReleaseAsset } from './downloadGitHubReleaseAsset.js';
import { extractGitHubReleaseAsset } from './extractGitHubReleaseAsset.js';
import { ensureManagedJavaScriptRuntimeCommand } from './managedJavaScriptRuntime.js';
import { ensureManagedPnpmCommand } from './managedPnpm.js';
export type ProviderCliInstallCommand = Readonly<{
    cmd: string;
    args: ReadonlyArray<string>;
    requiresAdmin: boolean;
    note: string | null;
}>;
export type ProviderCliInstallMode = 'vendor_recipe' | 'managed_package' | 'github_release_binary';
export type ProviderCliInstallPlan = Readonly<{
    providerId: AgentId;
    title: string;
    binaries: ReadonlyArray<string>;
    platform: ProviderCliInstallPlatform;
    docsUrl: string | null;
    commands: ReadonlyArray<ProviderCliInstallCommand>;
    requiresAdmin: boolean;
    installMode: ProviderCliInstallMode;
    managedInstall: ProviderCliManagedInstallSpec | null;
}>;
export type ProviderCliInstallPlanResult = Readonly<{
    ok: true;
    plan: ProviderCliInstallPlan;
}> | Readonly<{
    ok: false;
    errorCode: 'no-recipe';
    errorMessage: string;
}>;
export type InstallProviderCliResult = Readonly<{
    ok: true;
    plan: ProviderCliInstallPlan;
    alreadyInstalled: boolean;
    logPath: string | null;
}> | Readonly<{
    ok: false;
    errorCode: 'no-recipe' | 'vendor-recipe-disallowed' | 'command-not-found' | 'command-exec-failed' | 'command-timed-out' | 'command-failed' | 'managed-runtime-unavailable';
    errorMessage: string;
    plan: ProviderCliInstallPlan | null;
    logPath: string | null;
}>;
type InstallProviderCliDeps = Readonly<{
    fetchGitHubLatestRelease?: typeof fetchGitHubLatestRelease;
    downloadGitHubReleaseAsset?: typeof downloadGitHubReleaseAsset;
    extractGitHubReleaseAsset?: typeof extractGitHubReleaseAsset;
    ensureManagedPnpmCommand?: typeof ensureManagedPnpmCommand;
    ensureManagedJavaScriptRuntimeCommand?: typeof ensureManagedJavaScriptRuntimeCommand;
    spawnSync?: typeof spawnSync;
}>;
export declare function resolvePlatformFromNodePlatform(nodePlatform: string): ProviderCliInstallPlatform | null;
export declare function planProviderCliInstall(params: Readonly<{
    providerId: AgentId;
    platform: ProviderCliInstallPlatform;
}>): ProviderCliInstallPlanResult;
export declare function installProviderCli(params: Readonly<{
    providerId: AgentId;
    platform: ProviderCliInstallPlatform;
    env?: NodeJS.ProcessEnv;
    logDir?: string | null;
    dryRun?: boolean;
    skipIfInstalled?: boolean;
    allowVendorRecipeExecution?: boolean;
    deps?: InstallProviderCliDeps;
}>): Promise<InstallProviderCliResult>;
export {};
//# sourceMappingURL=install.d.ts.map