@claude-flow/plugin-code-intelligence 3.0.0-alpha.1
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/README.md +381 -0
- package/dist/bridges/gnn-bridge.d.ts +96 -0
- package/dist/bridges/gnn-bridge.d.ts.map +1 -0
- package/dist/bridges/gnn-bridge.js +527 -0
- package/dist/bridges/gnn-bridge.js.map +1 -0
- package/dist/bridges/index.d.ts +8 -0
- package/dist/bridges/index.d.ts.map +1 -0
- package/dist/bridges/index.js +8 -0
- package/dist/bridges/index.js.map +1 -0
- package/dist/bridges/mincut-bridge.d.ts +81 -0
- package/dist/bridges/mincut-bridge.d.ts.map +1 -0
- package/dist/bridges/mincut-bridge.js +481 -0
- package/dist/bridges/mincut-bridge.js.map +1 -0
- package/dist/index.d.ts +113 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +156 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-tools.d.ts +98 -0
- package/dist/mcp-tools.d.ts.map +1 -0
- package/dist/mcp-tools.js +794 -0
- package/dist/mcp-tools.js.map +1 -0
- package/dist/types.d.ts +838 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +268 -0
- package/dist/types.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MinCut Bridge for Module Splitting
|
|
3
|
+
*
|
|
4
|
+
* Provides graph min-cut operations for optimal module boundary detection
|
|
5
|
+
* using ruvector-mincut-wasm for high-performance graph partitioning.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Optimal module boundary detection
|
|
9
|
+
* - Multi-way graph partitioning
|
|
10
|
+
* - Constraint-aware splitting
|
|
11
|
+
* - Cut weight optimization
|
|
12
|
+
*
|
|
13
|
+
* Based on ADR-035: Advanced Code Intelligence Plugin
|
|
14
|
+
*
|
|
15
|
+
* @module v3/plugins/code-intelligence/bridges/mincut-bridge
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* MinCut Bridge Implementation
|
|
19
|
+
*/
|
|
20
|
+
export class MinCutBridge {
|
|
21
|
+
// WASM module for future performance optimization (currently uses JS fallback)
|
|
22
|
+
wasmModule = null;
|
|
23
|
+
initialized = false;
|
|
24
|
+
/**
|
|
25
|
+
* Initialize the WASM module
|
|
26
|
+
*/
|
|
27
|
+
async initialize() {
|
|
28
|
+
if (this.initialized)
|
|
29
|
+
return;
|
|
30
|
+
try {
|
|
31
|
+
// Dynamic import of WASM module
|
|
32
|
+
this.wasmModule = await this.loadWasmModule();
|
|
33
|
+
this.initialized = true;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Fallback to pure JS implementation
|
|
37
|
+
console.warn('WASM MinCut module not available, using JS fallback');
|
|
38
|
+
this.wasmModule = null;
|
|
39
|
+
this.initialized = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if initialized
|
|
44
|
+
*/
|
|
45
|
+
isInitialized() {
|
|
46
|
+
return this.initialized;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Find optimal module boundaries using MinCut
|
|
50
|
+
*/
|
|
51
|
+
async findOptimalCuts(graph, numModules, constraints) {
|
|
52
|
+
if (!this.initialized) {
|
|
53
|
+
await this.initialize();
|
|
54
|
+
}
|
|
55
|
+
const partition = new Map();
|
|
56
|
+
const nodeCount = graph.nodes.length;
|
|
57
|
+
if (nodeCount === 0 || numModules < 2) {
|
|
58
|
+
// All nodes in single partition
|
|
59
|
+
for (const node of graph.nodes) {
|
|
60
|
+
partition.set(node.id, 0);
|
|
61
|
+
}
|
|
62
|
+
return partition;
|
|
63
|
+
}
|
|
64
|
+
// Create node lookup
|
|
65
|
+
const nodeMap = new Map();
|
|
66
|
+
const indexMap = new Map();
|
|
67
|
+
graph.nodes.forEach((node, index) => {
|
|
68
|
+
nodeMap.set(node.id, index);
|
|
69
|
+
indexMap.set(index, node.id);
|
|
70
|
+
});
|
|
71
|
+
// Apply constraints for preserved boundaries
|
|
72
|
+
const fixed = new Map();
|
|
73
|
+
if (constraints.preserveBoundaries) {
|
|
74
|
+
for (let i = 0; i < constraints.preserveBoundaries.length && i < numModules; i++) {
|
|
75
|
+
const boundary = constraints.preserveBoundaries[i];
|
|
76
|
+
if (boundary) {
|
|
77
|
+
const nodeIdx = nodeMap.get(boundary);
|
|
78
|
+
if (nodeIdx !== undefined) {
|
|
79
|
+
fixed.set(nodeIdx, i);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Build adjacency matrix with weights
|
|
85
|
+
const weights = Array.from({ length: nodeCount }, () => Array(nodeCount).fill(0));
|
|
86
|
+
for (const edge of graph.edges) {
|
|
87
|
+
const fromIdx = nodeMap.get(edge.from);
|
|
88
|
+
const toIdx = nodeMap.get(edge.to);
|
|
89
|
+
if (fromIdx !== undefined && toIdx !== undefined) {
|
|
90
|
+
weights[fromIdx][toIdx] = edge.weight;
|
|
91
|
+
weights[toIdx][fromIdx] = edge.weight; // Symmetric for partitioning
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Use spectral partitioning (JS fallback)
|
|
95
|
+
const partitionArray = this.spectralPartition(weights, numModules, fixed, constraints);
|
|
96
|
+
// Convert to map
|
|
97
|
+
for (let i = 0; i < nodeCount; i++) {
|
|
98
|
+
const nodeId = indexMap.get(i);
|
|
99
|
+
const part = partitionArray[i];
|
|
100
|
+
if (nodeId && part !== undefined) {
|
|
101
|
+
partition.set(nodeId, part);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Apply keepTogether constraints
|
|
105
|
+
if (constraints.keepTogether) {
|
|
106
|
+
for (const group of constraints.keepTogether) {
|
|
107
|
+
if (group.length > 0) {
|
|
108
|
+
const firstIdx = nodeMap.get(group[0] ?? '');
|
|
109
|
+
const firstPart = firstIdx !== undefined ? partitionArray[firstIdx] : undefined;
|
|
110
|
+
if (firstPart !== undefined) {
|
|
111
|
+
for (const nodeId of group) {
|
|
112
|
+
partition.set(nodeId, firstPart);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return partition;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Calculate cut weight for a given partition
|
|
122
|
+
*/
|
|
123
|
+
async calculateCutWeight(graph, partition) {
|
|
124
|
+
if (!this.initialized) {
|
|
125
|
+
await this.initialize();
|
|
126
|
+
}
|
|
127
|
+
let cutWeight = 0;
|
|
128
|
+
for (const edge of graph.edges) {
|
|
129
|
+
const fromPart = partition.get(edge.from);
|
|
130
|
+
const toPart = partition.get(edge.to);
|
|
131
|
+
if (fromPart !== undefined && toPart !== undefined && fromPart !== toPart) {
|
|
132
|
+
cutWeight += edge.weight;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return cutWeight;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Find minimum s-t cut
|
|
139
|
+
*/
|
|
140
|
+
async minSTCut(graph, source, sink) {
|
|
141
|
+
if (!this.initialized) {
|
|
142
|
+
await this.initialize();
|
|
143
|
+
}
|
|
144
|
+
const nodeCount = graph.nodes.length;
|
|
145
|
+
// Create node lookup
|
|
146
|
+
const nodeMap = new Map();
|
|
147
|
+
const indexMap = new Map();
|
|
148
|
+
graph.nodes.forEach((node, index) => {
|
|
149
|
+
nodeMap.set(node.id, index);
|
|
150
|
+
indexMap.set(index, node.id);
|
|
151
|
+
});
|
|
152
|
+
const sourceIdx = nodeMap.get(source);
|
|
153
|
+
const sinkIdx = nodeMap.get(sink);
|
|
154
|
+
if (sourceIdx === undefined || sinkIdx === undefined) {
|
|
155
|
+
return {
|
|
156
|
+
cutValue: 0,
|
|
157
|
+
cutEdges: [],
|
|
158
|
+
sourceSet: [],
|
|
159
|
+
sinkSet: graph.nodes.map(n => n.id),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
// Build capacity matrix
|
|
163
|
+
const capacity = Array.from({ length: nodeCount }, () => Array(nodeCount).fill(0));
|
|
164
|
+
for (const edge of graph.edges) {
|
|
165
|
+
const fromIdx = nodeMap.get(edge.from);
|
|
166
|
+
const toIdx = nodeMap.get(edge.to);
|
|
167
|
+
if (fromIdx !== undefined && toIdx !== undefined) {
|
|
168
|
+
capacity[fromIdx][toIdx] = edge.weight;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Ford-Fulkerson with BFS (Edmonds-Karp)
|
|
172
|
+
const { maxFlow, residual } = this.edmondsKarp(capacity, sourceIdx, sinkIdx);
|
|
173
|
+
// Find source set using BFS on residual graph
|
|
174
|
+
const sourceSet = new Set();
|
|
175
|
+
const queue = [sourceIdx];
|
|
176
|
+
sourceSet.add(sourceIdx);
|
|
177
|
+
while (queue.length > 0) {
|
|
178
|
+
const current = queue.shift();
|
|
179
|
+
for (let next = 0; next < nodeCount; next++) {
|
|
180
|
+
if (!sourceSet.has(next) && (residual[current]?.[next] ?? 0) > 0) {
|
|
181
|
+
sourceSet.add(next);
|
|
182
|
+
queue.push(next);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Find cut edges
|
|
187
|
+
const cutEdges = [];
|
|
188
|
+
for (const edge of graph.edges) {
|
|
189
|
+
const fromIdx = nodeMap.get(edge.from);
|
|
190
|
+
const toIdx = nodeMap.get(edge.to);
|
|
191
|
+
if (fromIdx !== undefined && toIdx !== undefined) {
|
|
192
|
+
if (sourceSet.has(fromIdx) && !sourceSet.has(toIdx)) {
|
|
193
|
+
cutEdges.push({ from: edge.from, to: edge.to });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Convert sets to arrays
|
|
198
|
+
const sourceSetNodes = [];
|
|
199
|
+
const sinkSetNodes = [];
|
|
200
|
+
for (let i = 0; i < nodeCount; i++) {
|
|
201
|
+
const nodeId = indexMap.get(i);
|
|
202
|
+
if (nodeId) {
|
|
203
|
+
if (sourceSet.has(i)) {
|
|
204
|
+
sourceSetNodes.push(nodeId);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
sinkSetNodes.push(nodeId);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
cutValue: maxFlow,
|
|
213
|
+
cutEdges,
|
|
214
|
+
sourceSet: sourceSetNodes,
|
|
215
|
+
sinkSet: sinkSetNodes,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Multi-way cut for module splitting
|
|
220
|
+
*/
|
|
221
|
+
async multiWayCut(graph, terminals, _weights) {
|
|
222
|
+
if (!this.initialized) {
|
|
223
|
+
await this.initialize();
|
|
224
|
+
}
|
|
225
|
+
const numTerminals = terminals.length;
|
|
226
|
+
if (numTerminals < 2) {
|
|
227
|
+
const partitions = new Map();
|
|
228
|
+
for (const node of graph.nodes) {
|
|
229
|
+
partitions.set(node.id, 0);
|
|
230
|
+
}
|
|
231
|
+
return { cutValue: 0, partitions };
|
|
232
|
+
}
|
|
233
|
+
// Create node lookup
|
|
234
|
+
const nodeMap = new Map();
|
|
235
|
+
graph.nodes.forEach((node, index) => {
|
|
236
|
+
nodeMap.set(node.id, index);
|
|
237
|
+
});
|
|
238
|
+
// Get terminal indices
|
|
239
|
+
const terminalIndices = terminals
|
|
240
|
+
.map(t => nodeMap.get(t))
|
|
241
|
+
.filter((idx) => idx !== undefined);
|
|
242
|
+
if (terminalIndices.length < 2) {
|
|
243
|
+
const partitions = new Map();
|
|
244
|
+
for (const node of graph.nodes) {
|
|
245
|
+
partitions.set(node.id, 0);
|
|
246
|
+
}
|
|
247
|
+
return { cutValue: 0, partitions };
|
|
248
|
+
}
|
|
249
|
+
// Use isolating cuts algorithm
|
|
250
|
+
// Assign each node to the nearest terminal
|
|
251
|
+
const partitions = new Map();
|
|
252
|
+
const distances = this.computeDistances(graph, terminalIndices, nodeMap);
|
|
253
|
+
for (const node of graph.nodes) {
|
|
254
|
+
const nodeIdx = nodeMap.get(node.id);
|
|
255
|
+
if (nodeIdx === undefined)
|
|
256
|
+
continue;
|
|
257
|
+
let minDist = Infinity;
|
|
258
|
+
let minTerminal = 0;
|
|
259
|
+
for (let t = 0; t < terminalIndices.length; t++) {
|
|
260
|
+
const dist = distances.get(`${nodeIdx}-${t}`) ?? Infinity;
|
|
261
|
+
if (dist < minDist) {
|
|
262
|
+
minDist = dist;
|
|
263
|
+
minTerminal = t;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
partitions.set(node.id, minTerminal);
|
|
267
|
+
}
|
|
268
|
+
// Calculate cut value
|
|
269
|
+
const cutValue = await this.calculateCutWeight(graph, partitions);
|
|
270
|
+
return { cutValue, partitions };
|
|
271
|
+
}
|
|
272
|
+
// ============================================================================
|
|
273
|
+
// Private Helper Methods
|
|
274
|
+
// ============================================================================
|
|
275
|
+
/**
|
|
276
|
+
* Load WASM module dynamically
|
|
277
|
+
*/
|
|
278
|
+
async loadWasmModule() {
|
|
279
|
+
throw new Error('WASM module loading not implemented');
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Spectral partitioning using Fiedler vector
|
|
283
|
+
*/
|
|
284
|
+
spectralPartition(weights, numPartitions, fixed, _constraints) {
|
|
285
|
+
const n = weights.length;
|
|
286
|
+
const partition = new Array(n).fill(0);
|
|
287
|
+
if (n === 0)
|
|
288
|
+
return partition;
|
|
289
|
+
// Apply fixed partitions
|
|
290
|
+
for (const [node, part] of fixed) {
|
|
291
|
+
partition[node] = part;
|
|
292
|
+
}
|
|
293
|
+
// If all fixed, return
|
|
294
|
+
if (fixed.size >= n)
|
|
295
|
+
return partition;
|
|
296
|
+
// Compute Laplacian
|
|
297
|
+
const laplacian = Array.from({ length: n }, () => Array(n).fill(0));
|
|
298
|
+
for (let i = 0; i < n; i++) {
|
|
299
|
+
let degree = 0;
|
|
300
|
+
for (let j = 0; j < n; j++) {
|
|
301
|
+
if (i !== j) {
|
|
302
|
+
const w = (weights[i]?.[j] ?? 0) + (weights[j]?.[i] ?? 0);
|
|
303
|
+
laplacian[i][j] = -w;
|
|
304
|
+
degree += w;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
laplacian[i][i] = degree;
|
|
308
|
+
}
|
|
309
|
+
// Power iteration to find Fiedler vector (second smallest eigenvector)
|
|
310
|
+
// Simplified: use random initialization and iterate
|
|
311
|
+
const fiedler = new Array(n).fill(0).map(() => Math.random() - 0.5);
|
|
312
|
+
// Normalize
|
|
313
|
+
let norm = Math.sqrt(fiedler.reduce((sum, v) => sum + v * v, 0));
|
|
314
|
+
for (let i = 0; i < n; i++) {
|
|
315
|
+
fiedler[i] = (fiedler[i] ?? 0) / norm;
|
|
316
|
+
}
|
|
317
|
+
// Iterate
|
|
318
|
+
for (let iter = 0; iter < 50; iter++) {
|
|
319
|
+
// Multiply by Laplacian
|
|
320
|
+
const newFiedler = new Array(n).fill(0);
|
|
321
|
+
for (let i = 0; i < n; i++) {
|
|
322
|
+
for (let j = 0; j < n; j++) {
|
|
323
|
+
newFiedler[i] += (laplacian[i]?.[j] ?? 0) * (fiedler[j] ?? 0);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// Orthogonalize against constant vector
|
|
327
|
+
const mean = newFiedler.reduce((a, b) => a + b, 0) / n;
|
|
328
|
+
for (let i = 0; i < n; i++) {
|
|
329
|
+
newFiedler[i] = (newFiedler[i] ?? 0) - mean;
|
|
330
|
+
}
|
|
331
|
+
// Normalize
|
|
332
|
+
norm = Math.sqrt(newFiedler.reduce((sum, v) => sum + v * v, 0));
|
|
333
|
+
if (norm > 0) {
|
|
334
|
+
for (let i = 0; i < n; i++) {
|
|
335
|
+
fiedler[i] = (newFiedler[i] ?? 0) / norm;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
// Partition based on Fiedler vector
|
|
340
|
+
if (numPartitions === 2) {
|
|
341
|
+
// Simple bisection
|
|
342
|
+
for (let i = 0; i < n; i++) {
|
|
343
|
+
if (!fixed.has(i)) {
|
|
344
|
+
partition[i] = (fiedler[i] ?? 0) >= 0 ? 0 : 1;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
// K-means clustering on Fiedler values
|
|
350
|
+
const sorted = fiedler
|
|
351
|
+
.map((v, i) => ({ value: v, index: i }))
|
|
352
|
+
.filter(item => !fixed.has(item.index))
|
|
353
|
+
.sort((a, b) => (a.value ?? 0) - (b.value ?? 0));
|
|
354
|
+
const binSize = Math.ceil(sorted.length / numPartitions);
|
|
355
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
356
|
+
const item = sorted[i];
|
|
357
|
+
if (item) {
|
|
358
|
+
partition[item.index] = Math.min(Math.floor(i / binSize), numPartitions - 1);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return partition;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Edmonds-Karp algorithm (Ford-Fulkerson with BFS)
|
|
366
|
+
*/
|
|
367
|
+
edmondsKarp(capacity, source, sink) {
|
|
368
|
+
const n = capacity.length;
|
|
369
|
+
const residual = capacity.map(row => [...row]);
|
|
370
|
+
let maxFlow = 0;
|
|
371
|
+
// BFS to find augmenting path
|
|
372
|
+
const bfs = () => {
|
|
373
|
+
const parent = new Array(n).fill(-1);
|
|
374
|
+
const visited = new Array(n).fill(false);
|
|
375
|
+
const queue = [source];
|
|
376
|
+
visited[source] = true;
|
|
377
|
+
while (queue.length > 0) {
|
|
378
|
+
const current = queue.shift();
|
|
379
|
+
if (current === sink) {
|
|
380
|
+
// Reconstruct path
|
|
381
|
+
const path = [];
|
|
382
|
+
let node = sink;
|
|
383
|
+
while (node !== source) {
|
|
384
|
+
path.unshift(node);
|
|
385
|
+
node = parent[node] ?? source;
|
|
386
|
+
}
|
|
387
|
+
path.unshift(source);
|
|
388
|
+
return path;
|
|
389
|
+
}
|
|
390
|
+
for (let next = 0; next < n; next++) {
|
|
391
|
+
if (!visited[next] && (residual[current]?.[next] ?? 0) > 0) {
|
|
392
|
+
visited[next] = true;
|
|
393
|
+
parent[next] = current;
|
|
394
|
+
queue.push(next);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return null;
|
|
399
|
+
};
|
|
400
|
+
// Find augmenting paths
|
|
401
|
+
let path = bfs();
|
|
402
|
+
while (path !== null) {
|
|
403
|
+
// Find minimum capacity along path
|
|
404
|
+
let minCap = Infinity;
|
|
405
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
406
|
+
const from = path[i];
|
|
407
|
+
const to = path[i + 1];
|
|
408
|
+
if (from !== undefined && to !== undefined) {
|
|
409
|
+
minCap = Math.min(minCap, residual[from]?.[to] ?? 0);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// Update residual capacities
|
|
413
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
414
|
+
const from = path[i];
|
|
415
|
+
const to = path[i + 1];
|
|
416
|
+
if (from !== undefined && to !== undefined) {
|
|
417
|
+
residual[from][to] = (residual[from]?.[to] ?? 0) - minCap;
|
|
418
|
+
residual[to][from] = (residual[to]?.[from] ?? 0) + minCap;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
maxFlow += minCap;
|
|
422
|
+
path = bfs();
|
|
423
|
+
}
|
|
424
|
+
return { maxFlow, residual };
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Compute distances from terminals to all nodes
|
|
428
|
+
*/
|
|
429
|
+
computeDistances(graph, terminalIndices, nodeMap) {
|
|
430
|
+
const distances = new Map();
|
|
431
|
+
const nodeCount = graph.nodes.length;
|
|
432
|
+
// Build adjacency list with weights
|
|
433
|
+
const adj = new Map();
|
|
434
|
+
for (let i = 0; i < nodeCount; i++) {
|
|
435
|
+
adj.set(i, []);
|
|
436
|
+
}
|
|
437
|
+
for (const edge of graph.edges) {
|
|
438
|
+
const fromIdx = nodeMap.get(edge.from);
|
|
439
|
+
const toIdx = nodeMap.get(edge.to);
|
|
440
|
+
if (fromIdx !== undefined && toIdx !== undefined) {
|
|
441
|
+
adj.get(fromIdx)?.push({ to: toIdx, weight: edge.weight });
|
|
442
|
+
adj.get(toIdx)?.push({ to: fromIdx, weight: edge.weight });
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
// Dijkstra from each terminal
|
|
446
|
+
for (let t = 0; t < terminalIndices.length; t++) {
|
|
447
|
+
const terminal = terminalIndices[t];
|
|
448
|
+
if (terminal === undefined)
|
|
449
|
+
continue;
|
|
450
|
+
const dist = new Array(nodeCount).fill(Infinity);
|
|
451
|
+
dist[terminal] = 0;
|
|
452
|
+
const pq = [{ node: terminal, dist: 0 }];
|
|
453
|
+
while (pq.length > 0) {
|
|
454
|
+
pq.sort((a, b) => a.dist - b.dist);
|
|
455
|
+
const current = pq.shift();
|
|
456
|
+
if (current.dist > (dist[current.node] ?? Infinity))
|
|
457
|
+
continue;
|
|
458
|
+
for (const neighbor of adj.get(current.node) ?? []) {
|
|
459
|
+
const newDist = current.dist + (1 / Math.max(neighbor.weight, 0.1)); // Inverse weight as distance
|
|
460
|
+
if (newDist < (dist[neighbor.to] ?? Infinity)) {
|
|
461
|
+
dist[neighbor.to] = newDist;
|
|
462
|
+
pq.push({ node: neighbor.to, dist: newDist });
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
// Store distances
|
|
467
|
+
for (let i = 0; i < nodeCount; i++) {
|
|
468
|
+
distances.set(`${i}-${t}`, dist[i] ?? Infinity);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
return distances;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Create and export default bridge instance
|
|
476
|
+
*/
|
|
477
|
+
export function createMinCutBridge() {
|
|
478
|
+
return new MinCutBridge();
|
|
479
|
+
}
|
|
480
|
+
export default MinCutBridge;
|
|
481
|
+
//# sourceMappingURL=mincut-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mincut-bridge.js","sourceRoot":"","sources":["../../src/bridges/mincut-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkDH;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB,+EAA+E;IACvE,UAAU,GAA4B,IAAI,CAAC;IAC3C,WAAW,GAAG,KAAK,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO;QAE7B,IAAI,CAAC;YACH,gCAAgC;YAChC,IAAI,CAAC,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAC9C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,qCAAqC;YACrC,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;YACpE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,KAAsB,EACtB,UAAkB,EAClB,WAA6B;QAE7B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;QAErC,IAAI,SAAS,KAAK,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACtC,gCAAgC;YAChC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,C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AAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,YAAY,EAAE,CAAC;AAC5B,CAAC;AAED,eAAe,YAAY,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Intelligence Plugin for Claude Flow V3
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive code intelligence plugin combining graph neural networks
|
|
5
|
+
* for code structure analysis with ultra-fast vector search for semantic
|
|
6
|
+
* code similarity.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Semantic code search
|
|
10
|
+
* - Architecture analysis and drift detection
|
|
11
|
+
* - Refactoring impact prediction using GNN
|
|
12
|
+
* - Module splitting suggestions using MinCut
|
|
13
|
+
* - Pattern learning from code history
|
|
14
|
+
*
|
|
15
|
+
* Based on ADR-035: Advanced Code Intelligence Plugin
|
|
16
|
+
*
|
|
17
|
+
* @module @claude-flow/plugin-code-intelligence
|
|
18
|
+
*/
|
|
19
|
+
export * from './types.js';
|
|
20
|
+
export { GNNBridge, createGNNBridge } from './bridges/gnn-bridge.js';
|
|
21
|
+
export { MinCutBridge, createMinCutBridge } from './bridges/mincut-bridge.js';
|
|
22
|
+
export { semanticSearchTool, architectureAnalyzeTool, refactorImpactTool, splitSuggestTool, learnPatternsTool, codeIntelligenceTools, toolHandlers, createToolContext, } from './mcp-tools.js';
|
|
23
|
+
export type { MCPTool, ToolContext, MCPToolResult } from './mcp-tools.js';
|
|
24
|
+
import type { CodeIntelligenceConfig, IGNNBridge, IMinCutBridge } from './types.js';
|
|
25
|
+
/**
|
|
26
|
+
* Plugin metadata
|
|
27
|
+
*/
|
|
28
|
+
export declare const pluginMetadata: {
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
description: string;
|
|
32
|
+
author: string;
|
|
33
|
+
category: string;
|
|
34
|
+
keywords: string[];
|
|
35
|
+
homepage: string;
|
|
36
|
+
repository: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Plugin state
|
|
40
|
+
*/
|
|
41
|
+
export type PluginState = 'uninitialized' | 'initializing' | 'ready' | 'error' | 'shutdown';
|
|
42
|
+
/**
|
|
43
|
+
* Code Intelligence Plugin Class
|
|
44
|
+
*/
|
|
45
|
+
export declare class CodeIntelligencePlugin {
|
|
46
|
+
private state;
|
|
47
|
+
private config;
|
|
48
|
+
private gnnBridge;
|
|
49
|
+
private mincutBridge;
|
|
50
|
+
constructor(config?: Partial<CodeIntelligenceConfig>);
|
|
51
|
+
/**
|
|
52
|
+
* Get plugin metadata
|
|
53
|
+
*/
|
|
54
|
+
getMetadata(): {
|
|
55
|
+
name: string;
|
|
56
|
+
version: string;
|
|
57
|
+
description: string;
|
|
58
|
+
author: string;
|
|
59
|
+
category: string;
|
|
60
|
+
keywords: string[];
|
|
61
|
+
homepage: string;
|
|
62
|
+
repository: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Get current state
|
|
66
|
+
*/
|
|
67
|
+
getState(): PluginState;
|
|
68
|
+
/**
|
|
69
|
+
* Initialize the plugin
|
|
70
|
+
*/
|
|
71
|
+
initialize(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Shutdown the plugin
|
|
74
|
+
*/
|
|
75
|
+
shutdown(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Get MCP tools provided by this plugin
|
|
78
|
+
*/
|
|
79
|
+
getMCPTools(): import("./mcp-tools.js").MCPTool<unknown, unknown>[];
|
|
80
|
+
/**
|
|
81
|
+
* Get tool context for execution
|
|
82
|
+
*/
|
|
83
|
+
getToolContext(): {
|
|
84
|
+
get: <T>(key: string) => T | undefined;
|
|
85
|
+
set: <T>(key: string, value: T) => void;
|
|
86
|
+
bridges: {
|
|
87
|
+
gnn: IGNNBridge;
|
|
88
|
+
mincut: IMinCutBridge;
|
|
89
|
+
};
|
|
90
|
+
config: {
|
|
91
|
+
allowedRoots: string[];
|
|
92
|
+
blockedPatterns: RegExp[];
|
|
93
|
+
maskSecrets: boolean;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Get configuration
|
|
98
|
+
*/
|
|
99
|
+
getConfig(): CodeIntelligenceConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Update configuration
|
|
102
|
+
*/
|
|
103
|
+
updateConfig(config: Partial<CodeIntelligenceConfig>): void;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Create plugin instance
|
|
107
|
+
*/
|
|
108
|
+
export declare function createPlugin(config?: Partial<CodeIntelligenceConfig>): CodeIntelligencePlugin;
|
|
109
|
+
/**
|
|
110
|
+
* Default export
|
|
111
|
+
*/
|
|
112
|
+
export default CodeIntelligencePlugin;
|
|
113
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG9E,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM1E,OAAO,KAAK,EACV,sBAAsB,EACtB,UAAU,EACV,aAAa,EACd,MAAM,YAAY,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