import { KnownMarketplace, KnownMarketplacesRegistry, InstalledPlugin, InstalledPluginsRegistry, MarketplaceManifest } from "../types/marketplace.js";
/**
 * Marketplace Service
 *
 * Handles local plugin marketplace registration, plugin installation,
 * and state management for installed plugins.
 */
export declare class MarketplaceService {
    private static isLockedInProcess;
    private pluginsDir;
    private knownMarketplacesPath;
    private installedPluginsPath;
    private lockPath;
    private tmpDir;
    private cacheDir;
    private marketplacesDir;
    private gitService;
    private static readonly BUILTIN_MARKETPLACE;
    constructor();
    /**
     * Ensures the required directory structure exists in ~/.wave/plugins
     */
    private ensureDirectoryStructure;
    /**
     * Check if a lock file is stale by reading its PID and checking if the process is alive.
     * Returns true if the lock is stale and safe to remove.
     */
    private isStaleLock;
    /**
     * Acquires a file-based lock (with PID tracking for stale lock detection) and executes the provided function.
     * Supports re-entrancy within the same process.
     */
    private withLock;
    /**
     * Loads the known marketplaces registry
     */
    getKnownMarketplaces(): Promise<KnownMarketplacesRegistry>;
    /**
     * Loads the installed plugins registry
     */
    getInstalledPlugins(): Promise<InstalledPluginsRegistry>;
    /**
     * Saves the known marketplaces registry
     */
    saveKnownMarketplaces(registry: KnownMarketplacesRegistry): Promise<void>;
    /**
     * Saves the installed plugins registry
     */
    saveInstalledPlugins(registry: InstalledPluginsRegistry): Promise<void>;
    /**
     * Loads a marketplace manifest from a local path
     */
    loadMarketplaceManifest(marketplacePath: string): Promise<MarketplaceManifest>;
    /**
     * Resolves the local path for a marketplace
     */
    getMarketplacePath(marketplace: KnownMarketplace): string;
    /**
     * Adds a new marketplace (local directory, GitHub repo, or Git URL)
     */
    addMarketplace(input: string): Promise<KnownMarketplace>;
    /**
     * Lists all registered marketplaces
     */
    listMarketplaces(): Promise<KnownMarketplace[]>;
    /**
     * Removes a marketplace by name
     */
    removeMarketplace(name: string): Promise<void>;
    /**
     * Updates a specific marketplace or all marketplaces
     */
    updateMarketplace(name?: string, options?: {
        updatePlugins?: boolean;
    }): Promise<void>;
    /**
     * Automatically updates all marketplaces that have auto-update enabled
     */
    autoUpdateAll(): Promise<void>;
    /**
     * Toggles auto-update for a marketplace
     */
    toggleAutoUpdate(name: string, enabled: boolean): Promise<void>;
    /**
     * Installs a plugin from a marketplace
     */
    installPlugin(pluginAtMarketplace: string, projectPath?: string): Promise<InstalledPlugin>;
    /**
     * Uninstalls a plugin
     */
    uninstallPlugin(pluginAtMarketplace: string, projectPath?: string): Promise<void>;
    /**
     * Updates a plugin (uninstall followed by install)
     */
    updatePlugin(pluginAtMarketplace: string): Promise<InstalledPlugin>;
}
//# sourceMappingURL=MarketplaceService.d.ts.map