vibecodingmachine-core 2026.2.20-438 → 2026.2.26-1739

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.
Files changed (202) hide show
  1. package/README.md +240 -0
  2. package/package.json +10 -2
  3. package/src/agents/Agent.js +300 -0
  4. package/src/agents/AgentAdditionService.js +311 -0
  5. package/src/agents/AgentCheckService.js +690 -0
  6. package/src/agents/AgentInstallationService.js +140 -0
  7. package/src/agents/AgentSetupService.js +467 -0
  8. package/src/agents/AgentStatus.js +183 -0
  9. package/src/agents/AgentVerificationService.js +634 -0
  10. package/src/agents/ConfigurationSchemaValidator.js +543 -0
  11. package/src/agents/EnvironmentConfigurationManager.js +602 -0
  12. package/src/agents/InstallationErrorHandler.js +372 -0
  13. package/src/agents/InstallationLog.js +363 -0
  14. package/src/agents/InstallationMethod.js +510 -0
  15. package/src/agents/InstallationOrchestrator.js +352 -0
  16. package/src/agents/InstallationProgressReporter.js +372 -0
  17. package/src/agents/InstallationRetryManager.js +322 -0
  18. package/src/agents/InstallationType.js +254 -0
  19. package/src/agents/OperationTypes.js +310 -0
  20. package/src/agents/PerformanceMetricsCollector.js +493 -0
  21. package/src/agents/SecurityValidationService.js +534 -0
  22. package/src/agents/VerificationTest.js +354 -0
  23. package/src/agents/VerificationType.js +226 -0
  24. package/src/agents/WindowsPermissionHandler.js +518 -0
  25. package/src/agents/config/AgentConfigManager.js +393 -0
  26. package/src/agents/config/AgentDefaultsRegistry.js +373 -0
  27. package/src/agents/config/ConfigValidator.js +281 -0
  28. package/src/agents/discovery/AgentDiscoveryService.js +707 -0
  29. package/src/agents/logging/AgentLogger.js +511 -0
  30. package/src/agents/status/AgentStatusManager.js +481 -0
  31. package/src/agents/storage/FileManager.js +454 -0
  32. package/src/agents/verification/AgentCommunicationTester.js +474 -0
  33. package/src/agents/verification/BaseVerifier.js +430 -0
  34. package/src/agents/verification/CommandVerifier.js +480 -0
  35. package/src/agents/verification/FileOperationVerifier.js +453 -0
  36. package/src/agents/verification/ResultAnalyzer.js +707 -0
  37. package/src/agents/verification/TestRequirementManager.js +495 -0
  38. package/src/agents/verification/VerificationRunner.js +433 -0
  39. package/src/agents/windows/BaseWindowsInstaller.js +441 -0
  40. package/src/agents/windows/ChocolateyInstaller.js +509 -0
  41. package/src/agents/windows/DirectInstaller.js +443 -0
  42. package/src/agents/windows/InstallerFactory.js +391 -0
  43. package/src/agents/windows/NpmInstaller.js +505 -0
  44. package/src/agents/windows/PowerShellInstaller.js +458 -0
  45. package/src/agents/windows/WinGetInstaller.js +390 -0
  46. package/src/analysis/analysis-reporter.js +132 -0
  47. package/src/analysis/boundary-detector.js +712 -0
  48. package/src/analysis/categorizer.js +340 -0
  49. package/src/analysis/codebase-scanner.js +384 -0
  50. package/src/analysis/line-counter.js +513 -0
  51. package/src/analysis/priority-calculator.js +679 -0
  52. package/src/analysis/report/analysis-report.js +250 -0
  53. package/src/analysis/report/package-analyzer.js +278 -0
  54. package/src/analysis/report/recommendation-generator.js +382 -0
  55. package/src/analysis/report/statistics-generator.js +515 -0
  56. package/src/analysis/reports/analysis-report-model.js +101 -0
  57. package/src/analysis/reports/recommendation-generator.js +283 -0
  58. package/src/analysis/reports/report-generators.js +191 -0
  59. package/src/analysis/reports/statistics-calculator.js +231 -0
  60. package/src/analysis/reports/trend-analyzer.js +219 -0
  61. package/src/analysis/strategy-generator.js +814 -0
  62. package/src/auto-mode/AutoModeBusinessLogic.js +836 -0
  63. package/src/config/refactoring-config.js +307 -0
  64. package/src/health-tracking/json-storage.js +38 -2
  65. package/src/ide-integration/applescript-manager-core.js +233 -0
  66. package/src/ide-integration/applescript-manager.cjs +357 -28
  67. package/src/ide-integration/applescript-manager.js +89 -3599
  68. package/src/ide-integration/cdp-manager.js +306 -0
  69. package/src/ide-integration/claude-code-cli-manager.cjs +1 -1
  70. package/src/ide-integration/continuation-handler.js +337 -0
  71. package/src/ide-integration/ide-status-checker.js +292 -0
  72. package/src/ide-integration/macos-ide-manager.js +627 -0
  73. package/src/ide-integration/macos-text-sender.js +528 -0
  74. package/src/ide-integration/response-reader.js +548 -0
  75. package/src/ide-integration/windows-automation-manager.js +121 -0
  76. package/src/ide-integration/windows-ide-manager.js +373 -0
  77. package/src/index.cjs +25 -3
  78. package/src/index.js +15 -1
  79. package/src/llm/direct-llm-manager.cjs +90 -2
  80. package/src/models/compliance-report.js +538 -0
  81. package/src/models/file-analysis.js +681 -0
  82. package/src/models/refactoring-plan.js +770 -0
  83. package/src/monitoring/alert-system.js +834 -0
  84. package/src/monitoring/compliance-progress-tracker.js +437 -0
  85. package/src/monitoring/continuous-scan-notifications.js +661 -0
  86. package/src/monitoring/continuous-scanner.js +279 -0
  87. package/src/monitoring/file-monitor/file-analyzer.js +262 -0
  88. package/src/monitoring/file-monitor/file-monitor.js +237 -0
  89. package/src/monitoring/file-monitor/watcher.js +194 -0
  90. package/src/monitoring/file-monitor.js +17 -0
  91. package/src/monitoring/notification-manager.js +437 -0
  92. package/src/monitoring/scanner-core.js +368 -0
  93. package/src/monitoring/scanner-events.js +214 -0
  94. package/src/monitoring/violation-notification-system.js +515 -0
  95. package/src/refactoring/boundaries/cohesion-analyzer.js +316 -0
  96. package/src/refactoring/boundaries/extraction-result.js +285 -0
  97. package/src/refactoring/boundaries/extraction-strategies.js +392 -0
  98. package/src/refactoring/boundaries/module-boundary.js +209 -0
  99. package/src/refactoring/boundary/boundary-detector.js +741 -0
  100. package/src/refactoring/boundary/boundary-types.js +405 -0
  101. package/src/refactoring/boundary/extraction-strategies.js +554 -0
  102. package/src/refactoring/boundary-extraction-result.js +77 -0
  103. package/src/refactoring/boundary-extraction-strategies.js +330 -0
  104. package/src/refactoring/boundary-extractor.js +384 -0
  105. package/src/refactoring/boundary-types.js +46 -0
  106. package/src/refactoring/circular/circular-dependency.js +88 -0
  107. package/src/refactoring/circular/cycle-detection.js +147 -0
  108. package/src/refactoring/circular/dependency-node.js +82 -0
  109. package/src/refactoring/circular/dependency-result.js +107 -0
  110. package/src/refactoring/circular/dependency-types.js +58 -0
  111. package/src/refactoring/circular/graph-builder.js +213 -0
  112. package/src/refactoring/circular/resolution-strategy.js +72 -0
  113. package/src/refactoring/circular/strategy-generator.js +229 -0
  114. package/src/refactoring/circular-dependency-resolver-original.js +809 -0
  115. package/src/refactoring/circular-dependency-resolver.js +200 -0
  116. package/src/refactoring/code-mover.js +761 -0
  117. package/src/refactoring/file-splitter.js +696 -0
  118. package/src/refactoring/functionality-validator.js +816 -0
  119. package/src/refactoring/import-manager.js +774 -0
  120. package/src/refactoring/module-boundary.js +107 -0
  121. package/src/refactoring/refactoring-executor.js +672 -0
  122. package/src/refactoring/refactoring-rollback.js +614 -0
  123. package/src/refactoring/test-validator.js +631 -0
  124. package/src/requirement-management/default-requirement-manager.js +321 -0
  125. package/src/requirement-management/requirement-file-parser.js +159 -0
  126. package/src/requirement-management/requirement-sequencer.js +221 -0
  127. package/src/rui/commands/AgentCommandParser.js +600 -0
  128. package/src/rui/commands/AgentCommands.js +487 -0
  129. package/src/rui/commands/AgentResponseFormatter.js +832 -0
  130. package/src/scripts/verify-full-compliance.js +269 -0
  131. package/src/sync/sync-engine-core.js +1 -0
  132. package/src/sync/sync-engine-remote-handlers.js +135 -0
  133. package/src/task-generation/automated-task-generator.js +351 -0
  134. package/src/task-generation/prioritizer.js +287 -0
  135. package/src/task-generation/task-list-updater.js +215 -0
  136. package/src/task-generation/task-management-integration.js +480 -0
  137. package/src/task-generation/task-manager-integration.js +270 -0
  138. package/src/task-generation/violation-task-generator.js +474 -0
  139. package/src/task-management/continuous-scan-integration.js +342 -0
  140. package/src/timeout-management/index.js +12 -3
  141. package/src/timeout-management/response-time-tracker.js +167 -0
  142. package/src/timeout-management/timeout-calculator.js +159 -0
  143. package/src/timeout-management/timeout-config-manager.js +172 -0
  144. package/src/utils/ast-analyzer.js +417 -0
  145. package/src/utils/current-requirement-manager.js +276 -0
  146. package/src/utils/current-requirement-operations.js +472 -0
  147. package/src/utils/dependency-mapper.js +456 -0
  148. package/src/utils/download-with-progress.js +4 -2
  149. package/src/utils/electron-update-checker.js +4 -1
  150. package/src/utils/file-size-analyzer.js +272 -0
  151. package/src/utils/import-updater.js +280 -0
  152. package/src/utils/refactoring-tools.js +512 -0
  153. package/src/utils/report-generator.js +569 -0
  154. package/src/utils/reports/report-analysis.js +218 -0
  155. package/src/utils/reports/report-types.js +55 -0
  156. package/src/utils/reports/summary-generators.js +102 -0
  157. package/src/utils/requirement-file-management.js +157 -0
  158. package/src/utils/requirement-helpers/requirement-file-ops.js +392 -0
  159. package/src/utils/requirement-helpers/requirement-mover.js +414 -0
  160. package/src/utils/requirement-helpers/requirement-parser.js +326 -0
  161. package/src/utils/requirement-helpers/requirement-status.js +320 -0
  162. package/src/utils/requirement-helpers-new.js +55 -0
  163. package/src/utils/requirement-helpers-refactored.js +367 -0
  164. package/src/utils/requirement-helpers.js +291 -1191
  165. package/src/utils/requirement-movement-operations.js +450 -0
  166. package/src/utils/requirement-movement.js +312 -0
  167. package/src/utils/requirement-parsing-helpers.js +56 -0
  168. package/src/utils/requirement-statistics.js +200 -0
  169. package/src/utils/requirement-text-utils.js +58 -0
  170. package/src/utils/rollback/rollback-handlers.js +125 -0
  171. package/src/utils/rollback/rollback-operation.js +63 -0
  172. package/src/utils/rollback/rollback-recorder.js +166 -0
  173. package/src/utils/rollback/rollback-state-manager.js +175 -0
  174. package/src/utils/rollback/rollback-types.js +33 -0
  175. package/src/utils/rollback/rollback-utils.js +110 -0
  176. package/src/utils/rollback-manager-original.js +569 -0
  177. package/src/utils/rollback-manager.js +202 -0
  178. package/src/utils/smoke-test-cli.js +362 -0
  179. package/src/utils/smoke-test-gui.js +351 -0
  180. package/src/utils/smoke-test-orchestrator.js +321 -0
  181. package/src/utils/smoke-test-runner.js +60 -0
  182. package/src/utils/smoke-test-web.js +347 -0
  183. package/src/utils/specification-helpers.js +39 -13
  184. package/src/utils/specification-migration.js +97 -0
  185. package/src/utils/test-runner.js +579 -0
  186. package/src/utils/validation-framework.js +518 -0
  187. package/src/validation/compliance-analyzer.js +197 -0
  188. package/src/validation/compliance-report-generator.js +343 -0
  189. package/src/validation/compliance-reporter.js +711 -0
  190. package/src/validation/compliance-rules.js +127 -0
  191. package/src/validation/constitution-validator-new.js +196 -0
  192. package/src/validation/constitution-validator.js +17 -0
  193. package/src/validation/file-validators.js +170 -0
  194. package/src/validation/line-limit/file-analyzer.js +201 -0
  195. package/src/validation/line-limit/line-limit-validator.js +208 -0
  196. package/src/validation/line-limit/validation-result.js +144 -0
  197. package/src/validation/line-limit-core.js +225 -0
  198. package/src/validation/line-limit-reporter.js +134 -0
  199. package/src/validation/line-limit-result.js +125 -0
  200. package/src/validation/line-limit-validator.js +41 -0
  201. package/src/validation/metrics-calculator.js +660 -0
  202. package/src/sync/sync-engine-backup.js +0 -559
@@ -0,0 +1,456 @@
1
+ /**
2
+ * Dependency Mapping Utility
3
+ * Maps and analyzes file dependencies for refactoring planning
4
+ * Part of specs/010-555-max-file-size implementation (Task T003)
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ /**
11
+ * Map dependencies for a given file
12
+ * @param {string} filePath - Path to file to analyze
13
+ * @param {Object} options - Analysis options
14
+ * @returns {Object} Dependency analysis results
15
+ */
16
+ function mapFileDependencies(filePath, options = {}) {
17
+ try {
18
+ const content = fs.readFileSync(filePath, 'utf8');
19
+ const lines = content.split('\n');
20
+
21
+ const analysis = {
22
+ filePath,
23
+ dependencies: [],
24
+ dependents: [],
25
+ circularDependencies: [],
26
+ externalDependencies: [],
27
+ internalDependencies: [],
28
+ dependencyGraph: {},
29
+ complexity: 'LOW'
30
+ };
31
+
32
+ // Extract imports/requires
33
+ const imports = extractImports(lines);
34
+
35
+ // Categorize dependencies
36
+ imports.forEach(imp => {
37
+ const depInfo = analyzeDependency(imp, filePath, options);
38
+
39
+ if (depInfo.isExternal) {
40
+ analysis.externalDependencies.push(depInfo);
41
+ } else {
42
+ analysis.internalDependencies.push(depInfo);
43
+ }
44
+
45
+ analysis.dependencies.push(depInfo);
46
+ });
47
+
48
+ // Build dependency graph
49
+ analysis.dependencyGraph = buildDependencyGraph(filePath, analysis.dependencies);
50
+
51
+ // Assess complexity
52
+ analysis.complexity = assessDependencyComplexity(analysis);
53
+
54
+ return analysis;
55
+ } catch (error) {
56
+ return {
57
+ filePath,
58
+ error: error.message,
59
+ dependencies: []
60
+ };
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Extract import/require statements from file content
66
+ * @param {Array} lines - File lines
67
+ * @returns {Array} Array of import objects
68
+ */
69
+ function extractImports(lines) {
70
+ const imports = [];
71
+
72
+ lines.forEach((line, index) => {
73
+ const trimmed = line.trim();
74
+
75
+ // ES6 imports
76
+ const es6Match = trimmed.match(/^import\s+(?:(?:\{[^}]+\}|\*\s+as\s+\w+|\w+)\s+from\s+)?['"]([^'"]+)['"]/);
77
+ if (es6Match) {
78
+ imports.push({
79
+ type: 'es6',
80
+ module: es6Match[1],
81
+ line: index + 1,
82
+ statement: trimmed
83
+ });
84
+ return;
85
+ }
86
+
87
+ // CommonJS requires
88
+ const cjsMatch = trimmed.match(/(?:const|let|var)\s+(?:\{[^}]+\}|\w+)\s*=\s*require\(['"]([^'"]+)['"]\)/);
89
+ if (cjsMatch) {
90
+ imports.push({
91
+ type: 'commonjs',
92
+ module: cjsMatch[1],
93
+ line: index + 1,
94
+ statement: trimmed
95
+ });
96
+ return;
97
+ }
98
+
99
+ // Direct require calls
100
+ const directMatch = trimmed.match(/require\(['"]([^'"]+)['"]\)/);
101
+ if (directMatch) {
102
+ imports.push({
103
+ type: 'direct',
104
+ module: directMatch[1],
105
+ line: index + 1,
106
+ statement: trimmed
107
+ });
108
+ }
109
+ });
110
+
111
+ return imports;
112
+ }
113
+
114
+ /**
115
+ * Analyze a dependency
116
+ * @param {Object} importObj - Import object
117
+ * @param {string} sourceFile - Source file path
118
+ * @param {Object} options - Analysis options
119
+ * @returns {Object} Dependency analysis
120
+ */
121
+ function analyzeDependency(importObj, sourceFile, options = {}) {
122
+ const modulePath = importObj.module;
123
+ const resolvedPath = resolveModulePath(modulePath, sourceFile);
124
+
125
+ return {
126
+ type: importObj.type,
127
+ module: modulePath,
128
+ resolvedPath,
129
+ line: importObj.line,
130
+ statement: importObj.statement,
131
+ isExternal: isExternalDependency(modulePath, resolvedPath, options),
132
+ isRelative: isRelativePath(modulePath),
133
+ isNodeModule: isNodeModule(modulePath),
134
+ isLocalModule: isLocalModule(modulePath, resolvedPath)
135
+ };
136
+ }
137
+
138
+ /**
139
+ * Resolve module path to absolute path
140
+ * @param {string} modulePath - Module path from import
141
+ * @param {string} sourceFile - Source file path
142
+ * @returns {string|null} Resolved absolute path
143
+ */
144
+ function resolveModulePath(modulePath, sourceFile) {
145
+ try {
146
+ if (isNodeModule(modulePath)) {
147
+ return null; // Node modules don't resolve to local files
148
+ }
149
+
150
+ if (isRelativePath(modulePath)) {
151
+ const sourceDir = path.dirname(sourceFile);
152
+ const resolved = path.resolve(sourceDir, modulePath);
153
+
154
+ // Try different extensions
155
+ const extensions = ['.js', '.json', '.jsx', '.ts', '.tsx'];
156
+ for (const ext of extensions) {
157
+ const fullPath = resolved.endsWith(ext) ? resolved : resolved + ext;
158
+ if (fs.existsSync(fullPath)) {
159
+ return fullPath;
160
+ }
161
+ }
162
+
163
+ // Try index.js in directory
164
+ const indexPath = path.join(resolved, 'index.js');
165
+ if (fs.existsSync(indexPath)) {
166
+ return indexPath;
167
+ }
168
+
169
+ return null;
170
+ }
171
+
172
+ // Absolute path
173
+ if (path.isAbsolute(modulePath)) {
174
+ return fs.existsSync(modulePath) ? modulePath : null;
175
+ }
176
+
177
+ return null;
178
+ } catch (error) {
179
+ return null;
180
+ }
181
+ }
182
+
183
+ /**
184
+ * Check if dependency is external (third-party)
185
+ * @param {string} modulePath - Module path
186
+ * @param {string} resolvedPath - Resolved path
187
+ * @param {Object} options - Analysis options
188
+ * @returns {boolean}
189
+ */
190
+ function isExternalDependency(modulePath, resolvedPath, options = {}) {
191
+ // Node modules are external
192
+ if (isNodeModule(modulePath)) {
193
+ return true;
194
+ }
195
+
196
+ // If we have a list of external modules, check against it
197
+ if (options.externalModules && Array.isArray(options.externalModules)) {
198
+ return options.externalModules.includes(modulePath);
199
+ }
200
+
201
+ // If resolved path is outside project root, it's external
202
+ if (resolvedPath && options.projectRoot) {
203
+ return !resolvedPath.startsWith(options.projectRoot);
204
+ }
205
+
206
+ // Default: non-relative paths without resolution are external
207
+ return !isRelativePath(modulePath) && !resolvedPath;
208
+ }
209
+
210
+ /**
211
+ * Check if path is relative
212
+ * @param {string} modulePath - Module path
213
+ * @returns {boolean}
214
+ */
215
+ function isRelativePath(modulePath) {
216
+ return modulePath.startsWith('./') || modulePath.startsWith('../');
217
+ }
218
+
219
+ /**
220
+ * Check if module is a Node.js module
221
+ * @param {string} modulePath - Module path
222
+ * @returns {boolean}
223
+ */
224
+ function isNodeModule(modulePath) {
225
+ // Common Node.js modules
226
+ const nodeModules = new Set([
227
+ 'fs', 'path', 'os', 'util', 'events', 'stream', 'crypto', 'http', 'https',
228
+ 'url', 'querystring', 'assert', 'buffer', 'child_process', 'cluster', 'dgram',
229
+ 'dns', 'net', 'readline', 'repl', 'tls', 'tty', 'vm', 'zlib', 'console',
230
+ 'timers', 'process', 'module', 'sys'
231
+ ]);
232
+
233
+ return nodeModules.has(modulePath) || !modulePath.startsWith('.') && !path.isAbsolute(modulePath);
234
+ }
235
+
236
+ /**
237
+ * Check if module is a local module
238
+ * @param {string} modulePath - Module path
239
+ * @param {string} resolvedPath - Resolved path
240
+ * @returns {boolean}
241
+ */
242
+ function isLocalModule(modulePath, resolvedPath) {
243
+ return resolvedPath !== null && fs.existsSync(resolvedPath);
244
+ }
245
+
246
+ /**
247
+ * Build dependency graph
248
+ * @param {string} filePath - Source file path
249
+ * @param {Array} dependencies - Array of dependencies
250
+ * @returns {Object} Dependency graph
251
+ */
252
+ function buildDependencyGraph(filePath, dependencies) {
253
+ const graph = {
254
+ nodes: [{ id: filePath, type: 'source' }],
255
+ edges: []
256
+ };
257
+
258
+ dependencies.forEach(dep => {
259
+ if (dep.resolvedPath) {
260
+ // Add dependency node if not already present
261
+ if (!graph.nodes.find(n => n.id === dep.resolvedPath)) {
262
+ graph.nodes.push({
263
+ id: dep.resolvedPath,
264
+ type: dep.isExternal ? 'external' : 'internal'
265
+ });
266
+ }
267
+
268
+ // Add edge
269
+ graph.edges.push({
270
+ from: filePath,
271
+ to: dep.resolvedPath,
272
+ type: dep.type,
273
+ line: dep.line
274
+ });
275
+ }
276
+ });
277
+
278
+ return graph;
279
+ }
280
+
281
+ /**
282
+ * Assess dependency complexity
283
+ * @param {Object} analysis - Dependency analysis
284
+ * @returns {string} Complexity level
285
+ */
286
+ function assessDependencyComplexity(analysis) {
287
+ const totalDeps = analysis.dependencies.length;
288
+ const externalDeps = analysis.externalDependencies.length;
289
+ const internalDeps = analysis.internalDependencies.length;
290
+
291
+ if (totalDeps > 20 || internalDeps > 10) {
292
+ return 'HIGH';
293
+ } else if (totalDeps > 10 || internalDeps > 5) {
294
+ return 'MEDIUM';
295
+ } else {
296
+ return 'LOW';
297
+ }
298
+ }
299
+
300
+ /**
301
+ * Find circular dependencies in a set of files
302
+ * @param {Array} filePaths - Array of file paths to analyze
303
+ * @param {Object} options - Analysis options
304
+ * @returns {Array} Array of circular dependency cycles
305
+ */
306
+ function findCircularDependencies(filePaths, options = {}) {
307
+ const dependencyMap = new Map();
308
+ const cycles = [];
309
+
310
+ // Build dependency map for all files
311
+ filePaths.forEach(filePath => {
312
+ const analysis = mapFileDependencies(filePath, options);
313
+ dependencyMap.set(filePath, analysis.internalDependencies.map(dep => dep.resolvedPath).filter(Boolean));
314
+ });
315
+
316
+ // Detect cycles using DFS
317
+ const visited = new Set();
318
+ const recursionStack = new Set();
319
+ const pathStack = [];
320
+
321
+ function dfs(node, currentPath) {
322
+ if (recursionStack.has(node)) {
323
+ // Found a cycle
324
+ const cycleStart = currentPath.indexOf(node);
325
+ if (cycleStart !== -1) {
326
+ cycles.push(currentPath.slice(cycleStart).concat(node));
327
+ }
328
+ return;
329
+ }
330
+
331
+ if (visited.has(node)) {
332
+ return;
333
+ }
334
+
335
+ visited.add(node);
336
+ recursionStack.add(node);
337
+ currentPath.push(node);
338
+
339
+ const dependencies = dependencyMap.get(node) || [];
340
+ dependencies.forEach(dep => {
341
+ if (filePaths.includes(dep)) {
342
+ dfs(dep, [...currentPath]);
343
+ }
344
+ });
345
+
346
+ recursionStack.delete(node);
347
+ currentPath.pop();
348
+ }
349
+
350
+ filePaths.forEach(filePath => {
351
+ if (!visited.has(filePath)) {
352
+ dfs(filePath, []);
353
+ }
354
+ });
355
+
356
+ return cycles;
357
+ }
358
+
359
+ /**
360
+ * Generate dependency report
361
+ * @param {Array} filePaths - Array of file paths to analyze
362
+ * @param {Object} options - Analysis options
363
+ * @returns {Object} Comprehensive dependency report
364
+ */
365
+ function generateDependencyReport(filePaths, options = {}) {
366
+ const report = {
367
+ summary: {
368
+ totalFiles: filePaths.length,
369
+ totalDependencies: 0,
370
+ externalDependencies: 0,
371
+ internalDependencies: 0,
372
+ circularDependencies: 0,
373
+ highComplexityFiles: 0
374
+ },
375
+ files: [],
376
+ circularDependencies: [],
377
+ recommendations: []
378
+ };
379
+
380
+ // Analyze each file
381
+ filePaths.forEach(filePath => {
382
+ const analysis = mapFileDependencies(filePath, options);
383
+ report.files.push(analysis);
384
+
385
+ // Update summary
386
+ report.summary.totalDependencies += analysis.dependencies.length;
387
+ report.summary.externalDependencies += analysis.externalDependencies.length;
388
+ report.summary.internalDependencies += analysis.internalDependencies.length;
389
+
390
+ if (analysis.complexity === 'HIGH') {
391
+ report.summary.highComplexityFiles++;
392
+ }
393
+ });
394
+
395
+ // Find circular dependencies
396
+ report.circularDependencies = findCircularDependencies(filePaths, options);
397
+ report.summary.circularDependencies = report.circularDependencies.length;
398
+
399
+ // Generate recommendations
400
+ report.recommendations = generateDependencyRecommendations(report);
401
+
402
+ return report;
403
+ }
404
+
405
+ /**
406
+ * Generate refactoring recommendations based on dependency analysis
407
+ * @param {Object} report - Dependency report
408
+ * @returns {Array} Array of recommendations
409
+ */
410
+ function generateDependencyRecommendations(report) {
411
+ const recommendations = [];
412
+
413
+ // High complexity files
414
+ if (report.summary.highComplexityFiles > 0) {
415
+ recommendations.push({
416
+ type: 'complexity',
417
+ priority: 'HIGH',
418
+ description: `${report.summary.highComplexityFiles} files have high dependency complexity`,
419
+ action: 'Consider refactoring to reduce coupling'
420
+ });
421
+ }
422
+
423
+ // Circular dependencies
424
+ if (report.summary.circularDependencies > 0) {
425
+ recommendations.push({
426
+ type: 'circular',
427
+ priority: 'HIGH',
428
+ description: `${report.summary.circularDependencies} circular dependency cycles detected`,
429
+ action: 'Resolve circular dependencies before refactoring'
430
+ });
431
+ }
432
+
433
+ // Many external dependencies
434
+ if (report.summary.externalDependencies > report.summary.totalDependencies * 0.7) {
435
+ recommendations.push({
436
+ type: 'external',
437
+ priority: 'MEDIUM',
438
+ description: 'High ratio of external dependencies',
439
+ action: 'Review external dependencies for consolidation'
440
+ });
441
+ }
442
+
443
+ return recommendations;
444
+ }
445
+
446
+ module.exports = {
447
+ mapFileDependencies,
448
+ findCircularDependencies,
449
+ generateDependencyReport,
450
+ extractImports,
451
+ analyzeDependency,
452
+ resolveModulePath,
453
+ isExternalDependency,
454
+ isNodeModule,
455
+ isLocalModule
456
+ };
@@ -2,7 +2,8 @@ const fs = require('fs');
2
2
  const { pipeline } = require('stream');
3
3
  const { promisify } = require('util');
4
4
  const streamPipeline = promisify(pipeline);
5
- const ora = require('ora');
5
+ const oraModule = require('ora');
6
+ const ora = oraModule.default || oraModule;
6
7
 
7
8
  function progressBar(percent, width) {
8
9
  const fill = Math.round((percent / 100) * width);
@@ -18,7 +19,8 @@ function formatEta(sec) {
18
19
  }
19
20
 
20
21
  async function downloadWithProgress(url, dest, opts = {}) {
21
- const fetch = require('node-fetch');
22
+ const fetchModule = require('node-fetch');
23
+ const fetch = fetchModule.default || fetchModule;
22
24
  const spinner = opts.spinner || ora();
23
25
  const label = opts.label || 'Downloading...';
24
26
  const onProgress = typeof opts.onProgress === 'function' ? opts.onProgress : null;
@@ -48,7 +48,10 @@ const { shouldCheckUpdates } = require('./env-helpers');
48
48
  */
49
49
  async function checkForElectronUpdates(currentVersion) {
50
50
  if (!shouldCheckUpdates()) {
51
- console.log('ℹ️ [UPDATE CHECK] Skipped in development environment');
51
+ // Quiet development message - only show in debug mode
52
+ if (process.env.NODE_ENV === 'development' && process.env.DEBUG) {
53
+ console.log('ℹ️ [UPDATE CHECK] Skipped in development environment');
54
+ }
52
55
  return { hasUpdate: false, currentVersion };
53
56
  }
54
57