import { MyceliumGraph, type MyceliumNode } from './graph';
import { type SelectedRoute } from './activation';
import { type RewardInput } from './reinforcement';
import { type MyceliumTaskClassification } from './taskClassifier';
import { type SeedSummary } from './seeds';
import { type ContextPackage, type RouteExplanation } from './contextPackage';
export interface MycelialRouterConfig {
    /** Reinforcement learning rate (default 0.08). */
    alpha?: number;
    /** Decay rate for unused edges (default 0.02). */
    beta?: number;
    /** Exploration rate for route selection (default 0.15). */
    exploreRate?: number;
    /** Maximum context nodes per query (default 12). */
    maxNodes?: number;
    /** Activation propagation hops (default 3). */
    hops?: number;
}
export interface MycelialContextResult {
    /** Selected nodes that form the context subgraph. */
    nodes: MyceliumNode[];
    /** Node IDs in route order. */
    route: string[];
    /** Context text assembled from selected nodes. */
    contextText: string;
    /** Graph stats after routing. */
    stats: ReturnType<MyceliumGraph['stats']>;
}
export interface RouteQueryOptions {
    /** If true, log the route but do not let the harness execute external actions. */
    dryRun?: boolean;
    /** Pre-computed semantic relevance scores for candidate nodes. */
    relevanceScores?: Map<string, number>;
    /** Override the rule-based classifier (e.g. for tests). */
    classification?: MyceliumTaskClassification;
    /** Override the random source for deterministic exploration in tests. */
    random?: () => number;
}
export interface MycelialRichResult extends MycelialContextResult {
    classification: MyceliumTaskClassification;
    contextPackage: ContextPackage;
    explanation: RouteExplanation;
    selectedRoute: SelectedRoute;
}
export declare class MycelialContextRouter {
    private graph;
    private projectDir;
    private config;
    private lastRoute;
    private lastQuery;
    private lastDryRun;
    private lastSelectionReasons;
    private lastExplanation;
    private lastContextPackage;
    private lastClassification;
    constructor(projectDir: string, graph: MyceliumGraph, config?: MycelialRouterConfig);
    seedToolNodes(tools: Array<{
        name: string;
        description: string;
        riskLevel?: string;
    }>): void;
    seedSkillNodes(skills: Array<{
        name: string;
        description: string;
        domain?: string;
    }>): void;
    seedMemoryNodes(entries: Array<{
        id: string;
        text: string;
        kind?: string;
    }>): void;
    seedStrategyNode(id: string, label: string, trust?: number): void;
    /** Seed the generic safety / agent / workflow / verifier / prompt nodes. Idempotent. */
    seedGeneric(): SeedSummary;
    routeQuery(query: string, relevanceScores?: Map<string, number>): MycelialContextResult;
    /**
     * Route a query and return the rich result: classification, structured
     * context package, route explanation, and the SelectedRoute itself.
     * The legacy routeQuery() above delegates here.
     */
    routeQueryRich(query: string, options?: RouteQueryOptions): MycelialRichResult;
    reinforce(reward: RewardInput, verifierInfo?: {
        blocked?: boolean;
        blockReason?: string;
        appliedVerifiers?: string[];
    }): void;
    decay(): {
        decayed: number;
        pruned: number;
    };
    save(): Promise<void>;
    getGraph(): MyceliumGraph;
    getLastRoute(): string[];
    getLastExplanation(): RouteExplanation | null;
    getLastContextPackage(): ContextPackage | null;
    getLastClassification(): MyceliumTaskClassification | null;
    /** Convenience for CLI / debug surfaces. */
    formatLastExplanation(): string;
    stats(): ReturnType<MyceliumGraph['stats']>;
    /**
     * Apply explicit user feedback (thumbs-up = 1.0, thumbs-down = 0.0,
     * neutral = 0.5) to the most recent episode's route. Re-runs reinforcement
     * with the feedback as `userSatisfaction`, which carries 10% of the
     * reward formula. Episodes record `userFeedback` so the UI can show what
     * was overridden.
     */
    applyUserFeedback(feedback: 'up' | 'down' | 'neutral', note?: string): {
        applied: boolean;
        previousReward?: number;
        newReward?: number;
    };
}
export declare function createMycelialRouter(projectDir: string, config?: MycelialRouterConfig): Promise<MycelialContextRouter>;
export declare function computeSemanticRelevance(query: string, nodes: MyceliumNode[], ollamaHost: string, model?: string): Promise<Map<string, number>>;
//# sourceMappingURL=router.d.ts.map