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.
- package/README.md +240 -0
- package/package.json +10 -2
- package/src/agents/Agent.js +300 -0
- package/src/agents/AgentAdditionService.js +311 -0
- package/src/agents/AgentCheckService.js +690 -0
- package/src/agents/AgentInstallationService.js +140 -0
- package/src/agents/AgentSetupService.js +467 -0
- package/src/agents/AgentStatus.js +183 -0
- package/src/agents/AgentVerificationService.js +634 -0
- package/src/agents/ConfigurationSchemaValidator.js +543 -0
- package/src/agents/EnvironmentConfigurationManager.js +602 -0
- package/src/agents/InstallationErrorHandler.js +372 -0
- package/src/agents/InstallationLog.js +363 -0
- package/src/agents/InstallationMethod.js +510 -0
- package/src/agents/InstallationOrchestrator.js +352 -0
- package/src/agents/InstallationProgressReporter.js +372 -0
- package/src/agents/InstallationRetryManager.js +322 -0
- package/src/agents/InstallationType.js +254 -0
- package/src/agents/OperationTypes.js +310 -0
- package/src/agents/PerformanceMetricsCollector.js +493 -0
- package/src/agents/SecurityValidationService.js +534 -0
- package/src/agents/VerificationTest.js +354 -0
- package/src/agents/VerificationType.js +226 -0
- package/src/agents/WindowsPermissionHandler.js +518 -0
- package/src/agents/config/AgentConfigManager.js +393 -0
- package/src/agents/config/AgentDefaultsRegistry.js +373 -0
- package/src/agents/config/ConfigValidator.js +281 -0
- package/src/agents/discovery/AgentDiscoveryService.js +707 -0
- package/src/agents/logging/AgentLogger.js +511 -0
- package/src/agents/status/AgentStatusManager.js +481 -0
- package/src/agents/storage/FileManager.js +454 -0
- package/src/agents/verification/AgentCommunicationTester.js +474 -0
- package/src/agents/verification/BaseVerifier.js +430 -0
- package/src/agents/verification/CommandVerifier.js +480 -0
- package/src/agents/verification/FileOperationVerifier.js +453 -0
- package/src/agents/verification/ResultAnalyzer.js +707 -0
- package/src/agents/verification/TestRequirementManager.js +495 -0
- package/src/agents/verification/VerificationRunner.js +433 -0
- package/src/agents/windows/BaseWindowsInstaller.js +441 -0
- package/src/agents/windows/ChocolateyInstaller.js +509 -0
- package/src/agents/windows/DirectInstaller.js +443 -0
- package/src/agents/windows/InstallerFactory.js +391 -0
- package/src/agents/windows/NpmInstaller.js +505 -0
- package/src/agents/windows/PowerShellInstaller.js +458 -0
- package/src/agents/windows/WinGetInstaller.js +390 -0
- package/src/analysis/analysis-reporter.js +132 -0
- package/src/analysis/boundary-detector.js +712 -0
- package/src/analysis/categorizer.js +340 -0
- package/src/analysis/codebase-scanner.js +384 -0
- package/src/analysis/line-counter.js +513 -0
- package/src/analysis/priority-calculator.js +679 -0
- package/src/analysis/report/analysis-report.js +250 -0
- package/src/analysis/report/package-analyzer.js +278 -0
- package/src/analysis/report/recommendation-generator.js +382 -0
- package/src/analysis/report/statistics-generator.js +515 -0
- package/src/analysis/reports/analysis-report-model.js +101 -0
- package/src/analysis/reports/recommendation-generator.js +283 -0
- package/src/analysis/reports/report-generators.js +191 -0
- package/src/analysis/reports/statistics-calculator.js +231 -0
- package/src/analysis/reports/trend-analyzer.js +219 -0
- package/src/analysis/strategy-generator.js +814 -0
- package/src/auto-mode/AutoModeBusinessLogic.js +836 -0
- package/src/config/refactoring-config.js +307 -0
- package/src/health-tracking/json-storage.js +38 -2
- package/src/ide-integration/applescript-manager-core.js +233 -0
- package/src/ide-integration/applescript-manager.cjs +357 -28
- package/src/ide-integration/applescript-manager.js +89 -3599
- package/src/ide-integration/cdp-manager.js +306 -0
- package/src/ide-integration/claude-code-cli-manager.cjs +1 -1
- package/src/ide-integration/continuation-handler.js +337 -0
- package/src/ide-integration/ide-status-checker.js +292 -0
- package/src/ide-integration/macos-ide-manager.js +627 -0
- package/src/ide-integration/macos-text-sender.js +528 -0
- package/src/ide-integration/response-reader.js +548 -0
- package/src/ide-integration/windows-automation-manager.js +121 -0
- package/src/ide-integration/windows-ide-manager.js +373 -0
- package/src/index.cjs +25 -3
- package/src/index.js +15 -1
- package/src/llm/direct-llm-manager.cjs +90 -2
- package/src/models/compliance-report.js +538 -0
- package/src/models/file-analysis.js +681 -0
- package/src/models/refactoring-plan.js +770 -0
- package/src/monitoring/alert-system.js +834 -0
- package/src/monitoring/compliance-progress-tracker.js +437 -0
- package/src/monitoring/continuous-scan-notifications.js +661 -0
- package/src/monitoring/continuous-scanner.js +279 -0
- package/src/monitoring/file-monitor/file-analyzer.js +262 -0
- package/src/monitoring/file-monitor/file-monitor.js +237 -0
- package/src/monitoring/file-monitor/watcher.js +194 -0
- package/src/monitoring/file-monitor.js +17 -0
- package/src/monitoring/notification-manager.js +437 -0
- package/src/monitoring/scanner-core.js +368 -0
- package/src/monitoring/scanner-events.js +214 -0
- package/src/monitoring/violation-notification-system.js +515 -0
- package/src/refactoring/boundaries/cohesion-analyzer.js +316 -0
- package/src/refactoring/boundaries/extraction-result.js +285 -0
- package/src/refactoring/boundaries/extraction-strategies.js +392 -0
- package/src/refactoring/boundaries/module-boundary.js +209 -0
- package/src/refactoring/boundary/boundary-detector.js +741 -0
- package/src/refactoring/boundary/boundary-types.js +405 -0
- package/src/refactoring/boundary/extraction-strategies.js +554 -0
- package/src/refactoring/boundary-extraction-result.js +77 -0
- package/src/refactoring/boundary-extraction-strategies.js +330 -0
- package/src/refactoring/boundary-extractor.js +384 -0
- package/src/refactoring/boundary-types.js +46 -0
- package/src/refactoring/circular/circular-dependency.js +88 -0
- package/src/refactoring/circular/cycle-detection.js +147 -0
- package/src/refactoring/circular/dependency-node.js +82 -0
- package/src/refactoring/circular/dependency-result.js +107 -0
- package/src/refactoring/circular/dependency-types.js +58 -0
- package/src/refactoring/circular/graph-builder.js +213 -0
- package/src/refactoring/circular/resolution-strategy.js +72 -0
- package/src/refactoring/circular/strategy-generator.js +229 -0
- package/src/refactoring/circular-dependency-resolver-original.js +809 -0
- package/src/refactoring/circular-dependency-resolver.js +200 -0
- package/src/refactoring/code-mover.js +761 -0
- package/src/refactoring/file-splitter.js +696 -0
- package/src/refactoring/functionality-validator.js +816 -0
- package/src/refactoring/import-manager.js +774 -0
- package/src/refactoring/module-boundary.js +107 -0
- package/src/refactoring/refactoring-executor.js +672 -0
- package/src/refactoring/refactoring-rollback.js +614 -0
- package/src/refactoring/test-validator.js +631 -0
- package/src/requirement-management/default-requirement-manager.js +321 -0
- package/src/requirement-management/requirement-file-parser.js +159 -0
- package/src/requirement-management/requirement-sequencer.js +221 -0
- package/src/rui/commands/AgentCommandParser.js +600 -0
- package/src/rui/commands/AgentCommands.js +487 -0
- package/src/rui/commands/AgentResponseFormatter.js +832 -0
- package/src/scripts/verify-full-compliance.js +269 -0
- package/src/sync/sync-engine-core.js +1 -0
- package/src/sync/sync-engine-remote-handlers.js +135 -0
- package/src/task-generation/automated-task-generator.js +351 -0
- package/src/task-generation/prioritizer.js +287 -0
- package/src/task-generation/task-list-updater.js +215 -0
- package/src/task-generation/task-management-integration.js +480 -0
- package/src/task-generation/task-manager-integration.js +270 -0
- package/src/task-generation/violation-task-generator.js +474 -0
- package/src/task-management/continuous-scan-integration.js +342 -0
- package/src/timeout-management/index.js +12 -3
- package/src/timeout-management/response-time-tracker.js +167 -0
- package/src/timeout-management/timeout-calculator.js +159 -0
- package/src/timeout-management/timeout-config-manager.js +172 -0
- package/src/utils/ast-analyzer.js +417 -0
- package/src/utils/current-requirement-manager.js +276 -0
- package/src/utils/current-requirement-operations.js +472 -0
- package/src/utils/dependency-mapper.js +456 -0
- package/src/utils/download-with-progress.js +4 -2
- package/src/utils/electron-update-checker.js +4 -1
- package/src/utils/file-size-analyzer.js +272 -0
- package/src/utils/import-updater.js +280 -0
- package/src/utils/refactoring-tools.js +512 -0
- package/src/utils/report-generator.js +569 -0
- package/src/utils/reports/report-analysis.js +218 -0
- package/src/utils/reports/report-types.js +55 -0
- package/src/utils/reports/summary-generators.js +102 -0
- package/src/utils/requirement-file-management.js +157 -0
- package/src/utils/requirement-helpers/requirement-file-ops.js +392 -0
- package/src/utils/requirement-helpers/requirement-mover.js +414 -0
- package/src/utils/requirement-helpers/requirement-parser.js +326 -0
- package/src/utils/requirement-helpers/requirement-status.js +320 -0
- package/src/utils/requirement-helpers-new.js +55 -0
- package/src/utils/requirement-helpers-refactored.js +367 -0
- package/src/utils/requirement-helpers.js +291 -1191
- package/src/utils/requirement-movement-operations.js +450 -0
- package/src/utils/requirement-movement.js +312 -0
- package/src/utils/requirement-parsing-helpers.js +56 -0
- package/src/utils/requirement-statistics.js +200 -0
- package/src/utils/requirement-text-utils.js +58 -0
- package/src/utils/rollback/rollback-handlers.js +125 -0
- package/src/utils/rollback/rollback-operation.js +63 -0
- package/src/utils/rollback/rollback-recorder.js +166 -0
- package/src/utils/rollback/rollback-state-manager.js +175 -0
- package/src/utils/rollback/rollback-types.js +33 -0
- package/src/utils/rollback/rollback-utils.js +110 -0
- package/src/utils/rollback-manager-original.js +569 -0
- package/src/utils/rollback-manager.js +202 -0
- package/src/utils/smoke-test-cli.js +362 -0
- package/src/utils/smoke-test-gui.js +351 -0
- package/src/utils/smoke-test-orchestrator.js +321 -0
- package/src/utils/smoke-test-runner.js +60 -0
- package/src/utils/smoke-test-web.js +347 -0
- package/src/utils/specification-helpers.js +39 -13
- package/src/utils/specification-migration.js +97 -0
- package/src/utils/test-runner.js +579 -0
- package/src/utils/validation-framework.js +518 -0
- package/src/validation/compliance-analyzer.js +197 -0
- package/src/validation/compliance-report-generator.js +343 -0
- package/src/validation/compliance-reporter.js +711 -0
- package/src/validation/compliance-rules.js +127 -0
- package/src/validation/constitution-validator-new.js +196 -0
- package/src/validation/constitution-validator.js +17 -0
- package/src/validation/file-validators.js +170 -0
- package/src/validation/line-limit/file-analyzer.js +201 -0
- package/src/validation/line-limit/line-limit-validator.js +208 -0
- package/src/validation/line-limit/validation-result.js +144 -0
- package/src/validation/line-limit-core.js +225 -0
- package/src/validation/line-limit-reporter.js +134 -0
- package/src/validation/line-limit-result.js +125 -0
- package/src/validation/line-limit-validator.js +41 -0
- package/src/validation/metrics-calculator.js +660 -0
- package/src/sync/sync-engine-backup.js +0 -559
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WinGet Installer
|
|
3
|
+
*
|
|
4
|
+
* Windows Package Manager (WinGet) installer implementation.
|
|
5
|
+
* Follows constitutional requirements: <555 lines, test-first approach.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const BaseWindowsInstaller = require('./BaseWindowsInstaller');
|
|
9
|
+
const { InstallationType } = require('../InstallationType');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* WinGet installer class for Windows agents
|
|
13
|
+
*/
|
|
14
|
+
class WinGetInstaller extends BaseWindowsInstaller {
|
|
15
|
+
/**
|
|
16
|
+
* Create WinGet installer instance
|
|
17
|
+
* @param {Object} config - Installer configuration
|
|
18
|
+
*/
|
|
19
|
+
constructor(config = {}) {
|
|
20
|
+
super({
|
|
21
|
+
type: InstallationType.WINGET,
|
|
22
|
+
...config
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Check if WinGet is available on current system
|
|
28
|
+
* @returns {Promise<boolean>} - True if WinGet is available
|
|
29
|
+
*/
|
|
30
|
+
async isAvailable() {
|
|
31
|
+
try {
|
|
32
|
+
const { execSync } = require('child_process');
|
|
33
|
+
execSync('winget --version', { stdio: 'ignore' });
|
|
34
|
+
return true;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (this.logger) {
|
|
37
|
+
await this.logger.debug('WinGet not available', { error: error.message });
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Check system requirements for WinGet
|
|
45
|
+
* @returns {Promise<Object>} - Requirements check result
|
|
46
|
+
*/
|
|
47
|
+
async checkRequirements() {
|
|
48
|
+
const requirements = await super.checkRequirements();
|
|
49
|
+
|
|
50
|
+
// WinGet-specific requirements
|
|
51
|
+
const wingetRequirements = [
|
|
52
|
+
{ requirement: 'windows', met: process.platform === 'win32' },
|
|
53
|
+
{ requirement: 'winget', met: await this.isAvailable() },
|
|
54
|
+
{ requirement: 'windows-10-or-later', met: await this.checkWindowsVersion() }
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
wingetRequirements.forEach(req => {
|
|
58
|
+
requirements.requirements.push(req);
|
|
59
|
+
if (!req.met) {
|
|
60
|
+
requirements.allMet = false;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return requirements;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Check if Windows version is 10 or later
|
|
69
|
+
* @returns {Promise<boolean>} - True if Windows 10 or later
|
|
70
|
+
*/
|
|
71
|
+
async checkWindowsVersion() {
|
|
72
|
+
try {
|
|
73
|
+
const { execSync } = require('child_process');
|
|
74
|
+
const output = execSync('ver', { encoding: 'utf8' });
|
|
75
|
+
|
|
76
|
+
// Parse Windows version from output
|
|
77
|
+
// Format: "Microsoft Windows [Version 10.0.19044]"
|
|
78
|
+
const match = output.match(/Version (\d+)\.(\d+)/);
|
|
79
|
+
if (match) {
|
|
80
|
+
const majorVersion = parseInt(match[1], 10);
|
|
81
|
+
return majorVersion >= 10;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return false;
|
|
85
|
+
} catch (error) {
|
|
86
|
+
if (this.logger) {
|
|
87
|
+
await this.logger.debug('Failed to check Windows version', { error: error.message });
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Perform actual installation using WinGet
|
|
95
|
+
* @param {boolean} force - Force reinstall
|
|
96
|
+
* @param {number} timeout - Timeout in milliseconds
|
|
97
|
+
* @returns {Promise<Object>} - Installation result
|
|
98
|
+
*/
|
|
99
|
+
async performInstallation(force, timeout) {
|
|
100
|
+
const command = this.buildInstallCommand(force);
|
|
101
|
+
|
|
102
|
+
if (this.logger) {
|
|
103
|
+
await this.logger.info('Installing with WinGet', {
|
|
104
|
+
packageId: this.packageId,
|
|
105
|
+
command,
|
|
106
|
+
force
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
const result = await this.executeCommand(command, timeout);
|
|
112
|
+
|
|
113
|
+
if (this.logger) {
|
|
114
|
+
await this.logger.info('WinGet installation completed', {
|
|
115
|
+
packageId: this.packageId,
|
|
116
|
+
success: result.success,
|
|
117
|
+
exitCode: result.exitCode,
|
|
118
|
+
duration: result.duration
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
success: result.success,
|
|
124
|
+
exitCode: result.exitCode,
|
|
125
|
+
stdout: result.stdout,
|
|
126
|
+
stderr: result.stderr,
|
|
127
|
+
duration: result.duration,
|
|
128
|
+
command,
|
|
129
|
+
installer: 'winget'
|
|
130
|
+
};
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (this.logger) {
|
|
133
|
+
await this.logger.error('WinGet installation failed', {
|
|
134
|
+
packageId: this.packageId,
|
|
135
|
+
error: error.message,
|
|
136
|
+
command
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Build WinGet install command
|
|
145
|
+
* @param {boolean} force - Force reinstall
|
|
146
|
+
* @returns {string} - WinGet command
|
|
147
|
+
*/
|
|
148
|
+
buildInstallCommand(force) {
|
|
149
|
+
let command = `winget install ${this.packageId}`;
|
|
150
|
+
|
|
151
|
+
// Add WinGet-specific options
|
|
152
|
+
command += ' --accept-package-agreements --accept-source-agreements';
|
|
153
|
+
|
|
154
|
+
// Add force flag if requested
|
|
155
|
+
if (force) {
|
|
156
|
+
command += ' --force';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Add silent installation
|
|
160
|
+
command += ' --silent';
|
|
161
|
+
|
|
162
|
+
// Add architecture if specified
|
|
163
|
+
if (this.architecture) {
|
|
164
|
+
command += ` --architecture ${this.architecture}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return command;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Perform verification using WinGet
|
|
172
|
+
* @returns {Promise<Object>} - Verification result
|
|
173
|
+
*/
|
|
174
|
+
async performVerification() {
|
|
175
|
+
try {
|
|
176
|
+
// First check if package is installed using WinGet list
|
|
177
|
+
const listCommand = `winget list --id ${this.packageId}`;
|
|
178
|
+
const listResult = await this.executeCommand(listCommand, 30000);
|
|
179
|
+
|
|
180
|
+
if (!listResult.success) {
|
|
181
|
+
return {
|
|
182
|
+
success: false,
|
|
183
|
+
error: 'Package not found in WinGet list',
|
|
184
|
+
exitCode: listResult.exitCode,
|
|
185
|
+
stdout: listResult.stdout,
|
|
186
|
+
stderr: listResult.stderr,
|
|
187
|
+
installer: 'winget'
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Check if package is actually installed
|
|
192
|
+
const isInstalled = listResult.stdout.includes(this.packageId) ||
|
|
193
|
+
listResult.stdout.toLowerCase().includes(this.packageId.toLowerCase());
|
|
194
|
+
|
|
195
|
+
if (!isInstalled) {
|
|
196
|
+
return {
|
|
197
|
+
success: false,
|
|
198
|
+
error: 'Package not properly installed',
|
|
199
|
+
exitCode: 1,
|
|
200
|
+
stdout: listResult.stdout,
|
|
201
|
+
stderr: listResult.stderr,
|
|
202
|
+
installer: 'winget'
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Run verification command if provided
|
|
207
|
+
if (this.verificationCommand) {
|
|
208
|
+
const verifyResult = await this.executeCommand(this.verificationCommand, 30000);
|
|
209
|
+
|
|
210
|
+
return {
|
|
211
|
+
success: verifyResult.success,
|
|
212
|
+
exitCode: verifyResult.exitCode,
|
|
213
|
+
stdout: verifyResult.stdout,
|
|
214
|
+
stderr: verifyResult.stderr,
|
|
215
|
+
installer: 'winget',
|
|
216
|
+
verified: verifyResult.success
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return {
|
|
221
|
+
success: true,
|
|
222
|
+
exitCode: 0,
|
|
223
|
+
stdout: listResult.stdout,
|
|
224
|
+
stderr: '',
|
|
225
|
+
installer: 'winget',
|
|
226
|
+
verified: true
|
|
227
|
+
};
|
|
228
|
+
} catch (error) {
|
|
229
|
+
if (this.logger) {
|
|
230
|
+
await this.logger.error('WinGet verification failed', {
|
|
231
|
+
packageId: this.packageId,
|
|
232
|
+
error: error.message
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
throw error;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Get installed version using WinGet
|
|
241
|
+
* @returns {Promise<string|null>} - Version string or null
|
|
242
|
+
*/
|
|
243
|
+
async getInstalledVersion() {
|
|
244
|
+
try {
|
|
245
|
+
const command = `winget show --id ${this.packageId}`;
|
|
246
|
+
const result = await this.executeCommand(command, 30000);
|
|
247
|
+
|
|
248
|
+
if (result.success) {
|
|
249
|
+
// Parse version from output
|
|
250
|
+
const lines = result.stdout.split('\n');
|
|
251
|
+
const versionLine = lines.find(line =>
|
|
252
|
+
line.toLowerCase().includes('version') ||
|
|
253
|
+
line.toLowerCase().includes('version')
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
if (versionLine) {
|
|
257
|
+
const match = versionLine.match(/(\d+\.\d+\.\d+)/);
|
|
258
|
+
return match ? match[1] : null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return null;
|
|
263
|
+
} catch (error) {
|
|
264
|
+
if (this.logger) {
|
|
265
|
+
await this.logger.debug('Failed to get installed version', {
|
|
266
|
+
packageId: this.packageId,
|
|
267
|
+
error: error.message
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Uninstall package using WinGet
|
|
276
|
+
* @returns {Promise<Object>} - Uninstallation result
|
|
277
|
+
*/
|
|
278
|
+
async uninstall() {
|
|
279
|
+
try {
|
|
280
|
+
const command = `winget uninstall ${this.packageId} --silent`;
|
|
281
|
+
|
|
282
|
+
if (this.logger) {
|
|
283
|
+
await this.logger.info('Uninstalling with WinGet', {
|
|
284
|
+
packageId: this.packageId,
|
|
285
|
+
command
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const result = await this.executeCommand(command, 300000); // 5 minute timeout
|
|
290
|
+
|
|
291
|
+
if (this.logger) {
|
|
292
|
+
await this.logger.info('WinGet uninstallation completed', {
|
|
293
|
+
packageId: this.packageId,
|
|
294
|
+
success: result.success,
|
|
295
|
+
exitCode: result.exitCode,
|
|
296
|
+
duration: result.duration
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return {
|
|
301
|
+
success: result.success,
|
|
302
|
+
exitCode: result.exitCode,
|
|
303
|
+
stdout: result.stdout,
|
|
304
|
+
stderr: result.stderr,
|
|
305
|
+
duration: result.duration,
|
|
306
|
+
installer: 'winget'
|
|
307
|
+
};
|
|
308
|
+
} catch (error) {
|
|
309
|
+
if (this.logger) {
|
|
310
|
+
await this.logger.error('WinGet uninstallation failed', {
|
|
311
|
+
packageId: this.packageId,
|
|
312
|
+
error: error.message
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
throw error;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Update package using WinGet
|
|
321
|
+
* @returns {Promise<Object>} - Update result
|
|
322
|
+
*/
|
|
323
|
+
async update() {
|
|
324
|
+
try {
|
|
325
|
+
const command = `winget upgrade ${this.packageId} --silent`;
|
|
326
|
+
|
|
327
|
+
if (this.logger) {
|
|
328
|
+
await this.logger.info('Updating with WinGet', {
|
|
329
|
+
packageId: this.packageId,
|
|
330
|
+
command
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const result = await this.executeCommand(command, 300000); // 5 minute timeout
|
|
335
|
+
|
|
336
|
+
if (this.logger) {
|
|
337
|
+
await this.logger.info('WinGet update completed', {
|
|
338
|
+
packageId: this.packageId,
|
|
339
|
+
success: result.success,
|
|
340
|
+
exitCode: result.exitCode,
|
|
341
|
+
duration: result.duration
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
success: result.success,
|
|
347
|
+
exitCode: result.exitCode,
|
|
348
|
+
stdout: result.stdout,
|
|
349
|
+
stderr: result.stderr,
|
|
350
|
+
duration: result.duration,
|
|
351
|
+
installer: 'winget'
|
|
352
|
+
};
|
|
353
|
+
} catch (error) {
|
|
354
|
+
if (this.logger) {
|
|
355
|
+
await this.logger.error('WinGet update failed', {
|
|
356
|
+
packageId: this.packageId,
|
|
357
|
+
error: error.message
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
throw error;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Get WinGet-specific information
|
|
366
|
+
* @returns {Object} - WinGet installer info
|
|
367
|
+
*/
|
|
368
|
+
getInstallerInfo() {
|
|
369
|
+
return {
|
|
370
|
+
...this.getInfo(),
|
|
371
|
+
installer: 'winget',
|
|
372
|
+
supportedPlatforms: ['win32'],
|
|
373
|
+
minimumWindowsVersion: '10.0',
|
|
374
|
+
supportedArchitectures: ['x64', 'arm64'],
|
|
375
|
+
features: [
|
|
376
|
+
'automatic updates',
|
|
377
|
+
'dependency resolution',
|
|
378
|
+
'silent installation',
|
|
379
|
+
'version management'
|
|
380
|
+
],
|
|
381
|
+
limitations: [
|
|
382
|
+
'Windows 10+ only',
|
|
383
|
+
'requires WinGet installation',
|
|
384
|
+
'limited package repository'
|
|
385
|
+
]
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
module.exports = WinGetInstaller;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis Reporter
|
|
3
|
+
*
|
|
4
|
+
* Generates comprehensive analysis reports with refactoring recommendations.
|
|
5
|
+
* Integrates multiple analysis components into actionable insights.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { ReportGenerator } = require('../utils/report-generator');
|
|
11
|
+
const RefactoringConfig = require('../config/refactoring-config');
|
|
12
|
+
|
|
13
|
+
// Import modular components
|
|
14
|
+
const AnalysisReport = require('./report/analysis-report');
|
|
15
|
+
const PackageAnalyzer = require('./report/package-analyzer');
|
|
16
|
+
const RecommendationGenerator = require('./report/recommendation-generator');
|
|
17
|
+
const StatisticsGenerator = require('./report/statistics-generator');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Analysis reporter class
|
|
21
|
+
*/
|
|
22
|
+
class AnalysisReporter {
|
|
23
|
+
constructor(config = RefactoringConfig) {
|
|
24
|
+
this.config = config;
|
|
25
|
+
this.reportGenerator = new ReportGenerator(config);
|
|
26
|
+
this.report = new AnalysisReport();
|
|
27
|
+
this.packageAnalyzer = new PackageAnalyzer();
|
|
28
|
+
this.recommendationGenerator = new RecommendationGenerator();
|
|
29
|
+
this.statisticsGenerator = new StatisticsGenerator();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Generate comprehensive analysis report
|
|
34
|
+
*/
|
|
35
|
+
async generateReport(analysisData, options = {}) {
|
|
36
|
+
console.log('Generating comprehensive analysis report...');
|
|
37
|
+
|
|
38
|
+
// Initialize report with metadata
|
|
39
|
+
this.report.metadata.analysisScope = options.scope || 'full_codebase';
|
|
40
|
+
this.report.metadata.targetPackages = options.packages || [];
|
|
41
|
+
|
|
42
|
+
// Process file analyses
|
|
43
|
+
for (const fileAnalysis of analysisData.files || []) {
|
|
44
|
+
this.report.addFileAnalysis(fileAnalysis);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Generate package analysis
|
|
48
|
+
const packageAnalysis = this.packageAnalyzer.analyzePackages(analysisData.files || []);
|
|
49
|
+
for (const [packageName, analysis] of Object.entries(packageAnalysis)) {
|
|
50
|
+
this.report.addPackageAnalysis(packageName, analysis);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Generate statistics
|
|
54
|
+
const statistics = this.statisticsGenerator.generateStatistics(analysisData);
|
|
55
|
+
this.report.addStatistics(statistics);
|
|
56
|
+
|
|
57
|
+
// Generate recommendations
|
|
58
|
+
const recommendations = this.recommendationGenerator.generateRecommendations(analysisData);
|
|
59
|
+
for (const recommendation of recommendations) {
|
|
60
|
+
this.report.addRecommendation(recommendation);
|
|
61
|
+
recommendations.forEach(rec => this.report.addRecommendation(rec.title));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Generate reports in requested formats
|
|
65
|
+
const results = {};
|
|
66
|
+
for (const format of this.options.formats) {
|
|
67
|
+
const generator = this.getGenerator(format);
|
|
68
|
+
if (generator) {
|
|
69
|
+
const outputPath = this.options.outputPath ?
|
|
70
|
+
this.getOutputPath(this.options.outputPath, format) : null;
|
|
71
|
+
results[format] = generator.generate(outputPath);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
success: true,
|
|
77
|
+
report: this.report,
|
|
78
|
+
generatedFiles: results,
|
|
79
|
+
summary: this.report.summary
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Get report generator for specified format
|
|
85
|
+
*/
|
|
86
|
+
getGenerator(format) {
|
|
87
|
+
switch (format.toLowerCase()) {
|
|
88
|
+
case 'json':
|
|
89
|
+
return new JSONReportGenerator(this.report);
|
|
90
|
+
case 'html':
|
|
91
|
+
return new HTMLReportGenerator(this.report);
|
|
92
|
+
case 'csv':
|
|
93
|
+
return new CSVReportGenerator(this.report);
|
|
94
|
+
default:
|
|
95
|
+
console.warn(`Unsupported format: ${format}`);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Get output path for specific format
|
|
102
|
+
*/
|
|
103
|
+
getOutputPath(basePath, format) {
|
|
104
|
+
const extension = format.toLowerCase();
|
|
105
|
+
return basePath.endsWith(`.${extension}`) ? basePath : `${basePath}.${extension}`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Generate quick summary (for CLI usage)
|
|
110
|
+
*/
|
|
111
|
+
generateSummary() {
|
|
112
|
+
return {
|
|
113
|
+
totalFiles: this.report.summary.totalFiles,
|
|
114
|
+
filesNeedingRefactoring: this.report.summary.filesNeedingRefactoring,
|
|
115
|
+
complianceRate: this.report.summary.complianceRate,
|
|
116
|
+
urgentFiles: this.report.summary.urgentRefactoring,
|
|
117
|
+
estimatedEffort: this.statisticsCalculator.calculateTotalEffort()
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Export report data
|
|
123
|
+
*/
|
|
124
|
+
exportData() {
|
|
125
|
+
return this.report.toJSON();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
module.exports = {
|
|
130
|
+
AnalysisReporter,
|
|
131
|
+
AnalysisReport
|
|
132
|
+
};
|