/**
 * SharedManager - Manages symlinked shared directories for CCS
 * v3.2.0: Symlink-based architecture
 *
 * Purpose: Eliminates duplication by symlinking:
 * ~/.claude/ ← ~/.ccs/shared/ ← instance/
 */
import type { AccountContextPolicy } from '../auth/account-context';
export { normalizePluginMetadataContent, normalizePluginMetadataPathString, } from './plugin-path-normalizer';
/**
 * SharedManager Class
 */
declare class SharedManager {
    private readonly homeDir;
    private readonly sharedDir;
    private readonly claudeDir;
    private readonly instancesDir;
    private readonly pluginLayoutLock;
    private readonly sharedItems;
    private readonly sharedPluginEntries;
    private readonly instanceLocalPluginMetadataFiles;
    private readonly advancedContinuityItems;
    constructor();
    /**
     * Detect circular symlink before creation
     */
    private detectCircularSymlink;
    /**
     * Ensure shared directories exist as symlinks to ~/.claude/
     * Creates ~/.claude/ structure if missing
     */
    ensureSharedDirectories(): void;
    /**
     * Link shared directories to instance
     */
    linkSharedDirectories(instancePath: string): void;
    detachSharedDirectories(instancePath: string): void;
    private ensureSharedPluginLayoutDefaults;
    private linkInstancePlugins;
    private getSharedPluginLinkItems;
    private removeExistingPath;
    /**
     * Sync project workspace context based on account policy.
     *
     * - isolated (default): each profile keeps its own ./projects directory.
     * - shared: profile ./projects becomes symlink to shared context group root.
     */
    syncProjectContext(instancePath: string, policy: AccountContextPolicy): Promise<void>;
    /**
     * Sync advanced continuity artifacts for shared deeper mode.
     *
     * - shared + deeper: artifacts are linked per context group.
     * - shared + standard / isolated: artifacts stay local to instance.
     */
    syncAdvancedContinuityArtifacts(instancePath: string, policy: AccountContextPolicy): Promise<void>;
    /**
     * Ensure all project memory directories for an instance are shared.
     *
     * Source layout (isolated):
     *   ~/.ccs/instances/<profile>/projects/<project>/memory/
     *
     * Shared layout (canonical):
     *   ~/.ccs/shared/memory/<project>/
     */
    syncProjectMemories(instancePath: string): Promise<void>;
    /**
     * Normalize plugin metadata and reconcile marketplace metadata for the active config dir.
     */
    normalizeSharedPluginMetadataPaths(configDir?: string): void;
    normalizeSharedPluginMetadataPathsLocked(configDir?: string): void;
    /**
     * Normalize plugin registry paths to use canonical ~/.claude/ paths
     * instead of instance-specific ~/.ccs/instances/<name>/ paths.
     *
     * This ensures installed_plugins.json is consistent regardless of
     * which CCS instance installed the plugin.
     */
    normalizePluginRegistryPaths(configDir?: string): void;
    /**
     * Reconcile marketplace registry content into the active config dir while
     * keeping the global ~/.claude copy up to date for non-instance flows.
     */
    normalizeMarketplaceRegistryPaths(configDir?: string): void;
    private normalizePluginMetadataFiles;
    private getPluginMetadataFilePaths;
    private normalizePluginMetadataFile;
    private getMarketplaceRegistrySourcePaths;
    private buildMarketplaceRegistryContent;
    private discoverMarketplaceEntries;
    private isTransientMarketplaceDirectory;
    private isMarketplaceRegistryEntry;
    private writePluginMetadataFile;
    /**
     * Migrate from v3.1.1 (copied data in ~/.ccs/shared/) to v3.2.0 (symlinks to ~/.claude/)
     * Runs once on upgrade
     */
    migrateFromV311(): void;
    /**
     * Migrate existing instances from isolated to shared settings.json (v4.4+)
     * Runs once on upgrade
     */
    migrateToSharedSettings(): void;
    /**
     * Ensure memory path is linked to shared memory root.
     * Returns true when a link/copy was created or updated.
     */
    private ensureProjectMemoryLink;
    /**
     * Check whether symlink points to expected target.
     */
    private isSymlinkTarget;
    /**
     * Resolve symlink target to absolute path.
     */
    private resolveSymlinkTargetPath;
    /**
     * Guard project merge operations to known CCS-managed roots only.
     */
    private isSafeProjectsMergeSource;
    /**
     * Guard advanced continuity merge operations to known CCS-managed roots only.
     */
    private isSafeContinuityMergeSource;
    /**
     * Link directory with Windows fallback to recursive copy.
     */
    private linkDirectoryWithFallback;
    /**
     * Migrate legacy per-project memory symlinks that point to ~/.ccs/shared/memory.
     * This preserves data while restoring true profile isolation.
     */
    private detachLegacySharedMemoryLinks;
    /**
     * Move directory, with cross-device fallback.
     */
    private moveDirectory;
    /**
     * Merge source into target. On file conflicts, keep target and copy source
     * as "<name>.migrated-from-<instance>[-N]" to avoid data loss.
     */
    private mergeDirectoryWithConflictCopies;
    /**
     * Compare two files byte-for-byte.
     */
    private fileContentsEqual;
    /**
     * Build a non-destructive conflict copy path.
     */
    private getConflictCopyPath;
    private symlinkPointsTo;
    private detachManagedPluginLayout;
    private reconcileLocalMarketplaceRegistry;
    private resolveCanonicalPath;
    private isPathWithinDirectory;
    private pathExists;
    private ensureDirectory;
    private getLstat;
    private getLstatSync;
    /**
     * Copy directory as fallback (Windows without Developer Mode)
     */
    private copyDirectoryFallback;
}
export default SharedManager;
//# sourceMappingURL=shared-manager.d.ts.map