/**
 * Cleanup Stale Plugin References
 *
 * Removes plugin references from ~/.claude/settings.json that no longer exist
 * in the SpecWeave marketplace. This prevents "Plugin not found" errors for
 * plugins that were removed/renamed.
 *
 * @module cleanup-stale-plugins
 * @since 0.35.2
 */
/**
 * Result of cleanup operation
 */
export interface CleanupResult {
    success: boolean;
    removedCount: number;
    removedPlugins: string[];
    /** Cache directories removed from disk during Phase 2 cleanup. */
    removedCacheDirs: string[];
    error?: string;
}
/**
 * Clean up stale plugin references from Claude settings
 *
 * This function:
 * 1. Reads ~/.claude/settings.json
 * 2. Loads marketplace.json to get current plugin list
 * 3. Removes any enabled plugins that don't exist in marketplace
 * 4. Writes back the cleaned settings
 *
 * @param marketplaceJsonPath - Path to marketplace.json
 * @param verbose - Show detailed output
 * @returns Cleanup result
 */
export declare function cleanupStalePlugins(marketplaceJsonPath: string, verbose?: boolean): Promise<CleanupResult>;
/**
 * Result of user-level plugin scope migration
 */
export interface ScopeMigrationResult {
    success: boolean;
    migratedCount: number;
    migratedPlugins: string[];
    error?: string;
}
/**
 * Migrate user-level SpecWeave domain plugins and LSP plugins to project scope
 *
 * Prevents global pollution: sw-*@specweave and *-lsp@* should NEVER live in
 * ~/.claude/settings.json (user scope). They belong in .claude/settings.json
 * (project scope) to avoid leaking across projects.
 *
 * Exempt: sw@specweave (core plugin, intentionally user-scoped)
 *
 * Sources of user-level pollution:
 * - Claude Code's own plugin discovery (installs at user scope by default)
 * - Older SpecWeave versions (pre-v1.0.210)
 * - Manual `claude plugin install` / `vskill install` without --scope flag
 *
 * @param projectDir - Project directory with .claude/settings.json (optional, skips project migration if not provided)
 * @param verbose - Show detailed output
 * @returns Migration result
 */
export declare function migrateUserLevelPlugins(projectDir?: string, verbose?: boolean): Promise<ScopeMigrationResult>;
/** Options for stale lockfile cleanup functions. */
export interface StaleFileCleanupOptions {
    verbose?: boolean;
    /** Override for testing: inject a custom fs module. */
    customFs?: typeof import('fs');
    /** Mtime threshold in ms — files modified more recently than this are skipped. Default: 5000. */
    mtimeThresholdMs?: number;
}
/** Result of a stale lockfile cleanup operation. */
export interface StaleFileResult {
    success: boolean;
    removedCount: number;
    skippedCount: number;
    removedPaths: string[];
    skippedPaths: string[];
    errors: Array<{
        path: string;
        error: string;
    }>;
}
/**
 * Remove all `skills-lock.json` files from the project tree.
 * This is a dead legacy format with no code references.
 *
 * @param projectRoot - Root of the project to scan
 * @param options - Cleanup options (verbose, fs override, mtime threshold)
 */
export declare function cleanupLegacyLockfiles(projectRoot: string, options?: StaleFileCleanupOptions): StaleFileResult;
/**
 * Remove orphaned `vskill.lock` files in child repos of an umbrella project.
 * Only the umbrella root `vskill.lock` is authoritative; child-repo copies are orphans.
 *
 * @param projectRoot - Root of the umbrella project
 * @param options - Cleanup options
 */
export declare function cleanupOrphanedChildLocks(projectRoot: string, options?: StaleFileCleanupOptions): StaleFileResult;
/**
 * Check if there are stale plugins without removing them
 *
 * @param marketplaceJsonPath - Path to marketplace.json
 * @returns List of stale plugin keys
 */
export declare function detectStalePlugins(marketplaceJsonPath: string): Promise<string[]>;
//# sourceMappingURL=cleanup-stale-plugins.d.ts.map