@fragments-sdk/mcp 0.5.0 → 0.5.2

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,386 @@
1
+ // ../context/dist/graph/index.js
2
+ var GRAPH_EDGE_TYPES = [
3
+ "imports",
4
+ "hook-depends",
5
+ "renders",
6
+ "composes",
7
+ "parent-of",
8
+ "alternative-to",
9
+ "sibling-of"
10
+ ];
11
+ var EDGE_TYPE_WEIGHTS = {
12
+ "imports": 1,
13
+ "hook-depends": 0.75,
14
+ "renders": 0.5,
15
+ "composes": 0.5,
16
+ "parent-of": 1,
17
+ "alternative-to": 1,
18
+ "sibling-of": 0.75
19
+ };
20
+ var ComponentGraphEngine = class {
21
+ nodes;
22
+ outgoing;
23
+ incoming;
24
+ edges;
25
+ blockIndex;
26
+ health;
27
+ constructor(graph, blocks) {
28
+ this.nodes = /* @__PURE__ */ new Map();
29
+ this.outgoing = /* @__PURE__ */ new Map();
30
+ this.incoming = /* @__PURE__ */ new Map();
31
+ this.edges = graph.edges;
32
+ this.health = graph.health;
33
+ this.blockIndex = /* @__PURE__ */ new Map();
34
+ for (const node of graph.nodes) {
35
+ this.nodes.set(node.name, node);
36
+ this.outgoing.set(node.name, []);
37
+ this.incoming.set(node.name, []);
38
+ }
39
+ for (const edge of graph.edges) {
40
+ const out = this.outgoing.get(edge.source);
41
+ if (out) out.push(edge);
42
+ else this.outgoing.set(edge.source, [edge]);
43
+ const inc = this.incoming.get(edge.target);
44
+ if (inc) inc.push(edge);
45
+ else this.incoming.set(edge.target, [edge]);
46
+ }
47
+ if (blocks) {
48
+ for (const [blockName, block] of Object.entries(blocks)) {
49
+ for (const comp of block.components) {
50
+ const existing = this.blockIndex.get(comp);
51
+ if (existing) existing.push(blockName);
52
+ else this.blockIndex.set(comp, [blockName]);
53
+ }
54
+ }
55
+ }
56
+ }
57
+ // -------------------------------------------------------------------------
58
+ // Core queries
59
+ // -------------------------------------------------------------------------
60
+ /** Get outgoing edges from a component, optionally filtered by edge type */
61
+ dependencies(component, edgeTypes) {
62
+ const edges = this.outgoing.get(component) ?? [];
63
+ if (!edgeTypes || edgeTypes.length === 0) return edges;
64
+ return edges.filter((e) => edgeTypes.includes(e.type));
65
+ }
66
+ /** Get incoming edges to a component, optionally filtered by edge type */
67
+ dependents(component, edgeTypes) {
68
+ const edges = this.incoming.get(component) ?? [];
69
+ if (!edgeTypes || edgeTypes.length === 0) return edges;
70
+ return edges.filter((e) => edgeTypes.includes(e.type));
71
+ }
72
+ /** BFS transitive closure — what's affected if this component changes */
73
+ impact(component, maxDepth = 3) {
74
+ const affected = [];
75
+ const visited = /* @__PURE__ */ new Set([component]);
76
+ const queue = [
77
+ { name: component, depth: 0, path: [component] }
78
+ ];
79
+ while (queue.length > 0) {
80
+ const current = queue.shift();
81
+ if (current.depth >= maxDepth) continue;
82
+ const deps = this.incoming.get(current.name) ?? [];
83
+ for (const edge of deps) {
84
+ if (visited.has(edge.source)) continue;
85
+ visited.add(edge.source);
86
+ const newPath = [...current.path, edge.source];
87
+ affected.push({
88
+ component: edge.source,
89
+ depth: current.depth + 1,
90
+ path: newPath,
91
+ edgeType: edge.type
92
+ });
93
+ queue.push({ name: edge.source, depth: current.depth + 1, path: newPath });
94
+ }
95
+ }
96
+ const affectedComponents = /* @__PURE__ */ new Set([component, ...affected.map((a) => a.component)]);
97
+ const affectedBlocks = /* @__PURE__ */ new Set();
98
+ for (const comp of affectedComponents) {
99
+ const blocks = this.blockIndex.get(comp);
100
+ if (blocks) {
101
+ for (const b of blocks) affectedBlocks.add(b);
102
+ }
103
+ }
104
+ return {
105
+ component,
106
+ affected,
107
+ affectedBlocks: [...affectedBlocks],
108
+ totalAffected: affected.length
109
+ };
110
+ }
111
+ /** BFS shortest path between two components (undirected) */
112
+ path(from, to) {
113
+ if (from === to) {
114
+ return { found: true, path: [from], edges: [] };
115
+ }
116
+ const visited = /* @__PURE__ */ new Set([from]);
117
+ const queue = [
118
+ { name: from, path: [from], edges: [] }
119
+ ];
120
+ while (queue.length > 0) {
121
+ const current = queue.shift();
122
+ const allEdges = [
123
+ ...this.outgoing.get(current.name) ?? [],
124
+ ...this.incoming.get(current.name) ?? []
125
+ ];
126
+ for (const edge of allEdges) {
127
+ const neighbor = edge.source === current.name ? edge.target : edge.source;
128
+ if (visited.has(neighbor)) continue;
129
+ visited.add(neighbor);
130
+ const newPath = [...current.path, neighbor];
131
+ const newEdges = [...current.edges, edge];
132
+ if (neighbor === to) {
133
+ return { found: true, path: newPath, edges: newEdges };
134
+ }
135
+ queue.push({ name: neighbor, path: newPath, edges: newEdges });
136
+ }
137
+ }
138
+ return { found: false, path: [], edges: [] };
139
+ }
140
+ /** Connected components via BFS on undirected projection */
141
+ islands() {
142
+ const visited = /* @__PURE__ */ new Set();
143
+ const components = [];
144
+ for (const nodeName of this.nodes.keys()) {
145
+ if (visited.has(nodeName)) continue;
146
+ const island = [];
147
+ const queue = [nodeName];
148
+ visited.add(nodeName);
149
+ while (queue.length > 0) {
150
+ const current = queue.shift();
151
+ island.push(current);
152
+ const allEdges = [
153
+ ...this.outgoing.get(current) ?? [],
154
+ ...this.incoming.get(current) ?? []
155
+ ];
156
+ for (const edge of allEdges) {
157
+ const neighbor = edge.source === current ? edge.target : edge.source;
158
+ if (!visited.has(neighbor) && this.nodes.has(neighbor)) {
159
+ visited.add(neighbor);
160
+ queue.push(neighbor);
161
+ }
162
+ }
163
+ }
164
+ components.push(island.sort());
165
+ }
166
+ return components.sort((a, b) => b.length - a.length);
167
+ }
168
+ /** All components reachable within N hops (undirected) */
169
+ neighbors(component, maxHops = 1) {
170
+ const neighbors = [];
171
+ const visited = /* @__PURE__ */ new Set([component]);
172
+ const queue = [
173
+ { name: component, hops: 0 }
174
+ ];
175
+ while (queue.length > 0) {
176
+ const current = queue.shift();
177
+ if (current.hops >= maxHops) continue;
178
+ const allEdges = [
179
+ ...this.outgoing.get(current.name) ?? [],
180
+ ...this.incoming.get(current.name) ?? []
181
+ ];
182
+ for (const edge of allEdges) {
183
+ const neighbor = edge.source === current.name ? edge.target : edge.source;
184
+ if (visited.has(neighbor)) continue;
185
+ visited.add(neighbor);
186
+ neighbors.push({
187
+ component: neighbor,
188
+ hops: current.hops + 1,
189
+ edgeType: edge.type
190
+ });
191
+ queue.push({ name: neighbor, hops: current.hops + 1 });
192
+ }
193
+ }
194
+ return { component, neighbors };
195
+ }
196
+ // -------------------------------------------------------------------------
197
+ // Design-system queries
198
+ // -------------------------------------------------------------------------
199
+ /** Get the composition tree for a compound component */
200
+ composition(component) {
201
+ const node = this.nodes.get(component);
202
+ const subComponents = node?.subComponents ?? [];
203
+ const parentEdges = (this.outgoing.get(component) ?? []).filter((e) => e.type === "parent-of");
204
+ const requiredChildren = parentEdges.map((e) => e.target);
205
+ const childEdges = (this.incoming.get(component) ?? []).filter((e) => e.type === "parent-of");
206
+ const parent = childEdges.length > 0 ? childEdges[0].source : void 0;
207
+ const siblings = [];
208
+ if (parent) {
209
+ const parentOut = (this.outgoing.get(parent) ?? []).filter((e) => e.type === "parent-of");
210
+ for (const edge of parentOut) {
211
+ if (edge.target !== component) {
212
+ siblings.push(edge.target);
213
+ }
214
+ }
215
+ }
216
+ const siblingEdges = [
217
+ ...(this.outgoing.get(component) ?? []).filter((e) => e.type === "sibling-of"),
218
+ ...(this.incoming.get(component) ?? []).filter((e) => e.type === "sibling-of")
219
+ ];
220
+ for (const edge of siblingEdges) {
221
+ const sib = edge.source === component ? edge.target : edge.source;
222
+ if (!siblings.includes(sib)) siblings.push(sib);
223
+ }
224
+ return {
225
+ component,
226
+ compositionPattern: node?.compositionPattern,
227
+ subComponents,
228
+ requiredChildren,
229
+ parent,
230
+ siblings,
231
+ blocks: this.blockIndex.get(component) ?? []
232
+ };
233
+ }
234
+ /** Get alternative components */
235
+ alternatives(component) {
236
+ const alts = [];
237
+ for (const edge of this.outgoing.get(component) ?? []) {
238
+ if (edge.type === "alternative-to") {
239
+ alts.push({ component: edge.target, note: edge.note });
240
+ }
241
+ }
242
+ for (const edge of this.incoming.get(component) ?? []) {
243
+ if (edge.type === "alternative-to") {
244
+ alts.push({ component: edge.source, note: edge.note });
245
+ }
246
+ }
247
+ return alts;
248
+ }
249
+ /** Get blocks that use a component */
250
+ blocksUsing(component) {
251
+ return this.blockIndex.get(component) ?? [];
252
+ }
253
+ /** Extract an induced subgraph for a set of components */
254
+ subgraph(components) {
255
+ const componentSet = new Set(components);
256
+ const nodes = components.map((name) => this.nodes.get(name)).filter((n) => n !== void 0);
257
+ const edges = this.edges.filter(
258
+ (e) => componentSet.has(e.source) && componentSet.has(e.target)
259
+ );
260
+ return {
261
+ nodes,
262
+ edges,
263
+ health: computeHealthFromData(nodes, edges, this.blockIndex)
264
+ };
265
+ }
266
+ /** Return precomputed health metrics */
267
+ getHealth() {
268
+ return this.health;
269
+ }
270
+ /** Get a single node by name */
271
+ getNode(name) {
272
+ return this.nodes.get(name);
273
+ }
274
+ /** Check if a component exists in the graph */
275
+ hasNode(name) {
276
+ return this.nodes.has(name);
277
+ }
278
+ };
279
+ function computeHealthFromData(nodes, edges, blockIndex) {
280
+ const nodeNames = new Set(nodes.map((n) => n.name));
281
+ const degreeMap = /* @__PURE__ */ new Map();
282
+ for (const name of nodeNames) {
283
+ degreeMap.set(name, 0);
284
+ }
285
+ for (const edge of edges) {
286
+ degreeMap.set(edge.source, (degreeMap.get(edge.source) ?? 0) + 1);
287
+ degreeMap.set(edge.target, (degreeMap.get(edge.target) ?? 0) + 1);
288
+ }
289
+ const orphans = [];
290
+ for (const [name, degree] of degreeMap) {
291
+ if (degree === 0) orphans.push(name);
292
+ }
293
+ const hubs = [...degreeMap.entries()].map(([name, degree]) => ({ name, degree })).sort((a, b) => b.degree - a.degree).slice(0, 10);
294
+ let inBlock = 0;
295
+ if (blockIndex) {
296
+ for (const name of nodeNames) {
297
+ if ((blockIndex.get(name) ?? []).length > 0) inBlock++;
298
+ }
299
+ }
300
+ const compositionCoverage = nodeNames.size > 0 ? Math.round(inBlock / nodeNames.size * 100) : 0;
301
+ const adjacency = /* @__PURE__ */ new Map();
302
+ for (const name of nodeNames) {
303
+ adjacency.set(name, /* @__PURE__ */ new Set());
304
+ }
305
+ for (const edge of edges) {
306
+ adjacency.get(edge.source)?.add(edge.target);
307
+ adjacency.get(edge.target)?.add(edge.source);
308
+ }
309
+ const visited = /* @__PURE__ */ new Set();
310
+ const connectedComponents = [];
311
+ for (const name of nodeNames) {
312
+ if (visited.has(name)) continue;
313
+ const island = [];
314
+ const queue = [name];
315
+ visited.add(name);
316
+ while (queue.length > 0) {
317
+ const current = queue.shift();
318
+ island.push(current);
319
+ for (const neighbor of adjacency.get(current) ?? []) {
320
+ if (!visited.has(neighbor)) {
321
+ visited.add(neighbor);
322
+ queue.push(neighbor);
323
+ }
324
+ }
325
+ }
326
+ connectedComponents.push(island.sort());
327
+ }
328
+ connectedComponents.sort((a, b) => b.length - a.length);
329
+ const totalDegree = [...degreeMap.values()].reduce((sum, d) => sum + d, 0);
330
+ const averageDegree = nodeNames.size > 0 ? Math.round(totalDegree / nodeNames.size * 100) / 100 : 0;
331
+ return {
332
+ orphans: orphans.sort(),
333
+ hubs,
334
+ compositionCoverage,
335
+ connectedComponents,
336
+ averageDegree,
337
+ nodeCount: nodeNames.size,
338
+ edgeCount: edges.length
339
+ };
340
+ }
341
+ function serializeGraph(graph) {
342
+ return {
343
+ nodes: graph.nodes,
344
+ edges: graph.edges.map(serializeEdge),
345
+ health: graph.health
346
+ };
347
+ }
348
+ function deserializeGraph(serialized) {
349
+ return {
350
+ nodes: serialized.nodes,
351
+ edges: serialized.edges.map(deserializeEdge),
352
+ health: serialized.health
353
+ };
354
+ }
355
+ function serializeEdge(edge) {
356
+ const result = {
357
+ s: edge.source,
358
+ t: edge.target,
359
+ ty: edge.type,
360
+ w: edge.weight,
361
+ p: edge.provenance
362
+ };
363
+ if (edge.note) result.no = edge.note;
364
+ return result;
365
+ }
366
+ function deserializeEdge(edge) {
367
+ const result = {
368
+ source: edge.s,
369
+ target: edge.t,
370
+ type: edge.ty,
371
+ weight: edge.w,
372
+ provenance: edge.p
373
+ };
374
+ if (edge.no) result.note = edge.no;
375
+ return result;
376
+ }
377
+
378
+ export {
379
+ GRAPH_EDGE_TYPES,
380
+ EDGE_TYPE_WEIGHTS,
381
+ ComponentGraphEngine,
382
+ computeHealthFromData,
383
+ serializeGraph,
384
+ deserializeGraph
385
+ };
386
+ //# sourceMappingURL=chunk-WXUZ55XQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../context/dist/graph/index.js"],"sourcesContent":["// src/graph/types.ts\nvar GRAPH_EDGE_TYPES = [\n \"imports\",\n \"hook-depends\",\n \"renders\",\n \"composes\",\n \"parent-of\",\n \"alternative-to\",\n \"sibling-of\"\n];\nvar EDGE_TYPE_WEIGHTS = {\n \"imports\": 1,\n \"hook-depends\": 0.75,\n \"renders\": 0.5,\n \"composes\": 0.5,\n \"parent-of\": 1,\n \"alternative-to\": 1,\n \"sibling-of\": 0.75\n};\n\n// src/graph/engine.ts\nvar ComponentGraphEngine = class {\n nodes;\n outgoing;\n incoming;\n edges;\n blockIndex;\n health;\n constructor(graph, blocks) {\n this.nodes = /* @__PURE__ */ new Map();\n this.outgoing = /* @__PURE__ */ new Map();\n this.incoming = /* @__PURE__ */ new Map();\n this.edges = graph.edges;\n this.health = graph.health;\n this.blockIndex = /* @__PURE__ */ new Map();\n for (const node of graph.nodes) {\n this.nodes.set(node.name, node);\n this.outgoing.set(node.name, []);\n this.incoming.set(node.name, []);\n }\n for (const edge of graph.edges) {\n const out = this.outgoing.get(edge.source);\n if (out) out.push(edge);\n else this.outgoing.set(edge.source, [edge]);\n const inc = this.incoming.get(edge.target);\n if (inc) inc.push(edge);\n else this.incoming.set(edge.target, [edge]);\n }\n if (blocks) {\n for (const [blockName, block] of Object.entries(blocks)) {\n for (const comp of block.components) {\n const existing = this.blockIndex.get(comp);\n if (existing) existing.push(blockName);\n else this.blockIndex.set(comp, [blockName]);\n }\n }\n }\n }\n // -------------------------------------------------------------------------\n // Core queries\n // -------------------------------------------------------------------------\n /** Get outgoing edges from a component, optionally filtered by edge type */\n dependencies(component, edgeTypes) {\n const edges = this.outgoing.get(component) ?? [];\n if (!edgeTypes || edgeTypes.length === 0) return edges;\n return edges.filter((e) => edgeTypes.includes(e.type));\n }\n /** Get incoming edges to a component, optionally filtered by edge type */\n dependents(component, edgeTypes) {\n const edges = this.incoming.get(component) ?? [];\n if (!edgeTypes || edgeTypes.length === 0) return edges;\n return edges.filter((e) => edgeTypes.includes(e.type));\n }\n /** BFS transitive closure — what's affected if this component changes */\n impact(component, maxDepth = 3) {\n const affected = [];\n const visited = /* @__PURE__ */ new Set([component]);\n const queue = [\n { name: component, depth: 0, path: [component] }\n ];\n while (queue.length > 0) {\n const current = queue.shift();\n if (current.depth >= maxDepth) continue;\n const deps = this.incoming.get(current.name) ?? [];\n for (const edge of deps) {\n if (visited.has(edge.source)) continue;\n visited.add(edge.source);\n const newPath = [...current.path, edge.source];\n affected.push({\n component: edge.source,\n depth: current.depth + 1,\n path: newPath,\n edgeType: edge.type\n });\n queue.push({ name: edge.source, depth: current.depth + 1, path: newPath });\n }\n }\n const affectedComponents = /* @__PURE__ */ new Set([component, ...affected.map((a) => a.component)]);\n const affectedBlocks = /* @__PURE__ */ new Set();\n for (const comp of affectedComponents) {\n const blocks = this.blockIndex.get(comp);\n if (blocks) {\n for (const b of blocks) affectedBlocks.add(b);\n }\n }\n return {\n component,\n affected,\n affectedBlocks: [...affectedBlocks],\n totalAffected: affected.length\n };\n }\n /** BFS shortest path between two components (undirected) */\n path(from, to) {\n if (from === to) {\n return { found: true, path: [from], edges: [] };\n }\n const visited = /* @__PURE__ */ new Set([from]);\n const queue = [\n { name: from, path: [from], edges: [] }\n ];\n while (queue.length > 0) {\n const current = queue.shift();\n const allEdges = [\n ...this.outgoing.get(current.name) ?? [],\n ...this.incoming.get(current.name) ?? []\n ];\n for (const edge of allEdges) {\n const neighbor = edge.source === current.name ? edge.target : edge.source;\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n const newPath = [...current.path, neighbor];\n const newEdges = [...current.edges, edge];\n if (neighbor === to) {\n return { found: true, path: newPath, edges: newEdges };\n }\n queue.push({ name: neighbor, path: newPath, edges: newEdges });\n }\n }\n return { found: false, path: [], edges: [] };\n }\n /** Connected components via BFS on undirected projection */\n islands() {\n const visited = /* @__PURE__ */ new Set();\n const components = [];\n for (const nodeName of this.nodes.keys()) {\n if (visited.has(nodeName)) continue;\n const island = [];\n const queue = [nodeName];\n visited.add(nodeName);\n while (queue.length > 0) {\n const current = queue.shift();\n island.push(current);\n const allEdges = [\n ...this.outgoing.get(current) ?? [],\n ...this.incoming.get(current) ?? []\n ];\n for (const edge of allEdges) {\n const neighbor = edge.source === current ? edge.target : edge.source;\n if (!visited.has(neighbor) && this.nodes.has(neighbor)) {\n visited.add(neighbor);\n queue.push(neighbor);\n }\n }\n }\n components.push(island.sort());\n }\n return components.sort((a, b) => b.length - a.length);\n }\n /** All components reachable within N hops (undirected) */\n neighbors(component, maxHops = 1) {\n const neighbors = [];\n const visited = /* @__PURE__ */ new Set([component]);\n const queue = [\n { name: component, hops: 0 }\n ];\n while (queue.length > 0) {\n const current = queue.shift();\n if (current.hops >= maxHops) continue;\n const allEdges = [\n ...this.outgoing.get(current.name) ?? [],\n ...this.incoming.get(current.name) ?? []\n ];\n for (const edge of allEdges) {\n const neighbor = edge.source === current.name ? edge.target : edge.source;\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n neighbors.push({\n component: neighbor,\n hops: current.hops + 1,\n edgeType: edge.type\n });\n queue.push({ name: neighbor, hops: current.hops + 1 });\n }\n }\n return { component, neighbors };\n }\n // -------------------------------------------------------------------------\n // Design-system queries\n // -------------------------------------------------------------------------\n /** Get the composition tree for a compound component */\n composition(component) {\n const node = this.nodes.get(component);\n const subComponents = node?.subComponents ?? [];\n const parentEdges = (this.outgoing.get(component) ?? []).filter((e) => e.type === \"parent-of\");\n const requiredChildren = parentEdges.map((e) => e.target);\n const childEdges = (this.incoming.get(component) ?? []).filter((e) => e.type === \"parent-of\");\n const parent = childEdges.length > 0 ? childEdges[0].source : void 0;\n const siblings = [];\n if (parent) {\n const parentOut = (this.outgoing.get(parent) ?? []).filter((e) => e.type === \"parent-of\");\n for (const edge of parentOut) {\n if (edge.target !== component) {\n siblings.push(edge.target);\n }\n }\n }\n const siblingEdges = [\n ...(this.outgoing.get(component) ?? []).filter((e) => e.type === \"sibling-of\"),\n ...(this.incoming.get(component) ?? []).filter((e) => e.type === \"sibling-of\")\n ];\n for (const edge of siblingEdges) {\n const sib = edge.source === component ? edge.target : edge.source;\n if (!siblings.includes(sib)) siblings.push(sib);\n }\n return {\n component,\n compositionPattern: node?.compositionPattern,\n subComponents,\n requiredChildren,\n parent,\n siblings,\n blocks: this.blockIndex.get(component) ?? []\n };\n }\n /** Get alternative components */\n alternatives(component) {\n const alts = [];\n for (const edge of this.outgoing.get(component) ?? []) {\n if (edge.type === \"alternative-to\") {\n alts.push({ component: edge.target, note: edge.note });\n }\n }\n for (const edge of this.incoming.get(component) ?? []) {\n if (edge.type === \"alternative-to\") {\n alts.push({ component: edge.source, note: edge.note });\n }\n }\n return alts;\n }\n /** Get blocks that use a component */\n blocksUsing(component) {\n return this.blockIndex.get(component) ?? [];\n }\n /** Extract an induced subgraph for a set of components */\n subgraph(components) {\n const componentSet = new Set(components);\n const nodes = components.map((name) => this.nodes.get(name)).filter((n) => n !== void 0);\n const edges = this.edges.filter(\n (e) => componentSet.has(e.source) && componentSet.has(e.target)\n );\n return {\n nodes,\n edges,\n health: computeHealthFromData(nodes, edges, this.blockIndex)\n };\n }\n /** Return precomputed health metrics */\n getHealth() {\n return this.health;\n }\n /** Get a single node by name */\n getNode(name) {\n return this.nodes.get(name);\n }\n /** Check if a component exists in the graph */\n hasNode(name) {\n return this.nodes.has(name);\n }\n};\nfunction computeHealthFromData(nodes, edges, blockIndex) {\n const nodeNames = new Set(nodes.map((n) => n.name));\n const degreeMap = /* @__PURE__ */ new Map();\n for (const name of nodeNames) {\n degreeMap.set(name, 0);\n }\n for (const edge of edges) {\n degreeMap.set(edge.source, (degreeMap.get(edge.source) ?? 0) + 1);\n degreeMap.set(edge.target, (degreeMap.get(edge.target) ?? 0) + 1);\n }\n const orphans = [];\n for (const [name, degree] of degreeMap) {\n if (degree === 0) orphans.push(name);\n }\n const hubs = [...degreeMap.entries()].map(([name, degree]) => ({ name, degree })).sort((a, b) => b.degree - a.degree).slice(0, 10);\n let inBlock = 0;\n if (blockIndex) {\n for (const name of nodeNames) {\n if ((blockIndex.get(name) ?? []).length > 0) inBlock++;\n }\n }\n const compositionCoverage = nodeNames.size > 0 ? Math.round(inBlock / nodeNames.size * 100) : 0;\n const adjacency = /* @__PURE__ */ new Map();\n for (const name of nodeNames) {\n adjacency.set(name, /* @__PURE__ */ new Set());\n }\n for (const edge of edges) {\n adjacency.get(edge.source)?.add(edge.target);\n adjacency.get(edge.target)?.add(edge.source);\n }\n const visited = /* @__PURE__ */ new Set();\n const connectedComponents = [];\n for (const name of nodeNames) {\n if (visited.has(name)) continue;\n const island = [];\n const queue = [name];\n visited.add(name);\n while (queue.length > 0) {\n const current = queue.shift();\n island.push(current);\n for (const neighbor of adjacency.get(current) ?? []) {\n if (!visited.has(neighbor)) {\n visited.add(neighbor);\n queue.push(neighbor);\n }\n }\n }\n connectedComponents.push(island.sort());\n }\n connectedComponents.sort((a, b) => b.length - a.length);\n const totalDegree = [...degreeMap.values()].reduce((sum, d) => sum + d, 0);\n const averageDegree = nodeNames.size > 0 ? Math.round(totalDegree / nodeNames.size * 100) / 100 : 0;\n return {\n orphans: orphans.sort(),\n hubs,\n compositionCoverage,\n connectedComponents,\n averageDegree,\n nodeCount: nodeNames.size,\n edgeCount: edges.length\n };\n}\n\n// src/graph/serialization.ts\nfunction serializeGraph(graph) {\n return {\n nodes: graph.nodes,\n edges: graph.edges.map(serializeEdge),\n health: graph.health\n };\n}\nfunction deserializeGraph(serialized) {\n return {\n nodes: serialized.nodes,\n edges: serialized.edges.map(deserializeEdge),\n health: serialized.health\n };\n}\nfunction serializeEdge(edge) {\n const result = {\n s: edge.source,\n t: edge.target,\n ty: edge.type,\n w: edge.weight,\n p: edge.provenance\n };\n if (edge.note) result.no = edge.note;\n return result;\n}\nfunction deserializeEdge(edge) {\n const result = {\n source: edge.s,\n target: edge.t,\n type: edge.ty,\n weight: edge.w,\n provenance: edge.p\n };\n if (edge.no) result.note = edge.no;\n return result;\n}\nexport {\n ComponentGraphEngine,\n EDGE_TYPE_WEIGHTS,\n GRAPH_EDGE_TYPES,\n computeHealthFromData,\n deserializeGraph,\n serializeGraph\n};\n"],"mappings":";AACA,IAAI,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAI,oBAAoB;AAAA,EACtB,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,cAAc;AAChB;AAGA,IAAI,uBAAuB,MAAM;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,OAAO,QAAQ;AACzB,SAAK,QAAwB,oBAAI,IAAI;AACrC,SAAK,WAA2B,oBAAI,IAAI;AACxC,SAAK,WAA2B,oBAAI,IAAI;AACxC,SAAK,QAAQ,MAAM;AACnB,SAAK,SAAS,MAAM;AACpB,SAAK,aAA6B,oBAAI,IAAI;AAC1C,eAAW,QAAQ,MAAM,OAAO;AAC9B,WAAK,MAAM,IAAI,KAAK,MAAM,IAAI;AAC9B,WAAK,SAAS,IAAI,KAAK,MAAM,CAAC,CAAC;AAC/B,WAAK,SAAS,IAAI,KAAK,MAAM,CAAC,CAAC;AAAA,IACjC;AACA,eAAW,QAAQ,MAAM,OAAO;AAC9B,YAAM,MAAM,KAAK,SAAS,IAAI,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GAAG,KAAK;AAAA,EACV;AACA,MAAI,KAAK,KAAM,QAAO,KAAK,KAAK;AAChC,SAAO;AACT;AACA,SAAS,gBAAgB,MAAM;AAC7B,QAAM,SAAS;AAAA,IACb,QAAQ,KAAK;AAAA,IACb,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK;AAAA,IACX,QAAQ,KAAK;AAAA,IACb,YAAY,KAAK;AAAA,EACnB;AACA,MAAI,KAAK,GAAI,QAAO,OAAO,KAAK;AAChC,SAAO;AACT;","names":[]}
@@ -0,0 +1,17 @@
1
+ import {
2
+ ComponentGraphEngine,
3
+ EDGE_TYPE_WEIGHTS,
4
+ GRAPH_EDGE_TYPES,
5
+ computeHealthFromData,
6
+ deserializeGraph,
7
+ serializeGraph
8
+ } from "./chunk-WXUZ55XQ.js";
9
+ export {
10
+ ComponentGraphEngine,
11
+ EDGE_TYPE_WEIGHTS,
12
+ GRAPH_EDGE_TYPES,
13
+ computeHealthFromData,
14
+ deserializeGraph,
15
+ serializeGraph
16
+ };
17
+ //# sourceMappingURL=graph-6PMJ6XCF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/server.js ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ createMcpServer,
3
+ startMcpServer
4
+ } from "./chunk-EMMM6LTH.js";
5
+ import "./chunk-WXUZ55XQ.js";
6
+ export {
7
+ createMcpServer,
8
+ startMcpServer
9
+ };
10
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@fragments-sdk/mcp",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
+ "license": "FSL-1.1-MIT",
4
5
  "description": "Standalone MCP server for Fragments design system — zero-config component discovery with semantic search",
5
6
  "repository": {
6
7
  "type": "git",
@@ -19,6 +20,15 @@
19
20
  "import": "./dist/server.js"
20
21
  }
21
22
  },
23
+ "keywords": [
24
+ "mcp",
25
+ "model-context-protocol",
26
+ "ai",
27
+ "design-system",
28
+ "component-library",
29
+ "react",
30
+ "code-generation"
31
+ ],
22
32
  "publishConfig": {
23
33
  "access": "public"
24
34
  },
@@ -35,7 +45,7 @@
35
45
  "tsx": "^4.19.0",
36
46
  "typescript": "^5.7.2",
37
47
  "vitest": "^2.1.8",
38
- "@fragments-sdk/context": "0.3.0"
48
+ "@fragments-sdk/context": "0.3.1"
39
49
  },
40
50
  "scripts": {
41
51
  "build": "tsup",