/**
 * Evolution Engine
 *
 * Meta-evolution layer that controls language evolution itself.
 * Includes emergent grammar and fission protocol.
 */
import { GrammarRule, EvolutionPolicy, Pattern } from './types.js';
export declare class EvolutionEngine {
    private grammar;
    private policy;
    private mutationHistory;
    private sandboxResults;
    constructor(policy?: Partial<EvolutionPolicy>);
    /**
     * Get current grammar rules
     */
    getGrammar(): GrammarRule[];
    /**
     * Add a grammar rule
     */
    addRule(rule: GrammarRule): void;
    /**
     * Find matching grammar rule for a pattern
     */
    matchRule(pattern: string[]): GrammarRule | null;
    /**
     * Calculate how well a pattern matches a rule
     */
    private calculateMatchScore;
    /**
     * Generate a grammar mutation
     */
    generateMutation(): GrammarRule;
    /**
     * Generate a pattern based on mutation type
     */
    private generatePattern;
    /**
     * Test mutation in sandbox
     */
    testMutation(mutation: GrammarRule): Promise<boolean>;
    /**
     * Incorporate successful mutation
     */
    incorporate(mutation: GrammarRule): void;
    /**
     * Check adoption rate
     */
    getAdoptionRate(mutationId: string): number;
    /**
     * Update adoption rate
     */
    updateAdoptionRate(mutationId: string, rate: number): void;
    /**
     * Govern the evolution process
     */
    govern(health: {
        coherence: number;
        stagnation: number;
    }): void;
    /**
     * Mutate the grammar
     */
    mutateGrammar(): void;
    /**
     * Introduce diversity
     */
    introduceDiversity(): void;
    /**
     * Learn from mutation history
     */
    metaLearn(): void;
    /**
     * Record mutation result
     */
    recordMutation(mutation: unknown, success: boolean): void;
    /**
     * Stabilize grammar: convert high-adoption patterns to rules
     */
    stabilizeGrammar(): GrammarRule[];
    /**
     * Prune low-confidence rules
     */
    pruneGrammar(): void;
    /**
     * Discover new patterns from agent interactions
     */
    discoverPattern(interaction: {
        tokens: string[];
        success: boolean;
        value: number;
    }): GrammarRule | null;
    getPolicy(): EvolutionPolicy;
    setPolicy(policy: Partial<EvolutionPolicy>): void;
}
export declare class FissionProtocol {
    private propagationThreshold;
    private decayRate;
    private branchingFactor;
    private propagationQueue;
    /**
     * Trigger fission when pattern value exceeds threshold
     */
    fission(pattern: Pattern, neighbors: string[], getNeighbor: (id: string) => {
        receive: (pattern: Pattern, value: number) => void;
    }): void;
    /**
     * Receive pattern from fission
     */
    receive(pattern: Pattern, value: number): Pattern;
    /**
     * Set propagation threshold
     */
    setThreshold(threshold: number): void;
    /**
     * Set branching factor
     */
    setBranchingFactor(factor: number): void;
}
export declare const createEvolutionEngine: (policy?: Partial<EvolutionPolicy>) => EvolutionEngine;
export declare const createFissionProtocol: () => FissionProtocol;
