@nex-ai/nex 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Self-contained HTML graph visualization using D3.js with SVG rendering.
3
+ * Exact clone of Zep's graph approach, adapted for Nex entity/insight structure.
4
+ * Generates a single HTML string that can be opened in any browser.
5
+ */
6
+ export interface GraphNode {
7
+ id: string;
8
+ name: string;
9
+ type: string;
10
+ definition_slug: string;
11
+ primary_attribute?: string;
12
+ created_at?: string;
13
+ summary?: string;
14
+ }
15
+ export interface GraphEdge {
16
+ id: string;
17
+ source: string;
18
+ target: string;
19
+ label: string;
20
+ definition_id: string;
21
+ }
22
+ export interface ContextEdge {
23
+ id: string;
24
+ source: string;
25
+ target: string;
26
+ label: string;
27
+ edge_type: "context" | "triplet" | "insight";
28
+ confidence?: number;
29
+ }
30
+ export interface InsightNode {
31
+ id: string;
32
+ content: string;
33
+ type: string;
34
+ confidence: number;
35
+ source: "entity_insight" | "knowledge_insight";
36
+ }
37
+ export interface EntityInsightSummary {
38
+ content: string;
39
+ confidence: number;
40
+ type: string;
41
+ }
42
+ export interface RelationshipDefinition {
43
+ id: string;
44
+ name: string;
45
+ entity_1_to_2: string;
46
+ entity_2_to_1: string;
47
+ }
48
+ export interface GraphData {
49
+ nodes: GraphNode[];
50
+ edges: GraphEdge[];
51
+ context_edges: ContextEdge[];
52
+ insight_nodes: InsightNode[];
53
+ relationship_definitions: RelationshipDefinition[];
54
+ insights: Record<string, EntityInsightSummary[]>;
55
+ total_nodes: number;
56
+ total_edges: number;
57
+ total_context_edges: number;
58
+ }
59
+ export declare function generateGraphHtml(data: GraphData): string;