/** * graph_traverse Tool * * Knowledge graph traversal over institutional memory triples. * Single tool with 4 lenses: connected_to, produced_by, provenance, stats. * * No SQL migrations — uses directQuery + client-side assembly. * Dataset is small (~668 triples) so full-table fetch is fine for * provenance/stats; connected_to/produced_by use targeted PostgREST filters. * * Performance target: 3000ms */ import type { Project, PerformanceData } from "../types/index.js"; export type GraphTraverseLens = "connected_to" | "produced_by" | "provenance" | "stats"; export interface GraphTraverseParams { lens: GraphTraverseLens; /** Starting node. Examples: "PROJ-123", "cli", "Scar: Done ≠ Deployed" */ node?: string; /** Filter by predicate */ predicate?: string; /** Max chain depth for provenance (default: 3) */ depth?: number; /** Project scope */ project?: Project; /** Max triples to return (default: 50) */ limit?: number; } interface RawTriple { id: string; subject: string; predicate: string; object: string; event_time: string; decay_weight: number; source_type: string | null; source_id: string | null; source_linear_issue: string | null; created_by: string | null; } interface GraphNode { label: string; type: string; as_subject: RawTriple[]; as_object: RawTriple[]; } interface ProvenanceHop { depth: number; triples: RawTriple[]; } interface GraphStats { total_triples: number; predicate_distribution: Record; top_subjects: Array<{ label: string; count: number; }>; top_objects: Array<{ label: string; count: number; }>; issues_by_learning_count: Array<{ issue: string; count: number; }>; agents_by_contribution: Array<{ agent: string; count: number; }>; } export interface GraphTraverseResult { success: boolean; lens: GraphTraverseLens; query_node?: string; summary: string; display?: string; node?: GraphNode; chain?: ProvenanceHop[]; stats?: GraphStats; total_triples_scanned: number; performance: PerformanceData; } export declare function graphTraverse(params: GraphTraverseParams): Promise; export {}; //# sourceMappingURL=graph-traverse.d.ts.map