import type { OntologyConfig } from "../config/types.js"; import type { OntologyDiff, FunctionChange } from "../lockfile/types.js"; export type NodeType = "entity" | "function" | "accessGroup"; export type EdgeType = "operates-on" | "requires-access" | "depends-on"; export type ChangeStatus = "added" | "removed" | "modified" | "unchanged"; export interface GraphNode { id: string; type: NodeType; label: string; description: string; metadata: { inputs?: Record; outputs?: Record; functionCount?: number; usesUserContext?: boolean; usesOrganizationContext?: boolean; isReadOnly?: boolean; }; } export interface GraphEdge { id: string; source: string; target: string; type: EdgeType; label?: string; } export interface GraphData { nodes: GraphNode[]; edges: GraphEdge[]; meta: { ontologyName: string; totalFunctions: number; totalEntities: number; totalAccessGroups: number; totalUserContextFunctions: number; totalOrganizationContextFunctions: number; }; } export interface EnhancedGraphNode extends GraphNode { changeStatus: ChangeStatus; changeDetails?: FunctionChange; } export interface EnhancedGraphData { nodes: EnhancedGraphNode[]; edges: GraphEdge[]; meta: GraphData["meta"] & { hasChanges: boolean; addedCount: number; removedCount: number; modifiedCount: number; }; diff: OntologyDiff | null; } /** * Transform OntologyConfig into graph data for visualization */ export declare function transformToGraphData(config: OntologyConfig): GraphData; /** * Search nodes by label or description */ export declare function searchNodes(graphData: GraphData, query: string): Array<{ id: string; type: NodeType; label: string; matchType: "label" | "description"; }>; /** * Get detailed node information including connections */ export declare function getNodeDetails(graphData: GraphData, nodeId: string): { node: GraphNode | null; connections: { accessGroups: string[]; entities: string[]; dependsOn: Array<{ functionName: string; path: string; }>; dependedOnBy: string[]; functions: Array<{ name: string; description: string; inputs?: Record; outputs?: Record; }>; }; }; /** * Enhance graph data with diff information for review mode */ export declare function enhanceWithDiff(graphData: GraphData, diff: OntologyDiff | null): EnhancedGraphData;