import { type NpmIntegrityDrift, type NpmSpecResolution } from "../infra/install-source-utils.js";
import type { InstallSafetyOverrides } from "./install-security-scan.js";
type PluginInstallLogger = {
    info?: (message: string) => void;
    warn?: (message: string) => void;
};
export declare const PLUGIN_INSTALL_ERROR_CODE: {
    readonly INVALID_NPM_SPEC: "invalid_npm_spec";
    readonly INVALID_MIN_HOST_VERSION: "invalid_min_host_version";
    readonly UNKNOWN_HOST_VERSION: "unknown_host_version";
    readonly INCOMPATIBLE_HOST_VERSION: "incompatible_host_version";
    readonly MISSING_KAIJIBOT_EXTENSIONS: "missing_kaijibot_extensions";
    readonly EMPTY_KAIJIBOT_EXTENSIONS: "empty_kaijibot_extensions";
    readonly NPM_PACKAGE_NOT_FOUND: "npm_package_not_found";
    readonly PLUGIN_ID_MISMATCH: "plugin_id_mismatch";
    readonly SECURITY_SCAN_BLOCKED: "security_scan_blocked";
    readonly SECURITY_SCAN_FAILED: "security_scan_failed";
};
export type PluginInstallErrorCode = (typeof PLUGIN_INSTALL_ERROR_CODE)[keyof typeof PLUGIN_INSTALL_ERROR_CODE];
export type InstallPluginResult = {
    ok: true;
    pluginId: string;
    targetDir: string;
    manifestName?: string;
    version?: string;
    extensions: string[];
    npmResolution?: NpmSpecResolution;
    integrityDrift?: NpmIntegrityDrift;
} | {
    ok: false;
    error: string;
    code?: PluginInstallErrorCode;
};
export type PluginNpmIntegrityDriftParams = {
    spec: string;
    expectedIntegrity: string;
    actualIntegrity: string;
    resolution: NpmSpecResolution;
};
type PluginInstallPolicyRequest = {
    kind: "plugin-dir" | "plugin-archive" | "plugin-file" | "plugin-npm";
    requestedSpecifier?: string;
};
type PackageInstallCommonParams = InstallSafetyOverrides & {
    extensionsDir?: string;
    timeoutMs?: number;
    logger?: PluginInstallLogger;
    mode?: "install" | "update";
    dryRun?: boolean;
    expectedPluginId?: string;
    installPolicyRequest?: PluginInstallPolicyRequest;
};
export declare function resolvePluginInstallDir(pluginId: string, extensionsDir?: string): string;
export declare function installPluginFromArchive(params: {
    archivePath: string;
} & PackageInstallCommonParams): Promise<InstallPluginResult>;
export declare function installPluginFromDir(params: {
    dirPath: string;
} & PackageInstallCommonParams): Promise<InstallPluginResult>;
export declare function installPluginFromFile(params: {
    filePath: string;
    dangerouslyForceUnsafeInstall?: boolean;
    extensionsDir?: string;
    logger?: PluginInstallLogger;
    mode?: "install" | "update";
    dryRun?: boolean;
    installPolicyRequest?: PluginInstallPolicyRequest;
}): Promise<InstallPluginResult>;
export declare function installPluginFromNpmSpec(params: InstallSafetyOverrides & {
    spec: string;
    extensionsDir?: string;
    timeoutMs?: number;
    logger?: PluginInstallLogger;
    mode?: "install" | "update";
    dryRun?: boolean;
    expectedPluginId?: string;
    expectedIntegrity?: string;
    onIntegrityDrift?: (params: PluginNpmIntegrityDriftParams) => boolean | Promise<boolean>;
}): Promise<InstallPluginResult>;
export declare function installPluginFromPath(params: {
    path: string;
} & PackageInstallCommonParams): Promise<InstallPluginResult>;
export {};
