@principal-ai/principal-view-react 0.16.21 → 0.16.23
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.
- package/dist/components/GraphRenderer.js.map +1 -1
- package/dist/components/session-events/SessionEventFeed.d.ts.map +1 -1
- package/dist/components/session-events/SessionEventFeed.js +10 -3
- package/dist/components/session-events/SessionEventFeed.js.map +1 -1
- package/dist/graphify/consolidated.d.ts +170 -0
- package/dist/graphify/consolidated.d.ts.map +1 -0
- package/dist/graphify/consolidated.js +11 -0
- package/dist/graphify/consolidated.js.map +1 -0
- package/dist/graphify/index.d.ts +9 -0
- package/dist/graphify/index.d.ts.map +1 -0
- package/dist/graphify/index.js +8 -0
- package/dist/graphify/index.js.map +1 -0
- package/dist/graphify/types.d.ts +141 -0
- package/dist/graphify/types.d.ts.map +1 -0
- package/dist/graphify/types.js +8 -0
- package/dist/graphify/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +28 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -0
- package/dist/subsystem/SubsystemComponentGraph.js +365 -0
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -0
- package/dist/subsystem/model.d.ts +131 -0
- package/dist/subsystem/model.d.ts.map +1 -0
- package/dist/subsystem/model.js +296 -0
- package/dist/subsystem/model.js.map +1 -0
- package/dist/subsystem/nodes.d.ts +28 -0
- package/dist/subsystem/nodes.d.ts.map +1 -0
- package/dist/subsystem/nodes.js +230 -0
- package/dist/subsystem/nodes.js.map +1 -0
- package/dist/utils/elkLayout.d.ts +19 -0
- package/dist/utils/elkLayout.d.ts.map +1 -1
- package/dist/utils/elkLayout.js +72 -9
- package/dist/utils/elkLayout.js.map +1 -1
- package/package.json +3 -3
- package/src/components/GraphRenderer.tsx +2 -2
- package/src/components/session-events/SessionEventFeed.tsx +20 -3
- package/src/graphify/consolidated.ts +202 -0
- package/src/graphify/index.ts +36 -0
- package/src/graphify/types.ts +164 -0
- package/src/index.ts +31 -0
- package/src/stories/SubsystemComponentGraph.stories.tsx +761 -0
- package/src/subsystem/SubsystemComponentGraph.tsx +585 -0
- package/src/subsystem/model.test.ts +81 -0
- package/src/subsystem/model.ts +434 -0
- package/src/subsystem/nodes.tsx +353 -0
- package/src/utils/elkLayout.ts +98 -9
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graphify graph.json schema types.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the graphify data model (graphify/validate.py, graphify/export.py)
|
|
5
|
+
* so graphify output can be consumed by this library in a type-compatible way.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Any JSON-serializable value carried in node/edge metadata. */
|
|
9
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };
|
|
10
|
+
|
|
11
|
+
/** Node classification (graphify/validate.py VALID_FILE_TYPES). */
|
|
12
|
+
export type GraphifyFileType = 'code' | 'document' | 'paper' | 'image' | 'rationale' | 'concept';
|
|
13
|
+
|
|
14
|
+
/** Edge provenance tag (graphify/validate.py VALID_CONFIDENCES). */
|
|
15
|
+
export type GraphifyConfidence = 'EXTRACTED' | 'INFERRED' | 'AMBIGUOUS';
|
|
16
|
+
|
|
17
|
+
/** Optional semantic kind carried on nodes (e.g. `module`, `namespace`). */
|
|
18
|
+
export type GraphifyNodeType = 'module' | 'namespace' | string;
|
|
19
|
+
|
|
20
|
+
/** Canonical relation verbs emitted by graphify extractors and resolvers. */
|
|
21
|
+
export type GraphifyRelation =
|
|
22
|
+
| 'calls'
|
|
23
|
+
| 'imports'
|
|
24
|
+
| 'imports_from'
|
|
25
|
+
| 're_exports'
|
|
26
|
+
| 'references'
|
|
27
|
+
| 'inherits'
|
|
28
|
+
| 'implements'
|
|
29
|
+
| 'mixes_in'
|
|
30
|
+
| 'uses'
|
|
31
|
+
| 'contains'
|
|
32
|
+
| 'defines'
|
|
33
|
+
| 'method'
|
|
34
|
+
| 'decorator'
|
|
35
|
+
| 'rationale_for'
|
|
36
|
+
| 'semantically_similar_to'
|
|
37
|
+
| string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A graphify node.
|
|
41
|
+
*
|
|
42
|
+
* Required fields are enforced by graphify/validate.py:
|
|
43
|
+
* `id`, `label`, `file_type`, `source_file`. The rest are populated by the
|
|
44
|
+
* extractors (`source_location`, optional `type`/`metadata`) and by the build
|
|
45
|
+
* writer (`community`, `community_name`, `norm_label`).
|
|
46
|
+
*/
|
|
47
|
+
export interface GraphifyNode {
|
|
48
|
+
/** Stable identifier: repo-relative path + symbol names (make_id slug). */
|
|
49
|
+
id: string;
|
|
50
|
+
/** Human-readable name. */
|
|
51
|
+
label: string;
|
|
52
|
+
/** Classification used as the primary node kind. */
|
|
53
|
+
file_type: GraphifyFileType;
|
|
54
|
+
/** Repo-relative path of the source file this node came from. */
|
|
55
|
+
source_file: string;
|
|
56
|
+
/** `L<line>` location, or `''` for sourceless stub nodes. */
|
|
57
|
+
source_location?: string | null;
|
|
58
|
+
/** Optional semantic kind (e.g. `module`, `namespace`). */
|
|
59
|
+
type?: GraphifyNodeType;
|
|
60
|
+
/** Node state / extra node definitions. */
|
|
61
|
+
state?: string;
|
|
62
|
+
/** Arbitrary per-extractor metadata (e.g. `{ kind: "csharp_namespace" }`). */
|
|
63
|
+
metadata?: Record<string, JsonValue>;
|
|
64
|
+
/** Leiden community id, stamped at build time. */
|
|
65
|
+
community?: number | null;
|
|
66
|
+
/** Human-readable community label, stamped at build time. */
|
|
67
|
+
community_name?: string;
|
|
68
|
+
/** Diacritic-stripped lowercased label, stamped at build time. */
|
|
69
|
+
norm_label?: string;
|
|
70
|
+
/** Extra fields tolerated for forward compatibility. */
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A graphify edge.
|
|
76
|
+
*
|
|
77
|
+
* Required fields: `source`, `target`, `relation`, `confidence`, `source_file`.
|
|
78
|
+
* `context` is populated for `references` edges (e.g. `type`, `return_type`,
|
|
79
|
+
* `field`, `generic_arg`).
|
|
80
|
+
*/
|
|
81
|
+
export interface GraphifyEdge {
|
|
82
|
+
/** Source node id. */
|
|
83
|
+
source: string;
|
|
84
|
+
/** Target node id. */
|
|
85
|
+
target: string;
|
|
86
|
+
/** Canonical relation verb. */
|
|
87
|
+
relation: GraphifyRelation;
|
|
88
|
+
/** Provenance: read directly from source vs. resolved by graphify. */
|
|
89
|
+
confidence: GraphifyConfidence;
|
|
90
|
+
/** Float 0.0-1.0; 1.0 for EXTRACTED, discrete rubric for INFERRED. */
|
|
91
|
+
confidence_score?: number;
|
|
92
|
+
/** Repo-relative path where the relationship was found. */
|
|
93
|
+
source_file: string;
|
|
94
|
+
/** `L<line>` location of the relationship. */
|
|
95
|
+
source_location?: string | null;
|
|
96
|
+
/** Edge weight. */
|
|
97
|
+
weight?: number;
|
|
98
|
+
/** Reference context for `references` edges. */
|
|
99
|
+
context?: string;
|
|
100
|
+
/** Arbitrary per-extractor metadata. */
|
|
101
|
+
metadata?: Record<string, JsonValue>;
|
|
102
|
+
/** Extra fields tolerated for forward compatibility. */
|
|
103
|
+
[key: string]: unknown;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A graphify hyperedge — a group relationship connecting 3+ nodes.
|
|
108
|
+
*
|
|
109
|
+
* Member list is canonical on `nodes` (aliases `members`/`node_ids` are folded
|
|
110
|
+
* by graphify/export.py build normalization).
|
|
111
|
+
*/
|
|
112
|
+
export interface GraphifyHyperedge {
|
|
113
|
+
/** Stable identifier. */
|
|
114
|
+
id: string;
|
|
115
|
+
/** Human-readable label. */
|
|
116
|
+
label?: string;
|
|
117
|
+
/** Member node ids (canonical key). */
|
|
118
|
+
nodes: string[];
|
|
119
|
+
/** Group relation verb (e.g. `participate_in`, `implement`, `form`). */
|
|
120
|
+
relation?: GraphifyRelation;
|
|
121
|
+
/** Provenance tag. */
|
|
122
|
+
confidence?: GraphifyConfidence;
|
|
123
|
+
/** Float 0.0-1.0. */
|
|
124
|
+
confidence_score?: number;
|
|
125
|
+
/** Repo-relative path where the relationship was found. */
|
|
126
|
+
source_file?: string;
|
|
127
|
+
/** Extra fields tolerated for forward compatibility. */
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Graph-level metadata stored on the graph (`graph` key). */
|
|
132
|
+
export interface GraphifyGraphMetadata {
|
|
133
|
+
directed?: boolean;
|
|
134
|
+
multigraph?: boolean;
|
|
135
|
+
/** Edges may be serialized under `links` (NetworkX node-link) or `edges`. */
|
|
136
|
+
hyperedges?: GraphifyHyperedge[];
|
|
137
|
+
[key: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The full graph.json document.
|
|
142
|
+
*
|
|
143
|
+
* graphify writes NetworkX node-link format: nodes under `nodes`, edges under
|
|
144
|
+
* `links`. Older/legacy payloads may use `edges` instead of `links`.
|
|
145
|
+
*/
|
|
146
|
+
export interface GraphifyGraph {
|
|
147
|
+
/** Graph nodes. */
|
|
148
|
+
nodes: GraphifyNode[];
|
|
149
|
+
/** Graph edges (NetworkX node-link key). */
|
|
150
|
+
links?: GraphifyEdge[];
|
|
151
|
+
/** Legacy alias for `links`. */
|
|
152
|
+
edges?: GraphifyEdge[];
|
|
153
|
+
/** Group relationships connecting 3+ nodes. */
|
|
154
|
+
hyperedges?: GraphifyHyperedge[];
|
|
155
|
+
/** Graph-level metadata (directed, multigraph, hyperedges). */
|
|
156
|
+
graph?: GraphifyGraphMetadata;
|
|
157
|
+
/** Top-level directed flag (NetworkX). */
|
|
158
|
+
directed?: boolean;
|
|
159
|
+
/** Top-level multigraph flag (NetworkX). */
|
|
160
|
+
multigraph?: boolean;
|
|
161
|
+
/** Git HEAD the graph was built against, when available. */
|
|
162
|
+
built_at_commit?: string;
|
|
163
|
+
[key: string]: unknown;
|
|
164
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -211,3 +211,34 @@ export type {
|
|
|
211
211
|
SessionEventFeedGroupedProps,
|
|
212
212
|
SessionEventFeedRow,
|
|
213
213
|
} from './components/session-events';
|
|
214
|
+
|
|
215
|
+
// Graphify integration types (graph.json data model)
|
|
216
|
+
export type {
|
|
217
|
+
JsonValue,
|
|
218
|
+
GraphifyFileType,
|
|
219
|
+
GraphifyConfidence,
|
|
220
|
+
GraphifyNodeType,
|
|
221
|
+
GraphifyRelation,
|
|
222
|
+
GraphifyNode,
|
|
223
|
+
GraphifyEdge,
|
|
224
|
+
GraphifyHyperedge,
|
|
225
|
+
GraphifyGraphMetadata,
|
|
226
|
+
GraphifyGraph,
|
|
227
|
+
} from './graphify';
|
|
228
|
+
export type {
|
|
229
|
+
GraphifyAnchorResolution,
|
|
230
|
+
SubsystemGraphifyAnchor,
|
|
231
|
+
GraphifyMethodInfo,
|
|
232
|
+
GraphifyPropertyInfo,
|
|
233
|
+
GraphifyParamInfo,
|
|
234
|
+
GraphifyCallInfo,
|
|
235
|
+
GraphifyReferenceInfo,
|
|
236
|
+
GraphifyImportInfo,
|
|
237
|
+
GraphifyClassDetail,
|
|
238
|
+
GraphifyFunctionDetail,
|
|
239
|
+
GraphifyTypeDetail,
|
|
240
|
+
GraphifyModuleDetail,
|
|
241
|
+
GraphifyExternalDetail,
|
|
242
|
+
GraphifyComponentDetail,
|
|
243
|
+
GraphifyEdgeRef,
|
|
244
|
+
} from './graphify';
|