import { KnowledgeGraph } from '../contracts/graph.js'; import { type Communities } from './cluster.js'; export interface GodNode { id: string; label: string; edges: number; } export interface SurprisingConnection { source: string; target: string; source_files: [string, string]; confidence: string; confidence_score?: number; relation: string; why: string; note?: string; } export interface SuggestedQuestion { type: string; question: string | null; why: string; } export interface SemanticAnomaly { id: string; kind: 'bridge_node' | 'cross_boundary_edge' | 'low_cohesion_community'; severity: 'HIGH' | 'MEDIUM' | 'LOW'; score: number; summary: string; why: string; } export interface GraphDiffResult { new_nodes: Array<{ id: string; label: string; }>; removed_nodes: Array<{ id: string; label: string; }>; new_edges: Array<{ source: string; target: string; relation: string; confidence: string; }>; removed_edges: Array<{ source: string; target: string; relation: string; confidence: string; }>; summary: string; } export interface GraphStructureMetrics { total_nodes: number; total_edges: number; weakly_connected_components: number; singleton_components: number; isolated_nodes: number; largest_component_nodes: number; largest_component_ratio: number; low_cohesion_communities: number; largest_low_cohesion_community_nodes: number; largest_low_cohesion_community_score: number; } export interface WorkspaceBridgeCommunity { id: number; label: string; node_count: number; } export interface WorkspaceBridge { id: string; label: string; community_id: number | null; community_label: string; connected_communities: WorkspaceBridgeCommunity[]; degree: number; score: number; source_files: string[]; } export declare function _nodeCommunityMap(communities: Communities): Record; export declare function _isFileNode(graph: KnowledgeGraph, nodeId: string): boolean; export declare function _isConceptNode(graph: KnowledgeGraph, nodeId: string): boolean; export declare function _fileCategory(path: string): 'code' | 'paper' | 'image' | 'audio' | 'video' | 'doc'; export declare function isAnalysisEntityNode(graph: KnowledgeGraph, nodeId: string): boolean; export declare function analysisEntityDegree(graph: KnowledgeGraph, nodeId: string): number; export declare function _surpriseScore(graph: KnowledgeGraph, sourceNodeId: string, targetNodeId: string, edgeData: Record, nodeCommunity: Record, sourceFile: string, targetFile: string): [number, string[]]; export declare function godNodes(graph: KnowledgeGraph, topN?: number): GodNode[]; export declare function graphStructureMetrics(graph: KnowledgeGraph): GraphStructureMetrics; export declare function workspaceBridges(graph: KnowledgeGraph, communities: Communities, communityLabels?: Record, topN?: number): WorkspaceBridge[]; export declare function surprisingConnections(graph: KnowledgeGraph, communities?: Communities, topN?: number): SurprisingConnection[]; export declare function semanticAnomalies(graph: KnowledgeGraph, communities: Communities, communityLabels?: Record, topN?: number): SemanticAnomaly[]; export declare function suggestQuestions(graph: KnowledgeGraph, communities: Communities, communityLabels: Record, topN?: number): SuggestedQuestion[]; export declare function graphDiff(oldGraph: KnowledgeGraph, newGraph: KnowledgeGraph): GraphDiffResult;