/**
 * @license
 * Copyright 2025 Vybestack LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import { MCPServerConfig, GeminiCLIExtension } from '@vybestack/llxprt-code-core';
import { SettingScope } from './settings.js';
import type { LoadExtensionContext } from './extensions/variableSchema.js';
import { ExtensionEnablementManager } from './extensions/extensionEnablement.js';
import type { ConfirmationRequest } from '../ui/types.js';
export { ExtensionEnablementManager } from './extensions/extensionEnablement.js';
export declare const EXTENSIONS_DIRECTORY_NAME = ".llxprt/extensions";
export declare const EXTENSIONS_CONFIG_FILENAME = "llxprt-extension.json";
export declare const INSTALL_METADATA_FILENAME = ".llxprt-extension-install.json";
export interface Extension {
    path: string;
    config: ExtensionConfig;
    contextFiles: string[];
    installMetadata?: ExtensionInstallMetadata | undefined;
}
export interface ExtensionConfig {
    name: string;
    version: string;
    mcpServers?: Record<string, MCPServerConfig>;
    contextFileName?: string | string[];
    excludeTools?: string[];
}
export interface ExtensionInstallMetadata {
    source: string;
    type: 'git' | 'local' | 'link' | 'github-release';
    releaseTag?: string;
    ref?: string;
    autoUpdate?: boolean;
}
export interface ExtensionUpdateInfo {
    name: string;
    originalVersion: string;
    updatedVersion: string;
}
export declare class ExtensionStorage {
    private readonly extensionName;
    constructor(extensionName: string);
    getExtensionDir(): string;
    getConfigPath(): string;
    static getSettingsPath(): string;
    static getUserExtensionsDir(): string;
    static createTmpDir(): Promise<string>;
}
export declare function getWorkspaceExtensions(workspaceDir: string): Extension[];
export declare function copyExtension(source: string, destination: string): Promise<void>;
export declare function performWorkspaceExtensionMigration(extensions: Extension[], requestConsent: (consent: string) => Promise<boolean>): Promise<string[]>;
export declare function loadExtensions(extensionEnablementManager: ExtensionEnablementManager, workspaceDir?: string): Extension[];
export declare function loadUserExtensions(workspaceDir?: string): Extension[];
export declare function loadExtensionsFromDir(dir: string, workspaceDir?: string): Extension[];
export declare function loadExtension(context: LoadExtensionContext): Extension | null;
export declare function loadExtensionByName(name: string, workspaceDir?: string): Extension | null;
export declare function loadInstallMetadata(extensionDir: string): ExtensionInstallMetadata | undefined;
export declare function annotateActiveExtensions(extensions: Extension[], workspaceDir: string, manager: ExtensionEnablementManager): GeminiCLIExtension[];
/**
 * Requests consent from the user to perform an action, by reading a Y/n
 * character from stdin.
 *
 * This should not be called from interactive mode as it will break the CLI.
 *
 * @param consentDescription The description of the thing they will be consenting to.
 * @returns boolean, whether they consented or not.
 */
export declare function requestConsentNonInteractive(consentDescription: string): Promise<boolean>;
/**
 * Requests consent from the user to perform an action, in interactive mode.
 *
 * This should not be called from non-interactive mode as it will not work.
 *
 * @param consentDescription The description of the thing they will be consenting to.
 * @param setExtensionUpdateConfirmationRequest A function to actually add a prompt to the UI.
 * @returns boolean, whether they consented or not.
 */
export declare function requestConsentInteractive(consentDescription: string, addExtensionUpdateConfirmationRequest: (value: ConfirmationRequest) => void): Promise<boolean>;
export declare function installExtension(installMetadata: ExtensionInstallMetadata, requestConsent: (consent: string) => Promise<boolean>, cwd?: string, previousExtensionConfig?: ExtensionConfig): Promise<string>;
/**
 * Validates an extension name contains only alphanumeric characters and dashes.
 * @param name The extension name to validate.
 * @throws Error if the name contains invalid characters.
 */
export declare function validateName(name: string): void;
export declare function loadExtensionConfig(context: LoadExtensionContext): Promise<ExtensionConfig | null>;
export declare function uninstallExtension(extensionIdentifier: string, cwd?: string): Promise<void>;
export declare function toOutputString(extension: Extension, workspaceDir: string): string;
export declare function disableExtension(name: string, scope: SettingScope, cwd?: string): void;
export declare function enableExtension(name: string, scope: SettingScope, cwd?: string): void;
