depwire-cli 0.9.27 → 0.9.29
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/{chunk-RGD3YJYQ.js → chunk-FUIZQCYB.js} +16 -10
- package/dist/{chunk-DA5LWNJ4.js → chunk-WUSXCZXA.js} +551 -104
- package/dist/index.js +13 -13
- package/dist/mcpb-entry.js +3 -3
- package/dist/sdk.d.ts +31 -2
- package/dist/sdk.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
stashChanges,
|
|
18
18
|
updateFileInGraph,
|
|
19
19
|
watchProject
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FUIZQCYB.js";
|
|
21
21
|
import {
|
|
22
22
|
SimulationEngine,
|
|
23
23
|
analyzeDeadCode,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
parseProject,
|
|
32
32
|
scanSecurity,
|
|
33
33
|
searchSymbols
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-WUSXCZXA.js";
|
|
35
35
|
|
|
36
36
|
// src/index.ts
|
|
37
37
|
import { Command } from "commander";
|
|
@@ -410,7 +410,7 @@ async function runTemporalAnalysis(projectDir, options) {
|
|
|
410
410
|
}
|
|
411
411
|
await checkoutCommit(projectDir, commit.hash);
|
|
412
412
|
const parsedFiles = await parseProject(projectDir);
|
|
413
|
-
const graph = buildGraph(parsedFiles);
|
|
413
|
+
const graph = buildGraph(parsedFiles, projectDir);
|
|
414
414
|
const projectGraph = exportToJSON(graph, projectDir);
|
|
415
415
|
const snapshot = createSnapshot(
|
|
416
416
|
projectGraph,
|
|
@@ -758,7 +758,7 @@ async function whatif(dir, options) {
|
|
|
758
758
|
const projectRoot2 = dir === "." ? findProjectRoot() : resolve2(dir);
|
|
759
759
|
console.error(`Parsing project: ${projectRoot2}`);
|
|
760
760
|
const parsedFiles2 = await parseProject(projectRoot2);
|
|
761
|
-
const graph2 = buildGraph(parsedFiles2);
|
|
761
|
+
const graph2 = buildGraph(parsedFiles2, projectRoot2);
|
|
762
762
|
console.error(`Built graph: ${graph2.order} symbols, ${graph2.size} edges`);
|
|
763
763
|
const vizData = prepareVizData(graph2, projectRoot2);
|
|
764
764
|
const emptyResult = {
|
|
@@ -784,7 +784,7 @@ async function whatif(dir, options) {
|
|
|
784
784
|
const projectRoot = dir === "." ? findProjectRoot() : resolve2(dir);
|
|
785
785
|
console.error(`Parsing project: ${projectRoot}`);
|
|
786
786
|
const parsedFiles = await parseProject(projectRoot);
|
|
787
|
-
const graph = buildGraph(parsedFiles);
|
|
787
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
788
788
|
console.error(`Built graph: ${graph.order} symbols, ${graph.size} edges`);
|
|
789
789
|
console.error("");
|
|
790
790
|
const engine = new SimulationEngine(graph);
|
|
@@ -1039,7 +1039,7 @@ async function securityCommand(dir, options) {
|
|
|
1039
1039
|
const startTime = Date.now();
|
|
1040
1040
|
const parsedFiles = await parseProject(projectRoot);
|
|
1041
1041
|
console.error(`Parsed ${parsedFiles.length} files`);
|
|
1042
|
-
const graph = buildGraph(parsedFiles);
|
|
1042
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
1043
1043
|
console.error(`Built graph: ${graph.order} symbols, ${graph.size} edges`);
|
|
1044
1044
|
const result = await scanSecurity(projectRoot, graph, {
|
|
1045
1045
|
target: options.target,
|
|
@@ -1089,7 +1089,7 @@ program.command("parse").description("Parse a TypeScript project and build depen
|
|
|
1089
1089
|
verbose: options.verbose
|
|
1090
1090
|
});
|
|
1091
1091
|
console.log(`Parsed ${parsedFiles.length} files`);
|
|
1092
|
-
const graph = buildGraph(parsedFiles);
|
|
1092
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
1093
1093
|
const projectGraph = exportToJSON(graph, projectRoot);
|
|
1094
1094
|
const json = options.pretty ? JSON.stringify(projectGraph, null, 2) : JSON.stringify(projectGraph);
|
|
1095
1095
|
writeFileSync(options.output, json, "utf-8");
|
|
@@ -1131,7 +1131,7 @@ program.command("query").description("Query impact analysis for a symbol").argum
|
|
|
1131
1131
|
} else {
|
|
1132
1132
|
console.log("Parsing project...");
|
|
1133
1133
|
const parsedFiles = await parseProject(projectRoot);
|
|
1134
|
-
graph = buildGraph(parsedFiles);
|
|
1134
|
+
graph = buildGraph(parsedFiles, projectRoot);
|
|
1135
1135
|
}
|
|
1136
1136
|
const matches = searchSymbols(graph, symbolName);
|
|
1137
1137
|
if (matches.length === 0) {
|
|
@@ -1177,7 +1177,7 @@ program.command("viz").description("Launch interactive arc diagram visualization
|
|
|
1177
1177
|
verbose: options.verbose
|
|
1178
1178
|
});
|
|
1179
1179
|
console.log(`Parsed ${parsedFiles.length} files`);
|
|
1180
|
-
const graph = buildGraph(parsedFiles);
|
|
1180
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
1181
1181
|
const vizData = prepareVizData(graph, projectRoot);
|
|
1182
1182
|
console.log(`Found ${vizData.stats.totalSymbols} symbols, ${vizData.stats.totalCrossFileEdges} cross-file edges`);
|
|
1183
1183
|
const port = parseInt(options.port, 10);
|
|
@@ -1225,7 +1225,7 @@ program.command("mcp").description("Start MCP server for AI coding tools").argum
|
|
|
1225
1225
|
console.error(`Parsing project: ${projectRootToConnect}`);
|
|
1226
1226
|
const parsedFiles = await parseProject(projectRootToConnect);
|
|
1227
1227
|
console.error(`Parsed ${parsedFiles.length} files`);
|
|
1228
|
-
const graph = buildGraph(parsedFiles);
|
|
1228
|
+
const graph = buildGraph(parsedFiles, projectRootToConnect);
|
|
1229
1229
|
console.error(`Built graph: ${graph.order} symbols, ${graph.size} edges`);
|
|
1230
1230
|
state.graph = graph;
|
|
1231
1231
|
state.projectRoot = projectRootToConnect;
|
|
@@ -1292,7 +1292,7 @@ program.command("docs").description("Generate comprehensive codebase documentati
|
|
|
1292
1292
|
verbose: options.verbose
|
|
1293
1293
|
});
|
|
1294
1294
|
console.log(`Parsed ${parsedFiles.length} files`);
|
|
1295
|
-
const graph = buildGraph(parsedFiles);
|
|
1295
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
1296
1296
|
const parseTime = (Date.now() - startTime) / 1e3;
|
|
1297
1297
|
console.log(`Built graph: ${graph.order} symbols, ${graph.size} edges`);
|
|
1298
1298
|
if (options.verbose) {
|
|
@@ -1374,7 +1374,7 @@ program.command("health").description("Analyze dependency architecture health (0
|
|
|
1374
1374
|
const projectRoot = directory ? resolve4(directory) : findProjectRoot();
|
|
1375
1375
|
const startTime = Date.now();
|
|
1376
1376
|
const parsedFiles = await parseProject(projectRoot);
|
|
1377
|
-
const graph = buildGraph(parsedFiles);
|
|
1377
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
1378
1378
|
const parseTime = Date.now() - startTime;
|
|
1379
1379
|
const report = calculateHealthScore(graph, projectRoot);
|
|
1380
1380
|
const trend = getHealthTrend(projectRoot, report.overall);
|
|
@@ -1398,7 +1398,7 @@ program.command("dead-code").description("Identify dead code - symbols defined b
|
|
|
1398
1398
|
const projectRoot = directory ? resolve4(directory) : findProjectRoot();
|
|
1399
1399
|
const startTime = Date.now();
|
|
1400
1400
|
const parsedFiles = await parseProject(projectRoot);
|
|
1401
|
-
const graph = buildGraph(parsedFiles);
|
|
1401
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
1402
1402
|
const confidence = options.includeLow ? "low" : options.confidence || "medium";
|
|
1403
1403
|
const report = analyzeDeadCode(graph, projectRoot, {
|
|
1404
1404
|
confidence,
|
package/dist/mcpb-entry.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
startMcpServer,
|
|
5
5
|
updateFileInGraph,
|
|
6
6
|
watchProject
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FUIZQCYB.js";
|
|
8
8
|
import {
|
|
9
9
|
buildGraph,
|
|
10
10
|
parseProject
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WUSXCZXA.js";
|
|
12
12
|
|
|
13
13
|
// src/mcpb-entry.ts
|
|
14
14
|
import { resolve } from "path";
|
|
@@ -21,7 +21,7 @@ async function main() {
|
|
|
21
21
|
console.error(`[MCPB] Parsing project: ${projectRoot}`);
|
|
22
22
|
const parsedFiles = await parseProject(projectRoot);
|
|
23
23
|
console.error(`[MCPB] Parsed ${parsedFiles.length} files`);
|
|
24
|
-
const graph = buildGraph(parsedFiles);
|
|
24
|
+
const graph = buildGraph(parsedFiles, projectRoot);
|
|
25
25
|
console.error(`[MCPB] Built graph: ${graph.order} symbols, ${graph.size} edges`);
|
|
26
26
|
state.graph = graph;
|
|
27
27
|
state.projectRoot = projectRoot;
|
package/dist/sdk.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ declare function parseProject(projectRoot: string, options?: {
|
|
|
36
36
|
verbose?: boolean;
|
|
37
37
|
}): Promise<ParsedFile[]>;
|
|
38
38
|
|
|
39
|
-
declare function buildGraph(parsedFiles: ParsedFile[]): DirectedGraph;
|
|
39
|
+
declare function buildGraph(parsedFiles: ParsedFile[], projectRoot?: string): DirectedGraph;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Health Score Type Definitions
|
|
@@ -270,6 +270,35 @@ interface SecurityScanOptions {
|
|
|
270
270
|
|
|
271
271
|
declare function scanSecurity(projectRoot: string, graph: DirectedGraph, options?: SecurityScanOptions): Promise<SecurityScanResult>;
|
|
272
272
|
|
|
273
|
+
type CrossLanguageEdgeType = 'rest-api' | 'subprocess';
|
|
274
|
+
interface CrossLanguageEdge {
|
|
275
|
+
sourceFile: string;
|
|
276
|
+
targetFile: string;
|
|
277
|
+
edgeType: CrossLanguageEdgeType;
|
|
278
|
+
confidence: 'high' | 'medium' | 'low';
|
|
279
|
+
sourceLanguage: string;
|
|
280
|
+
targetLanguage: string;
|
|
281
|
+
sourceLine?: number;
|
|
282
|
+
targetLine?: number;
|
|
283
|
+
metadata: {
|
|
284
|
+
httpMethod?: string;
|
|
285
|
+
path?: string;
|
|
286
|
+
command?: string;
|
|
287
|
+
calledFile?: string;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
interface CrossLanguageDetectionResult {
|
|
291
|
+
edges: CrossLanguageEdge[];
|
|
292
|
+
stats: {
|
|
293
|
+
restApiEdges: number;
|
|
294
|
+
subprocessEdges: number;
|
|
295
|
+
filesAnalyzed: number;
|
|
296
|
+
detectionTimeMs: number;
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare function detectCrossLanguageEdges(files: ParsedFile[], projectRoot: string, graph: DirectedGraph): CrossLanguageDetectionResult;
|
|
301
|
+
|
|
273
302
|
/**
|
|
274
303
|
* depwire-cli SDK — Public API Surface
|
|
275
304
|
*
|
|
@@ -282,4 +311,4 @@ declare function scanSecurity(projectRoot: string, graph: DirectedGraph, options
|
|
|
282
311
|
/** Current SDK version — matches depwire-cli npm version */
|
|
283
312
|
declare const DepwireSDKVersion: string;
|
|
284
313
|
|
|
285
|
-
export { type BrokenImport, DepwireSDKVersion, type GraphDiff, type HealthDelta, type SecurityFinding, type SecurityScanOptions, type SecurityScanResult, type Severity, type SimulationAction, SimulationEngine, type SimulationResult, type VulnerabilityClass, analyzeDeadCode, buildGraph, calculateHealthScore, generateDocs, getArchitectureSummary, getImpact, parseProject, scanSecurity, searchSymbols };
|
|
314
|
+
export { type BrokenImport, type CrossLanguageDetectionResult, type CrossLanguageEdge, DepwireSDKVersion, type GraphDiff, type HealthDelta, type SecurityFinding, type SecurityScanOptions, type SecurityScanResult, type Severity, type SimulationAction, SimulationEngine, type SimulationResult, type VulnerabilityClass, analyzeDeadCode, buildGraph, calculateHealthScore, detectCrossLanguageEdges, generateDocs, getArchitectureSummary, getImpact, parseProject, scanSecurity, searchSymbols };
|
package/dist/sdk.js
CHANGED
|
@@ -3,13 +3,14 @@ import {
|
|
|
3
3
|
analyzeDeadCode,
|
|
4
4
|
buildGraph,
|
|
5
5
|
calculateHealthScore,
|
|
6
|
+
detectCrossLanguageEdges,
|
|
6
7
|
generateDocs,
|
|
7
8
|
getArchitectureSummary,
|
|
8
9
|
getImpact,
|
|
9
10
|
parseProject,
|
|
10
11
|
scanSecurity,
|
|
11
12
|
searchSymbols
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WUSXCZXA.js";
|
|
13
14
|
|
|
14
15
|
// src/sdk.ts
|
|
15
16
|
import { readFileSync } from "fs";
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
analyzeDeadCode,
|
|
26
27
|
buildGraph,
|
|
27
28
|
calculateHealthScore,
|
|
29
|
+
detectCrossLanguageEdges,
|
|
28
30
|
generateDocs,
|
|
29
31
|
getArchitectureSummary,
|
|
30
32
|
getImpact,
|