import { type CaseEdge } from '../types/sparkContracts';
import { type KnowledgeScope } from './scopedKnowledgeStore';
export interface FindRelatedOptions {
    /** Only return edges whose `relation` matches one of these values. */
    relations?: string[];
    /** Direction to traverse. `out` = from this case to others;
     *  `in` = others pointing at this case; `both` = either direction. */
    direction?: 'out' | 'in' | 'both';
    /** Maximum hits returned. Defaults to 10. */
    topK?: number;
    /** Enterprise tenant/workspace scope. Ignored by legacy JSON storage. */
    knowledgeScope?: KnowledgeScope;
}
/**
 * CaseGraph — local file-backed edge storage. Same persistence
 * contract as ragStore / baselineStore / projectMemory / caseLibrary.
 */
export declare class CaseGraph {
    private readonly storagePath;
    /** Map from canonical edge key to the stored edge. */
    private readonly edges;
    private loaded;
    constructor(storagePath: string);
    load(): void;
    /**
     * Add or replace an edge. Throws on self-loop. Re-inserting the
     * same `(from, to, relation)` triplet replaces weight + note +
     * edgeId (so callers can keep the latest curator note).
     */
    addEdge(edge: CaseEdge, scope?: KnowledgeScope): void;
    /** Remove an edge by canonical id. Returns whether it was present. */
    removeEdge(edgeId: string, scope?: KnowledgeScope): boolean;
    /** Get all edges originating at the case. */
    getEdgesFrom(caseId: string, scope?: KnowledgeScope): CaseEdge[];
    /** Get all edges pointing at the case. */
    getEdgesTo(caseId: string, scope?: KnowledgeScope): CaseEdge[];
    /**
     * Single-hop traversal. Returns related case ids paired with the
     * connecting edge, ordered by edge weight descending (unweighted
     * edges sort to the back). Optional relation filter narrows the
     * set; `direction` controls in/out/both.
     */
    findRelated(caseId: string, opts?: FindRelatedOptions): Array<{
        caseId: string;
        edge: CaseEdge;
    }>;
    /** All edges, deterministically ordered by canonical key. Used by
     * the export bundler that joins this with the case library. */
    listEdges(scope?: KnowledgeScope): CaseEdge[];
    /** Total edge count. */
    size(scope?: KnowledgeScope): number;
    private persist;
    private listEnterpriseEdges;
}
//# sourceMappingURL=caseGraph.d.ts.map