/**
 * Merge Strategies
 *
 * 会话合并策略
 * 定义如何将分叉会话的结果合并回父会话
 */
import { MergeStrategy, MergeOptions, MergeResult, ConflictResolutionDetail, ConflictingFinding } from './forkTypes';
import { Finding, StageResult, SubAgentContext } from '../types';
/**
 * 合并策略接口
 */
export interface IMergeStrategy {
    name: MergeStrategy;
    /**
     * 合并结果
     */
    mergeResults(parentResults: StageResult[], childResults: StageResult[], options: MergeOptions): MergeResultData;
    /**
     * 合并发现
     */
    mergeFindings(parentFindings: Finding[], childFindings: Finding[], options: MergeOptions): MergeFindingsData;
}
/**
 * 合并结果数据
 */
export interface MergeResultData {
    mergedResults: StageResult[];
    mergedCount: number;
}
/**
 * 合并发现数据
 */
export interface MergeFindingsData {
    mergedFindings: Finding[];
    conflicts: ConflictingFinding[];
    resolutions: ConflictResolutionDetail[];
}
/**
 * 替换策略：完全用子会话的结果替换父会话
 */
export declare class ReplaceStrategy implements IMergeStrategy {
    name: MergeStrategy;
    mergeResults(_parentResults: StageResult[], childResults: StageResult[], options: MergeOptions): MergeResultData;
    mergeFindings(_parentFindings: Finding[], childFindings: Finding[], options: MergeOptions): MergeFindingsData;
    private applyFilter;
    private applyFindingsFilter;
}
/**
 * 追加策略：将子会话的结果追加到父会话
 */
export declare class AppendStrategy implements IMergeStrategy {
    name: MergeStrategy;
    mergeResults(parentResults: StageResult[], childResults: StageResult[], options: MergeOptions): MergeResultData;
    mergeFindings(parentFindings: Finding[], childFindings: Finding[], options: MergeOptions): MergeFindingsData;
    private applyFilter;
    private applyFindingsFilter;
    private detectConflicts;
    private getFindingKey;
    private isConflicting;
    private getConflictType;
    private resolveConflicts;
}
/**
 * 仅合并发现策略：只合并 findings，不改变 results
 */
export declare class MergeFindingsStrategy implements IMergeStrategy {
    name: MergeStrategy;
    private appendStrategy;
    mergeResults(parentResults: StageResult[], _childResults: StageResult[], _options: MergeOptions): MergeResultData;
    mergeFindings(parentFindings: Finding[], childFindings: Finding[], options: MergeOptions): MergeFindingsData;
}
/**
 * 选择性合并策略：只合并符合特定条件的内容
 */
export declare class CherryPickStrategy implements IMergeStrategy {
    name: MergeStrategy;
    mergeResults(parentResults: StageResult[], childResults: StageResult[], options: MergeOptions): MergeResultData;
    mergeFindings(parentFindings: Finding[], childFindings: Finding[], options: MergeOptions): MergeFindingsData;
}
/**
 * 合并策略注册表
 */
export declare class MergeStrategyRegistry {
    private strategies;
    constructor();
    /**
     * 注册策略
     */
    register(strategy: IMergeStrategy): void;
    /**
     * 获取策略
     */
    get(name: MergeStrategy): IMergeStrategy;
    /**
     * 执行合并
     */
    merge(parentContext: SubAgentContext, childContext: SubAgentContext, options: MergeOptions): {
        mergedContext: SubAgentContext;
        result: Omit<MergeResult, 'success' | 'parentSessionId' | 'childSessionId' | 'mergedAt'>;
    };
    /**
     * 收集所有发现
     */
    private collectFindings;
}
/**
 * 获取合并策略注册表
 */
export declare function getMergeStrategyRegistry(): MergeStrategyRegistry;
/**
 * 创建合并策略注册表
 */
export declare function createMergeStrategyRegistry(): MergeStrategyRegistry;
export default MergeStrategyRegistry;
//# sourceMappingURL=mergeStrategies.d.ts.map