export type MyceliumNodeType = 'query' | 'memory' | 'tool' | 'skill' | 'agent' | 'strategy' | 'document' | 'output' | 'safety' | 'verifier' | 'prompt_template' | 'workflow' | 'constraint' | 'preference' | 'model' | 'provider' | 'service' | 'service_state' | 'scheduler' | 'command_handler' | 'notification_template' | 'capability' | 'background_worker' | 'code_file';
export interface MyceliumNode {
    id: string;
    type: MyceliumNodeType;
    label: string;
    trust: number;
    cost: number;
    activation: number;
    /** Protected nodes (safety, verifiers, user prefs) are never pruned. */
    protected?: boolean;
    /** Optional human-readable summary used when building context packages. */
    summary?: string;
    metadata?: Record<string, unknown>;
}
export interface MyceliumEdge {
    source: string;
    target: string;
    weight: number;
    successCount: number;
    failureCount: number;
    totalReward: number;
    lastUsed: string;
    protected: boolean;
    /** Optional relation type, e.g. 'routes_to', 'must_verify_with', 'sequence_learning'. */
    relation?: string;
    /** Where this edge came from: seeded, query, sequence, manual. */
    origin?: 'seeded' | 'query' | 'sequence' | 'manual' | 'reinforcement' | 'code_intelligence';
    /** Times this edge was part of a route that hit a hard verifier block. */
    blockedCount?: number;
    /** ISO timestamp of the most recent hard block on this route. */
    lastBlockedAt?: string;
}
export interface MyceliumEpisode {
    id: string;
    query: string;
    route: string[];
    reward: number;
    timestamp: string; /** Optional route metadata for inspection. */
    taskType?: string;
    selectionReasons?: Record<string, string>;
    rewardComponents?: Record<string, number>;
    dryRun?: boolean;
    /** True when a verifier hard-check failed during this run. */
    blocked?: boolean;
    /** Human-readable reason the run was blocked, e.g. 'output_validation:fail'. */
    blockReason?: string;
    /** Names of verifier nodes that conceptually applied to this run. */
    appliedVerifiers?: string[];
    /** Explicit user feedback that drove this episode's reward, if any. */
    userFeedback?: 'up' | 'down' | 'neutral';
}
export interface ArchivedEdge {
    edge: MyceliumEdge;
    reason: string;
    archivedAt: string;
}
export interface MyceliumGraphData {
    nodes: MyceliumNode[];
    edges: MyceliumEdge[];
    episodes: MyceliumEpisode[];
    archivedEdges?: ArchivedEdge[];
}
export declare class MyceliumGraph {
    private nodes;
    private edges;
    private episodes;
    private archivedEdges;
    addNode(node: Omit<MyceliumNode, 'activation'>): MyceliumNode;
    getNode(id: string): MyceliumNode | undefined;
    listNodes(type?: MyceliumNodeType): MyceliumNode[];
    removeNode(id: string): boolean;
    addEdge(source: string, target: string, weight?: number, options?: {
        relation?: string;
        origin?: MyceliumEdge['origin'];
    }): MyceliumEdge;
    getEdge(source: string, target: string): MyceliumEdge | undefined;
    outgoingEdges(nodeId: string): MyceliumEdge[];
    incomingEdges(nodeId: string): MyceliumEdge[];
    listEdges(): MyceliumEdge[];
    filterEdges(predicate: (edge: MyceliumEdge) => boolean): number;
    /**
     * Archive an edge instead of hard-deleting. Returns true if the edge
     * was found and archived. Protected edges are never archived.
     */
    archiveEdge(source: string, target: string, reason: string): boolean;
    listArchivedEdges(): ArchivedEdge[];
    /** Protected nodes can be queried separately for inspection. */
    listProtectedNodes(): MyceliumNode[];
    /** Protected edges can be queried separately for inspection. */
    listProtectedEdges(): MyceliumEdge[];
    recordEpisode(query: string, route: string[], reward: number, extras?: {
        taskType?: string;
        selectionReasons?: Record<string, string>;
        rewardComponents?: Record<string, number>;
        dryRun?: boolean;
        blocked?: boolean;
        blockReason?: string;
        appliedVerifiers?: string[];
    }): MyceliumEpisode;
    /**
     * Mark every edge along `route` as having participated in a blocked
     * (hard-failed) run. Bumps `blockedCount` and `lastBlockedAt`. Used by
     * the router after a verifier hard-check failure so the UI can surface
     * which routes have repeatedly tripped safety blocks.
     */
    markRouteBlocked(route: string[]): number;
    listEpisodes(limit?: number): MyceliumEpisode[];
    resetActivations(): void;
    toJSON(): MyceliumGraphData;
    static fromJSON(data: MyceliumGraphData): MyceliumGraph;
    stats(): {
        nodes: number;
        edges: number;
        episodes: number;
        avgWeight: number;
        protectedNodes: number;
        protectedEdges: number;
        archivedEdges: number;
    };
}
export declare function loadMyceliumGraph(projectDir: string): Promise<MyceliumGraph>;
export declare function saveMyceliumGraph(projectDir: string, graph: MyceliumGraph): Promise<void>;
//# sourceMappingURL=graph.d.ts.map