depwire-cli 0.6.0 → 0.6.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.
@@ -2988,8 +2988,8 @@ function calculateDepthScore(graph) {
2988
2988
  }
2989
2989
 
2990
2990
  // src/health/index.ts
2991
- import { readFileSync as readFileSync4, writeFileSync, existsSync as existsSync6 } from "fs";
2992
- import { join as join9 } from "path";
2991
+ import { readFileSync as readFileSync4, writeFileSync, existsSync as existsSync6, mkdirSync } from "fs";
2992
+ import { join as join9, dirname as dirname7 } from "path";
2993
2993
  function calculateHealthScore(graph, projectRoot) {
2994
2994
  const coupling = calculateCouplingScore(graph);
2995
2995
  const cohesion = calculateCohesionScore(graph);
@@ -3111,6 +3111,7 @@ function saveHealthHistory(projectRoot, report) {
3111
3111
  if (history.length > 50) {
3112
3112
  history = history.slice(-50);
3113
3113
  }
3114
+ mkdirSync(dirname7(historyFile), { recursive: true });
3114
3115
  writeFileSync(historyFile, JSON.stringify(history, null, 2), "utf-8");
3115
3116
  }
3116
3117
  function loadHealthHistory(projectRoot) {
@@ -3127,11 +3128,11 @@ function loadHealthHistory(projectRoot) {
3127
3128
  }
3128
3129
 
3129
3130
  // src/docs/generator.ts
3130
- import { writeFileSync as writeFileSync3, mkdirSync, existsSync as existsSync9 } from "fs";
3131
+ import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync2, existsSync as existsSync9 } from "fs";
3131
3132
  import { join as join12 } from "path";
3132
3133
 
3133
3134
  // src/docs/architecture.ts
3134
- import { dirname as dirname7 } from "path";
3135
+ import { dirname as dirname8 } from "path";
3135
3136
 
3136
3137
  // src/docs/templates.ts
3137
3138
  function header(text, level = 1) {
@@ -3282,7 +3283,7 @@ function generateModuleStructure(graph) {
3282
3283
  function getDirectoryStats(graph) {
3283
3284
  const dirMap = /* @__PURE__ */ new Map();
3284
3285
  graph.forEachNode((node, attrs) => {
3285
- const dir = dirname7(attrs.filePath);
3286
+ const dir = dirname8(attrs.filePath);
3286
3287
  if (dir === ".") return;
3287
3288
  if (!dirMap.has(dir)) {
3288
3289
  dirMap.set(dir, {
@@ -3307,7 +3308,7 @@ function getDirectoryStats(graph) {
3307
3308
  });
3308
3309
  const filesPerDir = /* @__PURE__ */ new Map();
3309
3310
  graph.forEachNode((node, attrs) => {
3310
- const dir = dirname7(attrs.filePath);
3311
+ const dir = dirname8(attrs.filePath);
3311
3312
  if (!filesPerDir.has(dir)) {
3312
3313
  filesPerDir.set(dir, /* @__PURE__ */ new Set());
3313
3314
  }
@@ -3322,8 +3323,8 @@ function getDirectoryStats(graph) {
3322
3323
  graph.forEachEdge((edge, attrs, source, target) => {
3323
3324
  const sourceAttrs = graph.getNodeAttributes(source);
3324
3325
  const targetAttrs = graph.getNodeAttributes(target);
3325
- const sourceDir = dirname7(sourceAttrs.filePath);
3326
- const targetDir = dirname7(targetAttrs.filePath);
3326
+ const sourceDir = dirname8(sourceAttrs.filePath);
3327
+ const targetDir = dirname8(targetAttrs.filePath);
3327
3328
  if (sourceDir !== targetDir) {
3328
3329
  if (!dirEdges.has(sourceDir)) {
3329
3330
  dirEdges.set(sourceDir, { in: 0, out: 0 });
@@ -4304,7 +4305,7 @@ function detectCyclesDetailed(graph) {
4304
4305
  }
4305
4306
 
4306
4307
  // src/docs/onboarding.ts
4307
- import { dirname as dirname8 } from "path";
4308
+ import { dirname as dirname9 } from "path";
4308
4309
  function generateOnboarding(graph, projectRoot, version) {
4309
4310
  let output = "";
4310
4311
  const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
@@ -4363,7 +4364,7 @@ function generateQuickOrientation(graph) {
4363
4364
  const primaryLang = Object.entries(languages2).sort((a, b) => b[1] - a[1])[0];
4364
4365
  const dirs = /* @__PURE__ */ new Set();
4365
4366
  graph.forEachNode((node, attrs) => {
4366
- const dir = dirname8(attrs.filePath);
4367
+ const dir = dirname9(attrs.filePath);
4367
4368
  if (dir !== ".") {
4368
4369
  const topLevel = dir.split("/")[0];
4369
4370
  dirs.add(topLevel);
@@ -4467,7 +4468,7 @@ function generateModuleMap(graph) {
4467
4468
  function getDirectoryStats2(graph) {
4468
4469
  const dirMap = /* @__PURE__ */ new Map();
4469
4470
  graph.forEachNode((node, attrs) => {
4470
- const dir = dirname8(attrs.filePath);
4471
+ const dir = dirname9(attrs.filePath);
4471
4472
  if (dir === ".") return;
4472
4473
  if (!dirMap.has(dir)) {
4473
4474
  dirMap.set(dir, {
@@ -4482,7 +4483,7 @@ function getDirectoryStats2(graph) {
4482
4483
  });
4483
4484
  const filesPerDir = /* @__PURE__ */ new Map();
4484
4485
  graph.forEachNode((node, attrs) => {
4485
- const dir = dirname8(attrs.filePath);
4486
+ const dir = dirname9(attrs.filePath);
4486
4487
  if (!filesPerDir.has(dir)) {
4487
4488
  filesPerDir.set(dir, /* @__PURE__ */ new Set());
4488
4489
  }
@@ -4497,8 +4498,8 @@ function getDirectoryStats2(graph) {
4497
4498
  graph.forEachEdge((edge, attrs, source, target) => {
4498
4499
  const sourceAttrs = graph.getNodeAttributes(source);
4499
4500
  const targetAttrs = graph.getNodeAttributes(target);
4500
- const sourceDir = dirname8(sourceAttrs.filePath);
4501
- const targetDir = dirname8(targetAttrs.filePath);
4501
+ const sourceDir = dirname9(sourceAttrs.filePath);
4502
+ const targetDir = dirname9(targetAttrs.filePath);
4502
4503
  if (sourceDir !== targetDir) {
4503
4504
  if (!dirEdges.has(sourceDir)) {
4504
4505
  dirEdges.set(sourceDir, { in: 0, out: 0 });
@@ -4579,7 +4580,7 @@ function detectClusters(graph) {
4579
4580
  const dirFiles = /* @__PURE__ */ new Map();
4580
4581
  const fileEdges = /* @__PURE__ */ new Map();
4581
4582
  graph.forEachNode((node, attrs) => {
4582
- const dir = dirname8(attrs.filePath);
4583
+ const dir = dirname9(attrs.filePath);
4583
4584
  if (!dirFiles.has(dir)) {
4584
4585
  dirFiles.set(dir, /* @__PURE__ */ new Set());
4585
4586
  }
@@ -4633,8 +4634,8 @@ function inferClusterName(files) {
4633
4634
  if (sortedWords.length > 0 && sortedWords[0][1] > 1) {
4634
4635
  return capitalizeFirst2(sortedWords[0][0]);
4635
4636
  }
4636
- const commonDir = dirname8(files[0]);
4637
- if (files.every((f) => dirname8(f) === commonDir)) {
4637
+ const commonDir = dirname9(files[0]);
4638
+ if (files.every((f) => dirname9(f) === commonDir)) {
4638
4639
  return capitalizeFirst2(commonDir.split("/").pop() || "Core");
4639
4640
  }
4640
4641
  return "Core";
@@ -4692,7 +4693,7 @@ function generateDepwireUsage(projectRoot) {
4692
4693
  }
4693
4694
 
4694
4695
  // src/docs/files.ts
4695
- import { dirname as dirname9, basename as basename3 } from "path";
4696
+ import { dirname as dirname10, basename as basename3 } from "path";
4696
4697
  function generateFiles(graph, projectRoot, version) {
4697
4698
  let output = "";
4698
4699
  const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
@@ -4796,7 +4797,7 @@ function generateDirectoryBreakdown(graph) {
4796
4797
  const fileStats = getFileStats2(graph);
4797
4798
  const dirMap = /* @__PURE__ */ new Map();
4798
4799
  for (const file of fileStats) {
4799
- const dir = dirname9(file.filePath);
4800
+ const dir = dirname10(file.filePath);
4800
4801
  const topDir = dir === "." ? "." : dir.split("/")[0];
4801
4802
  if (!dirMap.has(topDir)) {
4802
4803
  dirMap.set(topDir, {
@@ -5439,7 +5440,7 @@ function generateRecommendations(graph) {
5439
5440
  }
5440
5441
 
5441
5442
  // src/docs/tests.ts
5442
- import { basename as basename4, dirname as dirname10 } from "path";
5443
+ import { basename as basename4, dirname as dirname11 } from "path";
5443
5444
  function generateTests(graph, projectRoot, version) {
5444
5445
  let output = "";
5445
5446
  const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
@@ -5468,7 +5469,7 @@ function getFileCount8(graph) {
5468
5469
  }
5469
5470
  function isTestFile(filePath) {
5470
5471
  const fileName = basename4(filePath).toLowerCase();
5471
- const dirPath = dirname10(filePath).toLowerCase();
5472
+ const dirPath = dirname11(filePath).toLowerCase();
5472
5473
  if (dirPath.includes("test") || dirPath.includes("spec") || dirPath.includes("__tests__")) {
5473
5474
  return true;
5474
5475
  }
@@ -5527,12 +5528,12 @@ function generateTestFileInventory(graph) {
5527
5528
  }
5528
5529
  function matchTestToSource(testFile) {
5529
5530
  const testFileName = basename4(testFile);
5530
- const testDir = dirname10(testFile);
5531
+ const testDir = dirname11(testFile);
5531
5532
  let sourceFileName = testFileName.replace(/\.test\./g, ".").replace(/\.spec\./g, ".").replace(/_test\./g, ".").replace(/_spec\./g, ".");
5532
5533
  const possiblePaths = [];
5533
5534
  possiblePaths.push(testDir + "/" + sourceFileName);
5534
5535
  if (testDir.endsWith("/test") || testDir.endsWith("/tests") || testDir.endsWith("/__tests__")) {
5535
- const parentDir = dirname10(testDir);
5536
+ const parentDir = dirname11(testDir);
5536
5537
  possiblePaths.push(parentDir + "/" + sourceFileName);
5537
5538
  }
5538
5539
  if (testDir.includes("test")) {
@@ -5729,7 +5730,7 @@ function generateTestStatistics(graph) {
5729
5730
  `;
5730
5731
  const dirTestCoverage = /* @__PURE__ */ new Map();
5731
5732
  for (const sourceFile of sourceFiles) {
5732
- const dir = dirname10(sourceFile).split("/")[0];
5733
+ const dir = dirname11(sourceFile).split("/")[0];
5733
5734
  if (!dirTestCoverage.has(dir)) {
5734
5735
  dirTestCoverage.set(dir, { total: 0, tested: 0 });
5735
5736
  }
@@ -5752,7 +5753,7 @@ function generateTestStatistics(graph) {
5752
5753
  }
5753
5754
 
5754
5755
  // src/docs/history.ts
5755
- import { dirname as dirname11 } from "path";
5756
+ import { dirname as dirname12 } from "path";
5756
5757
  import { execSync } from "child_process";
5757
5758
  function generateHistory(graph, projectRoot, version) {
5758
5759
  let output = "";
@@ -6033,7 +6034,7 @@ function generateFeatureClusters(graph) {
6033
6034
  const dirFiles = /* @__PURE__ */ new Map();
6034
6035
  const fileEdges = /* @__PURE__ */ new Map();
6035
6036
  graph.forEachNode((node, attrs) => {
6036
- const dir = dirname11(attrs.filePath);
6037
+ const dir = dirname12(attrs.filePath);
6037
6038
  if (!dirFiles.has(dir)) {
6038
6039
  dirFiles.set(dir, /* @__PURE__ */ new Set());
6039
6040
  }
@@ -6115,7 +6116,7 @@ function capitalizeFirst3(str) {
6115
6116
  }
6116
6117
 
6117
6118
  // src/docs/current.ts
6118
- import { dirname as dirname12 } from "path";
6119
+ import { dirname as dirname13 } from "path";
6119
6120
  function generateCurrent(graph, projectRoot, version) {
6120
6121
  let output = "";
6121
6122
  const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
@@ -6253,7 +6254,7 @@ function generateCompleteFileIndex(graph) {
6253
6254
  fileInfos.sort((a, b) => a.filePath.localeCompare(b.filePath));
6254
6255
  const dirGroups = /* @__PURE__ */ new Map();
6255
6256
  for (const info of fileInfos) {
6256
- const dir = dirname12(info.filePath);
6257
+ const dir = dirname13(info.filePath);
6257
6258
  const topDir = dir === "." ? "root" : dir.split("/")[0];
6258
6259
  if (!dirGroups.has(topDir)) {
6259
6260
  dirGroups.set(topDir, []);
@@ -7033,7 +7034,7 @@ async function generateDocs(graph, projectRoot, version, parseTime, options) {
7033
7034
  const errors = [];
7034
7035
  try {
7035
7036
  if (!existsSync9(options.outputDir)) {
7036
- mkdirSync(options.outputDir, { recursive: true });
7037
+ mkdirSync2(options.outputDir, { recursive: true });
7037
7038
  if (options.verbose) {
7038
7039
  console.log(`Created output directory: ${options.outputDir}`);
7039
7040
  }
@@ -7239,7 +7240,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
7239
7240
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7240
7241
 
7241
7242
  // src/mcp/tools.ts
7242
- import { dirname as dirname13, join as join14 } from "path";
7243
+ import { dirname as dirname14, join as join14 } from "path";
7243
7244
  import { existsSync as existsSync11, readFileSync as readFileSync7 } from "fs";
7244
7245
 
7245
7246
  // src/mcp/connect.ts
@@ -8004,7 +8005,7 @@ function handleGetArchitectureSummary(graph) {
8004
8005
  const dirMap = /* @__PURE__ */ new Map();
8005
8006
  const languageBreakdown = {};
8006
8007
  fileSummary.forEach((f) => {
8007
- const dir = f.filePath.includes("/") ? dirname13(f.filePath) : ".";
8008
+ const dir = f.filePath.includes("/") ? dirname14(f.filePath) : ".";
8008
8009
  if (!dirMap.has(dir)) {
8009
8010
  dirMap.set(dir, { fileCount: 0, symbolCount: 0 });
8010
8011
  }
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  startVizServer,
15
15
  updateFileInGraph,
16
16
  watchProject
17
- } from "./chunk-AFJFZXCI.js";
17
+ } from "./chunk-S3RUBXRF.js";
18
18
 
19
19
  // src/index.ts
20
20
  import { Command } from "commander";
@@ -6,7 +6,7 @@ import {
6
6
  startMcpServer,
7
7
  updateFileInGraph,
8
8
  watchProject
9
- } from "./chunk-AFJFZXCI.js";
9
+ } from "./chunk-S3RUBXRF.js";
10
10
 
11
11
  // src/mcpb-entry.ts
12
12
  import { resolve } from "path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "depwire-cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Code cross-reference visualization and AI context engine for TypeScript, JavaScript, Python, and Go. Zero native dependencies — works on Windows, macOS, and Linux.",
5
5
  "type": "module",
6
6
  "bin": {