/**
 * Marketplace Installer Service
 *
 * Handles downloading, installing, uninstalling, and updating
 * marketplace items. Manages asset downloads with checksum verification,
 * tar.gz extraction, and updates the local installed-items manifest.
 *
 * For skill items, also ensures the shared _common/lib.sh files are
 * present in the marketplace directory so installed skills can source them.
 *
 * @module services/marketplace/marketplace-installer.service
 */
import { MarketplaceItem, MarketplaceOperationResult } from '../../types/marketplace.types.js';
/**
 * Downloads and installs a marketplace item.
 *
 * Performs the following steps:
 * 1. Resolves the downloadable asset (archive or model)
 * 2. Determines the source type (GitHub directory or CDN archive)
 * 3. Delegates to `installFromGitHub` or `downloadAndExtractAsset`
 * 4. Calls `finalizeInstall` to update manifest and refresh registrations
 * 5. Cleans up partial install on failure
 *
 * @param item - The marketplace item to install
 * @returns Operation result indicating success or failure with a message
 */
export declare function installItem(item: MarketplaceItem): Promise<MarketplaceOperationResult>;
/**
 * Uninstalls a marketplace item by removing its directory and manifest entry.
 *
 * Performs the following steps:
 * 1. Looks up the item in the local manifest
 * 2. Removes the item's install directory from disk
 * 3. Removes the item's entry from the manifest
 *
 * @param id - The ID of the marketplace item to uninstall
 * @returns Operation result indicating success or failure with a message
 */
export declare function uninstallItem(id: string): Promise<MarketplaceOperationResult>;
/**
 * Updates a marketplace item to the latest version using a safe
 * install-to-temp-then-swap strategy.
 *
 * Performs the following steps:
 * 1. Installs the new version to a temporary path (suffixed with -update-tmp)
 * 2. On success: uninstalls the old version, renames temp to final path
 * 3. On failure: cleans up the temp path without touching the old version
 *
 * @param item - The marketplace item with the latest version info
 * @returns Operation result indicating success or failure with a message
 */
export declare function updateItem(item: MarketplaceItem): Promise<MarketplaceOperationResult>;
/**
 * Ensures the shared _common/lib.sh files exist in the marketplace directory.
 *
 * Marketplace-installed skills source _common/lib.sh relative to their directory.
 * This function copies both the agent-level and root-level _common/lib.sh from
 * the bundled package into the marketplace directory structure:
 *
 * ```
 * ~/.crewly/marketplace/
 * ├── skills/
 * │   └── _common/
 * │       └── lib.sh    ← agent _common (delegates to root _common)
 * └── _common/
 *     └── lib.sh        ← root shared library
 * ```
 *
 * Safe to call multiple times — only copies if source files exist.
 */
export declare function ensureCommonLibs(): Promise<void>;
//# sourceMappingURL=marketplace-installer.service.d.ts.map