/**
 * Query 4: Graphiti facts for structural neighbors.
 * Distance 1, summary detail.
 */
import { GraphitiClient } from "../../graphiti-client.js";
export const neighborFacts = {
    name: "neighbor-facts",
    source: "graphiti",
    distance: 1,
    maxResults: 5,
    detail: "summary",
    async execute(ctx) {
        if (ctx.neighbors.length === 0)
            return [];
        try {
            const client = new GraphitiClient(ctx.projectRoot);
            const query = ctx.neighbors.slice(0, 10).join(", ");
            const facts = await client.searchFacts(query, { maxResults: 5 });
            return facts.map((f) => ({
                source: "graphiti",
                distance: 1,
                detail: "summary",
                content: f.fact ?? "(no fact text)",
                metadata: { factId: f.uuid },
            }));
        }
        catch {
            return [];
        }
    },
};
