/**
 * Shared merge model for settings.local.json
 * Enables multi-framework coexistence with namespace isolation.
 *
 * Story 98-11: Settings.local.json shared merge model for multi-framework coexistence
 *
 * Each framework contributes its settings under a namespace key.
 * The merge engine combines contributions into a flat output that
 * Claude Code can consume unchanged.
 */
export interface HookCommand {
    type?: string;
    command: string;
}
export interface HookEntry {
    matcher?: string;
    hooks: HookCommand[];
}
export interface FrameworkContribution {
    version: string;
    hooks?: Record<string, HookEntry[]>;
    permissions?: {
        allow: string[];
    };
    statusLine?: {
        type: string;
        command: string;
    };
    context_budget?: {
        warning_threshold: number;
        critical_threshold: number;
        max_tokens: number;
    };
}
export interface FrameworkMeta {
    version: string;
    installed_at: string;
    priority?: number;
}
export interface SharedSettings {
    _version: number;
    _frameworks: Record<string, FrameworkMeta>;
    _contributions: Record<string, FrameworkContribution>;
    hooks: Record<string, HookEntry[]>;
    permissions: {
        allow: string[];
    };
    statusLine?: {
        type: string;
        command: string;
    };
    context_budget?: {
        warning_threshold: number;
        critical_threshold: number;
        max_tokens: number;
    };
}
export interface MergeConflict {
    type: 'hook_duplicate' | 'scalar_collision';
    frameworks: string[];
    key: string;
    detail: string;
}
export interface MergeResult {
    settings: SharedSettings;
    conflicts: MergeConflict[];
}
export declare const SHARED_SETTINGS_VERSION = 2;
/**
 * Create an empty SharedSettings structure.
 */
export declare function createEmptySharedSettings(): SharedSettings;
/**
 * Add or update a framework's contribution to the shared settings.
 * Re-merges all contributions after updating.
 */
export declare function contributeFrameworkSettings(settings: SharedSettings, frameworkId: string, contribution: FrameworkContribution): MergeResult;
/**
 * Remove a framework's contribution from the shared settings.
 * Re-merges remaining contributions.
 */
export declare function removeFrameworkSettings(settings: SharedSettings, frameworkId: string): SharedSettings;
/**
 * Merge all framework hook contributions into a unified hooks object.
 * Hooks from different frameworks are concatenated per hook type.
 * Duplicate commands within same framework are deduplicated.
 */
export declare function mergeHooks(contributions: Record<string, FrameworkContribution>): Record<string, HookEntry[]>;
/**
 * Merge all framework permission contributions into a unified allow list.
 * Permissions are unioned, deduplicated, and sorted alphabetically.
 */
export declare function mergePermissions(contributions: Record<string, FrameworkContribution>): {
    allow: string[];
};
/**
 * Resolve scalar values (statusLine, context_budget) from multiple frameworks.
 * Uses framework priority (lower number = higher priority).
 * Falls back to alphabetical ordering if priority is equal.
 */
export declare function resolveScalar<T>(contributions: Record<string, FrameworkContribution>, frameworks: Record<string, FrameworkMeta>, key: keyof FrameworkContribution): T | undefined;
/**
 * Detect conflicts between framework contributions.
 * Returns list of conflicts found.
 */
export declare function detectConflicts(contributions: Record<string, FrameworkContribution>): MergeConflict[];
/**
 * Migrate a legacy (v1) settings.local.json to the shared (v2) format.
 * The existing content is attributed to the specified framework.
 */
export declare function migrateToSharedFormat(legacySettings: Record<string, unknown>, frameworkId: string, frameworkVersion: string): SharedSettings;
/**
 * Check if a settings object is in the shared (v2) format.
 */
export declare function isSharedFormat(settings: unknown): settings is SharedSettings;
/**
 * Export the merged settings in Claude Code-compatible flat format.
 * Strips internal _version, _frameworks, _contributions fields.
 */
export declare function toFlatFormat(settings: SharedSettings): Record<string, unknown>;
/**
 * Validate a SharedSettings structure.
 */
export declare function validateSharedSettings(settings: unknown): {
    valid: boolean;
    errors: string[];
};
//# sourceMappingURL=settings-merge.d.ts.map