@principal-ai/principal-view-react 0.16.47 → 0.16.50
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/graphify/anchor.d.ts +28 -0
- package/dist/graphify/anchor.d.ts.map +1 -0
- package/dist/graphify/anchor.js +132 -0
- package/dist/graphify/anchor.js.map +1 -0
- package/dist/graphify/consolidated.d.ts +12 -1
- package/dist/graphify/consolidated.d.ts.map +1 -1
- package/dist/graphify/ids.d.ts +19 -0
- package/dist/graphify/ids.d.ts.map +1 -0
- package/dist/graphify/ids.js +46 -0
- package/dist/graphify/ids.js.map +1 -0
- package/dist/graphify/index.d.ts +7 -0
- package/dist/graphify/index.d.ts.map +1 -1
- package/dist/graphify/index.js +4 -0
- package/dist/graphify/index.js.map +1 -1
- package/dist/graphify/kind.d.ts +23 -0
- package/dist/graphify/kind.d.ts.map +1 -0
- package/dist/graphify/kind.js +71 -0
- package/dist/graphify/kind.js.map +1 -0
- package/dist/graphify/signature.d.ts +87 -0
- package/dist/graphify/signature.d.ts.map +1 -0
- package/dist/graphify/signature.js +276 -0
- package/dist/graphify/signature.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/subsystem/ComponentDeclaration.d.ts +58 -3
- package/dist/subsystem/ComponentDeclaration.d.ts.map +1 -1
- package/dist/subsystem/ComponentDeclaration.js +186 -53
- package/dist/subsystem/ComponentDeclaration.js.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts +5 -0
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +2 -2
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/formatDeclaration.d.ts.map +1 -1
- package/dist/subsystem/formatDeclaration.js +12 -1
- package/dist/subsystem/formatDeclaration.js.map +1 -1
- package/dist/subsystem/model.d.ts +1 -1
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js +1 -0
- package/dist/subsystem/model.js.map +1 -1
- package/package.json +1 -1
- package/src/graphify/anchor.test.ts +124 -0
- package/src/graphify/anchor.ts +160 -0
- package/src/graphify/consolidated.ts +13 -0
- package/src/graphify/ids.ts +48 -0
- package/src/graphify/index.ts +26 -0
- package/src/graphify/kind.test.ts +108 -0
- package/src/graphify/kind.ts +114 -0
- package/src/graphify/signature.test.ts +278 -0
- package/src/graphify/signature.ts +354 -0
- package/src/index.ts +26 -0
- package/src/stories/ComponentDeclarationAudit.stories.tsx +32 -0
- package/src/subsystem/ComponentDeclaration.tsx +306 -56
- package/src/subsystem/SubsystemComponentGraph.tsx +8 -1
- package/src/subsystem/formatDeclaration.ts +13 -1
- package/src/subsystem/model.ts +2 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signature / params verification against graphify `references` edges.
|
|
3
|
+
*
|
|
4
|
+
* Graphify does not store arity or parameter names — only `parameter_type` /
|
|
5
|
+
* `return_type` edges to type nodes (unions become multiple edges). Comparison
|
|
6
|
+
* is therefore **named type bags**, not positional arity.
|
|
7
|
+
*
|
|
8
|
+
* Many TS/JS functions have no such edges yet. When graphify has no signature
|
|
9
|
+
* signal, the check is skipped (not a hard fail) so Verify can still gate on
|
|
10
|
+
* kind. When graphify *does* emit types, claimed detail must match.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { GraphifyEdge, GraphifyNode } from './types';
|
|
14
|
+
|
|
15
|
+
/** Inferred signature from graphify edges (no param names). */
|
|
16
|
+
export interface GraphifyInferredSignature {
|
|
17
|
+
parameters: Array<{ type: string; nodeId: string }>;
|
|
18
|
+
returnType?: string;
|
|
19
|
+
returnTypeNodeId?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Types reachable only via `generic_arg` edges (Promise<X>, Array<X>,
|
|
22
|
+
* Omit<X,…>, Map<…>). Kept out of `parameters`/`returnType` — not read
|
|
23
|
+
* by the bag comparison — so skipped cases can be told apart.
|
|
24
|
+
*/
|
|
25
|
+
genericArgs?: Array<{ type: string; nodeId: string }>;
|
|
26
|
+
/**
|
|
27
|
+
* Count of `inline_parameter` self-edges (anonymous object-literal params).
|
|
28
|
+
* Graphify emits one per anon param only with its `--inline-params` flag.
|
|
29
|
+
*/
|
|
30
|
+
inlineParameters?: number;
|
|
31
|
+
/** True when at least one parameter_type or return_type edge exists. */
|
|
32
|
+
hasSignal: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ClaimedSignature {
|
|
36
|
+
parameters?: Array<{ name?: string; type: string }>;
|
|
37
|
+
returnType?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Granular skip classification. `signature_skipped` means "graphify has no
|
|
42
|
+
* parameter_type/return_type edges to compare", but *why* matters for future
|
|
43
|
+
* work:
|
|
44
|
+
* - `no_claimed_types`: authored detail has no named types (primitives/inline).
|
|
45
|
+
* - `generic_arg_only`: claimed types resolve, but only as `generic_arg`
|
|
46
|
+
* (Promise/Omit/Map/Array wrappers) — this extractor does not read them.
|
|
47
|
+
* - `partially_generic_arg`: some, not all, claimed types resolve as generic_arg.
|
|
48
|
+
* - `unresolved_claimed_types`: claimed names have no edges at all
|
|
49
|
+
* (global/npm types, or a dropped same-file label collision).
|
|
50
|
+
*/
|
|
51
|
+
export type SignatureSkipCode =
|
|
52
|
+
| 'no_claimed_types'
|
|
53
|
+
| 'generic_arg_only'
|
|
54
|
+
| 'partially_generic_arg'
|
|
55
|
+
| 'unresolved_claimed_types';
|
|
56
|
+
|
|
57
|
+
export interface SignatureCompareResult {
|
|
58
|
+
match: boolean;
|
|
59
|
+
/** Skipped because graphify had no parameter/return type edges. */
|
|
60
|
+
skipped: boolean;
|
|
61
|
+
reason?: string;
|
|
62
|
+
/** Granular skip classification when `skipped` is true. */
|
|
63
|
+
skipCode?: SignatureSkipCode;
|
|
64
|
+
claimed: { parameterTypes: string[]; returnTypes: string[] };
|
|
65
|
+
inferred: { parameterTypes: string[]; returnTypes: string[] };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const PRIMITIVES = new Set([
|
|
69
|
+
'string',
|
|
70
|
+
'number',
|
|
71
|
+
'boolean',
|
|
72
|
+
'void',
|
|
73
|
+
'null',
|
|
74
|
+
'undefined',
|
|
75
|
+
'any',
|
|
76
|
+
'unknown',
|
|
77
|
+
'never',
|
|
78
|
+
'object',
|
|
79
|
+
'symbol',
|
|
80
|
+
'bigint',
|
|
81
|
+
'true',
|
|
82
|
+
'false',
|
|
83
|
+
'this',
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
/** Common generic wrappers — keep inner type names, drop the wrapper. */
|
|
87
|
+
const TYPE_WRAPPERS = new Set([
|
|
88
|
+
'Promise',
|
|
89
|
+
'Array',
|
|
90
|
+
'ReadonlyArray',
|
|
91
|
+
'Map',
|
|
92
|
+
'Set',
|
|
93
|
+
'WeakMap',
|
|
94
|
+
'WeakSet',
|
|
95
|
+
'Record',
|
|
96
|
+
'Partial',
|
|
97
|
+
'Required',
|
|
98
|
+
'Readonly',
|
|
99
|
+
'Awaited',
|
|
100
|
+
'NonNullable',
|
|
101
|
+
'ReturnType',
|
|
102
|
+
'Parameters',
|
|
103
|
+
'InstanceType',
|
|
104
|
+
'Pick',
|
|
105
|
+
'Omit',
|
|
106
|
+
'Exclude',
|
|
107
|
+
'Extract',
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Pull comparable named type identifiers out of an authored / graphify type
|
|
112
|
+
* string. Skips primitives, inline object types, and known wrappers.
|
|
113
|
+
*/
|
|
114
|
+
export function extractNamedTypes(typeStr: string): string[] {
|
|
115
|
+
if (!typeStr || !typeStr.trim()) return [];
|
|
116
|
+
let s = typeStr;
|
|
117
|
+
// Drop string/template literals so their contents aren't tokens.
|
|
118
|
+
s = s.replace(/`(?:\\.|[^`\\])*`/g, ' ');
|
|
119
|
+
s = s.replace(/'(?:\\.|[^'\\])*'/g, ' ');
|
|
120
|
+
s = s.replace(/"(?:\\.|[^"\\])*"/g, ' ');
|
|
121
|
+
// Drop inline object / mapped types (non-greedy, repeated for nesting).
|
|
122
|
+
for (let i = 0; i < 8; i++) {
|
|
123
|
+
const next = s.replace(/\{[^{}]*\}/g, ' ');
|
|
124
|
+
if (next === s) break;
|
|
125
|
+
s = next;
|
|
126
|
+
}
|
|
127
|
+
const found = new Set<string>();
|
|
128
|
+
const re = /[A-Za-z_][A-Za-z0-9_.]*/g;
|
|
129
|
+
let m: RegExpExecArray | null;
|
|
130
|
+
while ((m = re.exec(s)) !== null) {
|
|
131
|
+
const raw = m[0]!;
|
|
132
|
+
const base = raw.includes('.') ? (raw.split('.').pop() ?? raw) : raw;
|
|
133
|
+
if (PRIMITIVES.has(base)) continue;
|
|
134
|
+
if (TYPE_WRAPPERS.has(base)) continue;
|
|
135
|
+
// Skip lone lowercase keywords that aren't types we care about.
|
|
136
|
+
if (base === 'typeof' || base === 'keyof' || base === 'infer' || base === 'extends') {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
found.add(base);
|
|
140
|
+
}
|
|
141
|
+
return [...found].sort();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function labelOf(
|
|
145
|
+
nodeId: string,
|
|
146
|
+
nodesById: ReadonlyMap<string, GraphifyNode>,
|
|
147
|
+
): string {
|
|
148
|
+
const n = nodesById.get(nodeId);
|
|
149
|
+
const label = n && typeof n.label === 'string' ? n.label.trim() : '';
|
|
150
|
+
return label || nodeId;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Collect parameter_type / return_type edges for a callable node. */
|
|
154
|
+
export function extractGraphifySignature(
|
|
155
|
+
nodeId: string,
|
|
156
|
+
edges: readonly GraphifyEdge[],
|
|
157
|
+
nodesById: ReadonlyMap<string, GraphifyNode>,
|
|
158
|
+
): GraphifyInferredSignature {
|
|
159
|
+
const id = String(nodeId);
|
|
160
|
+
const parameters: GraphifyInferredSignature['parameters'] = [];
|
|
161
|
+
const genericArgs: GraphifyInferredSignature['genericArgs'] = [];
|
|
162
|
+
let returnType: string | undefined;
|
|
163
|
+
let returnTypeNodeId: string | undefined;
|
|
164
|
+
let inlineParameters = 0;
|
|
165
|
+
|
|
166
|
+
for (const e of edges) {
|
|
167
|
+
if (String(e.source) !== id || e.relation !== 'references') continue;
|
|
168
|
+
const ctx = e.context;
|
|
169
|
+
const target = String(e.target);
|
|
170
|
+
if (ctx === 'parameter_type') {
|
|
171
|
+
parameters.push({ type: labelOf(target, nodesById), nodeId: target });
|
|
172
|
+
} else if (ctx === 'return_type' && returnType === undefined) {
|
|
173
|
+
returnType = labelOf(target, nodesById);
|
|
174
|
+
returnTypeNodeId = target;
|
|
175
|
+
} else if (ctx === 'generic_arg') {
|
|
176
|
+
genericArgs.push({ type: labelOf(target, nodesById), nodeId: target });
|
|
177
|
+
} else if (ctx === 'inline_parameter') {
|
|
178
|
+
inlineParameters += 1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return {
|
|
183
|
+
parameters,
|
|
184
|
+
genericArgs,
|
|
185
|
+
returnType,
|
|
186
|
+
returnTypeNodeId,
|
|
187
|
+
inlineParameters,
|
|
188
|
+
hasSignal: parameters.length > 0 || returnType !== undefined,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function bagsEqual(a: string[], b: string[]): boolean {
|
|
193
|
+
if (a.length !== b.length) return false;
|
|
194
|
+
for (let i = 0; i < a.length; i++) {
|
|
195
|
+
if (a[i] !== b[i]) return false;
|
|
196
|
+
}
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function claimedBags(claimed: ClaimedSignature | undefined): {
|
|
201
|
+
parameterTypes: string[];
|
|
202
|
+
returnTypes: string[];
|
|
203
|
+
} {
|
|
204
|
+
const parameterTypes = new Set<string>();
|
|
205
|
+
for (const p of claimed?.parameters ?? []) {
|
|
206
|
+
for (const t of extractNamedTypes(p.type)) parameterTypes.add(t);
|
|
207
|
+
}
|
|
208
|
+
const returnTypes = new Set<string>();
|
|
209
|
+
if (claimed?.returnType) {
|
|
210
|
+
for (const t of extractNamedTypes(claimed.returnType)) returnTypes.add(t);
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
parameterTypes: [...parameterTypes].sort(),
|
|
214
|
+
returnTypes: [...returnTypes].sort(),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function inferredBags(inferred: GraphifyInferredSignature): {
|
|
219
|
+
parameterTypes: string[];
|
|
220
|
+
returnTypes: string[];
|
|
221
|
+
} {
|
|
222
|
+
const parameterTypes = new Set<string>();
|
|
223
|
+
for (const p of inferred.parameters) {
|
|
224
|
+
for (const t of extractNamedTypes(p.type)) parameterTypes.add(t);
|
|
225
|
+
}
|
|
226
|
+
const returnTypes = new Set<string>();
|
|
227
|
+
if (inferred.returnType) {
|
|
228
|
+
for (const t of extractNamedTypes(inferred.returnType)) returnTypes.add(t);
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
parameterTypes: [...parameterTypes].sort(),
|
|
232
|
+
returnTypes: [...returnTypes].sort(),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Compare authored function/method detail signature to graphify edges.
|
|
238
|
+
*
|
|
239
|
+
* - No graphify signal → skipped (match=true).
|
|
240
|
+
* - Otherwise named-type bags for params and return must match exactly.
|
|
241
|
+
*/
|
|
242
|
+
export function compareSignatures(
|
|
243
|
+
claimed: ClaimedSignature | undefined,
|
|
244
|
+
inferred: GraphifyInferredSignature,
|
|
245
|
+
): SignatureCompareResult {
|
|
246
|
+
const claimedBagsResult = claimedBags(claimed);
|
|
247
|
+
const inferredBagsResult = inferredBags(inferred);
|
|
248
|
+
|
|
249
|
+
// Anonymous object-literal params ("inline") carry no named types, so they
|
|
250
|
+
// only ever surface via graphify's `inline_parameter` markers. A claim of an
|
|
251
|
+
// inline param against a graph with no marker proves nothing (the store
|
|
252
|
+
// graph may predate the flag), so absence alone keeps the skip path. When
|
|
253
|
+
// the graph DOES emit a marker, anon-count parity is compared like any
|
|
254
|
+
// parameter signal.
|
|
255
|
+
const claimedAnonCount = (claimed?.parameters ?? []).filter((p) =>
|
|
256
|
+
(p.type ?? '').trim().startsWith('{'),
|
|
257
|
+
).length;
|
|
258
|
+
const inferredAnonCount = inferred.inlineParameters ?? 0;
|
|
259
|
+
const hasAnonSignal = inferredAnonCount > 0;
|
|
260
|
+
|
|
261
|
+
if (!inferred.hasSignal && !hasAnonSignal) {
|
|
262
|
+
const claimedTypes = new Set<string>([
|
|
263
|
+
...claimedBagsResult.parameterTypes,
|
|
264
|
+
...claimedBagsResult.returnTypes,
|
|
265
|
+
]);
|
|
266
|
+
const genericArgTypes = new Set(
|
|
267
|
+
(inferred.genericArgs ?? []).map((a) => a.type),
|
|
268
|
+
);
|
|
269
|
+
const sorted = [...claimedTypes].sort();
|
|
270
|
+
let skipCode: SignatureSkipCode;
|
|
271
|
+
let reason: string;
|
|
272
|
+
if (sorted.length === 0) {
|
|
273
|
+
skipCode = 'no_claimed_types';
|
|
274
|
+
reason = 'no claimable named types in authored signature (primitives/inline only)';
|
|
275
|
+
} else {
|
|
276
|
+
const found = sorted.filter((t) => genericArgTypes.has(t));
|
|
277
|
+
if (found.length === sorted.length) {
|
|
278
|
+
skipCode = 'generic_arg_only';
|
|
279
|
+
reason = `claimed types ([${sorted.join(', ')}]) present only as generic_arg (wrapper-indirected: Promise/Omit/Map/Array) — extractor does not read generic_arg`;
|
|
280
|
+
} else if (found.length > 0) {
|
|
281
|
+
skipCode = 'partially_generic_arg';
|
|
282
|
+
reason = `claimed types resolve only via generic_arg for ${found.join(', ')}; rest unresolved (${sorted.filter((t) => !genericArgTypes.has(t)).join(', ')})`;
|
|
283
|
+
} else {
|
|
284
|
+
skipCode = 'unresolved_claimed_types';
|
|
285
|
+
reason = `claimed types ([${sorted.join(', ')}]) have no parameter_type/return_type/generic_arg edges (global/npm types or dropped same-file label collision)`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
match: true,
|
|
290
|
+
skipped: true,
|
|
291
|
+
reason,
|
|
292
|
+
skipCode,
|
|
293
|
+
claimed: claimedBagsResult,
|
|
294
|
+
inferred: inferredBagsResult,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const paramsOk = bagsEqual(
|
|
299
|
+
claimedBagsResult.parameterTypes,
|
|
300
|
+
inferredBagsResult.parameterTypes,
|
|
301
|
+
);
|
|
302
|
+
const anonParamsOk = claimedAnonCount === inferredAnonCount;
|
|
303
|
+
const returnOk = bagsEqual(
|
|
304
|
+
claimedBagsResult.returnTypes,
|
|
305
|
+
inferredBagsResult.returnTypes,
|
|
306
|
+
);
|
|
307
|
+
const match = paramsOk && anonParamsOk && returnOk;
|
|
308
|
+
if (paramsOk && anonParamsOk && !returnOk) {
|
|
309
|
+
// Params verified, but the claimed return types can't be backed. When
|
|
310
|
+
// every claimed return type is either wrapper-indirected (generic_arg:
|
|
311
|
+
// Promise<X>, Omit<X,…>) or entirely unresolved (global/npm/DOM types),
|
|
312
|
+
// that's a coverage gap, not a lie — mark the check skipped instead of
|
|
313
|
+
// hard-failing, mirroring the pre-signal skip classification. A mixed
|
|
314
|
+
// bag (some generic, some unresolved) stays a hard mismatch.
|
|
315
|
+
const claimReturn = claimedBagsResult.returnTypes;
|
|
316
|
+
if (claimReturn.length > 0) {
|
|
317
|
+
const genericArgTypes = new Set(
|
|
318
|
+
(inferred.genericArgs ?? []).map((a) => a.type),
|
|
319
|
+
);
|
|
320
|
+
const gen = claimReturn.filter((t) => genericArgTypes.has(t));
|
|
321
|
+
const unresolved = claimReturn.filter((t) => !genericArgTypes.has(t));
|
|
322
|
+
let skipCode: SignatureSkipCode | undefined;
|
|
323
|
+
let reason: string | undefined;
|
|
324
|
+
if (gen.length === claimReturn.length) {
|
|
325
|
+
skipCode = 'generic_arg_only';
|
|
326
|
+
reason = `claimed return types ([${claimReturn.join(', ')}]) present only as generic_arg (wrapper-indirected: Promise/Omit/Map/Array) — extractor does not read generic_arg; params verified`;
|
|
327
|
+
} else if (unresolved.length === claimReturn.length) {
|
|
328
|
+
skipCode = 'unresolved_claimed_types';
|
|
329
|
+
reason = `claimed return types ([${claimReturn.join(', ')}]) have no parameter_type/return_type/generic_arg edges (global/npm types or dropped same-file label collision); params verified`;
|
|
330
|
+
}
|
|
331
|
+
if (skipCode) {
|
|
332
|
+
return {
|
|
333
|
+
match: true,
|
|
334
|
+
skipped: true,
|
|
335
|
+
reason,
|
|
336
|
+
skipCode,
|
|
337
|
+
claimed: claimedBagsResult,
|
|
338
|
+
inferred: inferredBagsResult,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
match,
|
|
345
|
+
skipped: false,
|
|
346
|
+
reason: match
|
|
347
|
+
? undefined
|
|
348
|
+
: !paramsOk || !anonParamsOk
|
|
349
|
+
? 'parameter_types_mismatch'
|
|
350
|
+
: 'return_type_mismatch',
|
|
351
|
+
claimed: claimedBagsResult,
|
|
352
|
+
inferred: inferredBagsResult,
|
|
353
|
+
};
|
|
354
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -250,11 +250,37 @@ export {
|
|
|
250
250
|
normalizeGraphifyLabel,
|
|
251
251
|
createGraphifyTypeResolver,
|
|
252
252
|
resolveGraphifyTypeRef,
|
|
253
|
+
normalizeGraphifyId,
|
|
254
|
+
makeGraphifyId,
|
|
255
|
+
graphifyFileStem,
|
|
256
|
+
normalizeSourcePath,
|
|
257
|
+
resolveComponentAnchor,
|
|
258
|
+
symbolLabelVariants,
|
|
259
|
+
inferGraphifyKind,
|
|
260
|
+
kindsMatch,
|
|
261
|
+
extractNamedTypes,
|
|
262
|
+
extractGraphifySignature,
|
|
263
|
+
compareSignatures,
|
|
264
|
+
} from './graphify';
|
|
265
|
+
export type {
|
|
266
|
+
ComponentAnchorInput,
|
|
267
|
+
ComponentAnchorResult,
|
|
268
|
+
InferredGraphifyKind,
|
|
269
|
+
InferGraphifyKindResult,
|
|
270
|
+
GraphifyInferredSignature,
|
|
271
|
+
ClaimedSignature,
|
|
272
|
+
SignatureCompareResult,
|
|
253
273
|
} from './graphify';
|
|
254
274
|
|
|
255
275
|
// Subsystem component graph
|
|
256
276
|
export { SubsystemComponentGraph } from './subsystem/SubsystemComponentGraph';
|
|
257
277
|
export type { SubsystemComponentGraphProps } from './subsystem/SubsystemComponentGraph';
|
|
278
|
+
export type {
|
|
279
|
+
ComponentVerificationState,
|
|
280
|
+
ComponentVerificationPhase,
|
|
281
|
+
ComponentDeclarationProps,
|
|
282
|
+
} from './subsystem/ComponentDeclaration';
|
|
283
|
+
export { ComponentDeclaration } from './subsystem/ComponentDeclaration';
|
|
258
284
|
export { MECHANISM_COLOR, KIND_COLOR, MECHANISM_STYLE } from './subsystem/model';
|
|
259
285
|
export {
|
|
260
286
|
purlRepoKey,
|
|
@@ -259,6 +259,38 @@ const cases: { label: string; component: SubsystemComponent }[] = [
|
|
|
259
259
|
} satisfies GraphifyComponentDetail,
|
|
260
260
|
},
|
|
261
261
|
},
|
|
262
|
+
{
|
|
263
|
+
label: 'method — standalone from class',
|
|
264
|
+
component: {
|
|
265
|
+
id: 'method-normalize',
|
|
266
|
+
name: 'normalize',
|
|
267
|
+
kind: 'method',
|
|
268
|
+
file: 'src/session/SessionReader.ts',
|
|
269
|
+
purl: 'pkg:github/principal-ai/agent-monitoring',
|
|
270
|
+
symbol: 'SessionReader.normalize',
|
|
271
|
+
detail: {
|
|
272
|
+
kind: 'method',
|
|
273
|
+
hostClass: 'SessionReader',
|
|
274
|
+
parameters: [{ name: 'session', type: 'SessionRecord' }],
|
|
275
|
+
returnType: 'SessionEvent[]',
|
|
276
|
+
} satisfies GraphifyComponentDetail,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
label: 'method — no params',
|
|
281
|
+
component: {
|
|
282
|
+
id: 'method-dispose',
|
|
283
|
+
name: 'dispose',
|
|
284
|
+
kind: 'method',
|
|
285
|
+
file: 'src/event-processing/EventProcessor.ts',
|
|
286
|
+
purl: 'pkg:github/principal-ai/agent-monitoring',
|
|
287
|
+
symbol: 'EventProcessor.dispose',
|
|
288
|
+
detail: {
|
|
289
|
+
kind: 'method',
|
|
290
|
+
hostClass: 'EventProcessor',
|
|
291
|
+
} satisfies GraphifyComponentDetail,
|
|
292
|
+
},
|
|
293
|
+
},
|
|
262
294
|
];
|
|
263
295
|
|
|
264
296
|
// ---------------------------------------------------------------------------
|