export interface MarketplacePlugin {
    name: string;
    source: string;
    version?: string;
    description?: string;
    category?: string;
    author?: {
        name: string;
        email?: string;
        url?: string;
    };
}
export interface MarketplaceOwner {
    name: string;
    email?: string;
    url?: string;
}
export interface MarketplaceManifest {
    name: string;
    owner: MarketplaceOwner;
    plugins: MarketplacePlugin[];
    metadata?: {
        version?: string;
        description?: string;
    };
}
/**
 * Parse marketplace.json content and extract available plugins.
 *
 * @param content - Raw JSON string from marketplace.json
 * @returns Array of plugin entries, or empty array on parse failure
 */
export declare function getAvailablePlugins(content: string): MarketplacePlugin[];
/**
 * Get the source path for a named plugin from marketplace.json.
 *
 * @param name - Plugin name to look up (e.g. "frontend")
 * @param content - Raw JSON string from marketplace.json
 * @returns Source path (e.g. "./plugins/frontend") or null
 */
export declare function getPluginSource(name: string, content: string): string | null;
/**
 * Get the version for a named plugin from marketplace.json.
 *
 * @param name - Plugin name to look up
 * @param content - Raw JSON string from marketplace.json
 * @returns Version string or null if not found
 */
export declare function getPluginVersion(name: string, content: string): string | null;
/**
 * Check whether a named plugin exists in marketplace.json.
 *
 * @param name - Plugin name to check (e.g. "sw")
 * @param content - Raw JSON string from marketplace.json
 * @returns true if the plugin exists
 */
export declare function hasPlugin(name: string, content: string): boolean;
/**
 * Get the marketplace name (top-level "name" field) from marketplace.json.
 * Used as the marketplace identifier in `claude plugin install <plugin>@<marketplace>`.
 *
 * @param content - Raw JSON string from marketplace.json
 * @returns Marketplace name (e.g. "specweave") or null
 */
export declare function getMarketplaceName(content: string): string | null;
export interface MarketplaceValidation {
    valid: boolean;
    error?: string;
    pluginCount: number;
    name?: string;
}
export interface UnregisteredPlugin {
    name: string;
    /** Inferred source path, e.g. "./plugins/marketing" */
    source: string;
}
/**
 * Discover plugin directories in a GitHub repo's plugins/ folder
 * that are NOT listed in marketplace.json.
 *
 * Uses the GitHub Contents API to list immediate children of plugins/.
 * Returns empty array on any API error (best-effort, non-blocking).
 */
export interface UnregisteredPluginResult {
    plugins: UnregisteredPlugin[];
    /** True when the GitHub API call failed (rate limit, network error, etc.) */
    failed: boolean;
}
export interface LocalPlugin {
    name: string;
    description?: string;
    version?: string;
    category?: string;
    author?: {
        name: string;
        email?: string;
        url?: string;
    };
}
export interface SyncResult {
    added: string[];
    updated: string[];
    unchanged: string[];
    updatedManifest: MarketplaceManifest;
}
/**
 * Sync marketplace.json against a list of local plugin metadata.
 *
 * Pure function — no filesystem I/O. The caller is responsible for reading
 * marketplace.json and writing the result back.
 *
 * @param manifestContent - Raw JSON string from .claude-plugin/marketplace.json
 * @param localPlugins    - Metadata read from each plugins/*\/.claude-plugin/plugin.json
 * @returns SyncResult with added/updated/unchanged lists and the updated manifest object
 */
export declare function syncMarketplace(manifestContent: string, localPlugins: LocalPlugin[]): SyncResult;
export declare function discoverUnregisteredPlugins(owner: string, repo: string, manifestContent: string, onResponse?: (res: Response) => void): Promise<UnregisteredPluginResult>;
/**
 * Validate marketplace.json content with structured error diagnostics.
 *
 * Unlike `getAvailablePlugins()` (which silently returns []), this function
 * returns specific error reasons for troubleshooting.
 *
 * @param content - Raw JSON string from marketplace.json
 * @returns Validation result with error details
 */
export declare function validateMarketplace(content: string): MarketplaceValidation;
