vibecodingmachine-core 2026.2.26-1739 → 2026.3.9-850
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/package.json +1 -1
- package/src/agents/AgentCheckDiscoveryService.js +180 -0
- package/src/agents/AgentCheckService.js +18 -261
- package/src/agents/AgentCheckStatisticsService.js +195 -0
- package/src/agents/EnvironmentConfigurationManager.js +31 -380
- package/src/agents/InstallationType.js +19 -6
- package/src/agents/SimpleAgentCheckService.js +472 -0
- package/src/agents/config-managers/ConfigUtils.js +72 -0
- package/src/agents/config-managers/DefaultConfig.js +58 -0
- package/src/agents/config-managers/EnvVarLoader.js +66 -0
- package/src/agents/config-managers/FileConfigLoader.js +124 -0
- package/src/agents/config-managers/TypeConverters.js +61 -0
- package/src/agents/config-managers/VariableMappings.js +92 -0
- package/src/agents/discovery/AgentDiscoveryService-refactored.js +272 -0
- package/src/agents/discovery/AgentDiscoveryService.js +29 -403
- package/src/agents/discovery/agent-validator.js +262 -0
- package/src/agents/discovery/discovery-results.js +176 -0
- package/src/agents/discovery/discovery-scanner.js +268 -0
- package/src/agents/discovery/discovery-utils.js +161 -0
- package/src/agents/discovery/executable-analyzer.js +290 -0
- package/src/agents/discovery/history-manager.js +310 -0
- package/src/agents/verification/ResultAnalyzer-refactored.js +341 -0
- package/src/agents/verification/ResultAnalyzer.js +30 -431
- package/src/agents/verification/analysis-utils.js +310 -0
- package/src/agents/verification/batch-analyzer.js +440 -0
- package/src/agents/verification/pattern-recognizer.js +369 -0
- package/src/agents/verification/report-generator.js +320 -0
- package/src/agents/verification/test-analyzer.js +290 -0
- package/src/agents/windows/InstallerFactory.js +4 -0
- package/src/agents/windows/VSCodeExtensionInstaller.js +404 -0
- package/src/analysis/analysis-engine.js +314 -0
- package/src/analysis/ast-analyzer.js +342 -0
- package/src/analysis/boundary-detector-refactored.js +378 -0
- package/src/analysis/boundary-detector.js +200 -603
- package/src/analysis/boundary-scanner.js +609 -0
- package/src/analysis/boundary-types.js +118 -0
- package/src/analysis/boundary-utils.js +293 -0
- package/src/analysis/deadline-priority-calculator.js +18 -0
- package/src/analysis/detection-methods.js +347 -0
- package/src/analysis/importance-priority-calculator.js +18 -0
- package/src/analysis/priority/factor-calculators.js +204 -0
- package/src/analysis/priority/factor-helpers.js +71 -0
- package/src/analysis/priority/priority-constants.js +73 -0
- package/src/analysis/priority/priority-factor-calculators.js +301 -0
- package/src/analysis/priority/reasons-generator.js +44 -0
- package/src/analysis/priority-calculator.js +15 -580
- package/src/analysis/strategy-generator.js +16 -66
- package/src/analysis/type-priority-calculator.js +18 -0
- package/src/analysis/urgency-priority-calculator.js +18 -0
- package/src/auto-mode/AutoModeBusinessLogic.js +2 -40
- package/src/commands/disable-requirement.js +60 -0
- package/src/commands/disable-spec.js +60 -0
- package/src/commands/enable-requirement.js +60 -0
- package/src/commands/enable-spec.js +60 -0
- package/src/commands/registry.js +1 -6
- package/src/commands/requirements.js +8 -2
- package/src/ide-integration/applescript-manager.cjs +9 -24
- package/src/ide-integration/cdp-handlers/chat-reader.js +44 -0
- package/src/ide-integration/cdp-handlers/connection-handler.js +88 -0
- package/src/ide-integration/cdp-handlers/continuation-handler.js +314 -0
- package/src/ide-integration/cdp-handlers/message-submitter.js +75 -0
- package/src/ide-integration/cdp-handlers/text-sender.js +138 -0
- package/src/ide-integration/cdp-manager.js +28 -573
- package/src/ide-integration/claude-code-cli-manager.cjs +48 -12
- package/src/ide-integration/ide-openers/claude-opener.js +171 -0
- package/src/ide-integration/ide-openers/cursor-opener.js +53 -0
- package/src/ide-integration/ide-openers/other-ides-opener.js +230 -0
- package/src/ide-integration/ide-openers/vscode-opener.js +147 -0
- package/src/ide-integration/macos-ide-manager.js +20 -582
- package/src/ide-integration/macos-quota-checker.js +164 -0
- package/src/ide-integration/macos-text-sender.js +19 -38
- package/src/ide-integration/provider-manager.cjs +52 -7
- package/src/index.cjs +6 -0
- package/src/index.js +10 -0
- package/src/llm/direct-llm-manager.cjs +501 -0
- package/src/localization/translations/en-part1.js +363 -0
- package/src/localization/translations/en-part2.js +320 -0
- package/src/localization/translations/en.js +4 -687
- package/src/localization/translations/es-part1.js +363 -0
- package/src/localization/translations/es-part2.js +320 -0
- package/src/localization/translations/es.js +4 -688
- package/src/models/file-analysis-collection.js +139 -0
- package/src/models/file-analysis-metrics.js +50 -0
- package/src/models/file-analysis.js +15 -262
- package/src/models/plan-manager.js +410 -0
- package/src/models/refactoring-models.js +380 -0
- package/src/models/refactoring-plan-refactored.js +81 -0
- package/src/models/refactoring-plan.js +2 -663
- package/src/monitoring/alert-system.js +4 -45
- package/src/monitoring/continuous-scan-notifications.js +37 -191
- package/src/monitoring/notification-handlers/base-handler.js +58 -0
- package/src/monitoring/notification-handlers/error-handler.js +36 -0
- package/src/monitoring/notification-handlers/index.js +21 -0
- package/src/monitoring/notification-handlers/new-violation-handler.js +91 -0
- package/src/monitoring/notification-handlers/progress-handler.js +48 -0
- package/src/monitoring/notification-handlers/resolved-violation-handler.js +54 -0
- package/src/monitoring/notification-handlers/threshold-handler.js +36 -0
- package/src/provider-registry.js +8 -0
- package/src/refactoring/boundary/boundary-detector-refactored.js +58 -0
- package/src/refactoring/boundary/boundary-detector.js +26 -596
- package/src/refactoring/boundary/detectors/boundary-analyzers.js +281 -0
- package/src/refactoring/boundary/detectors/boundary-core.js +167 -0
- package/src/refactoring/boundary/detectors/class-detector.js +247 -0
- package/src/refactoring/boundary/detectors/config-detector.js +270 -0
- package/src/refactoring/boundary/detectors/constant-detector.js +269 -0
- package/src/refactoring/boundary/detectors/function-detector.js +248 -0
- package/src/refactoring/boundary/detectors/module-detector.js +249 -0
- package/src/refactoring/boundary/detectors/object-detector.js +247 -0
- package/src/refactoring/boundary/detectors/type-detectors.js +338 -0
- package/src/refactoring/boundary/detectors/utility-detector.js +270 -0
- package/src/refactoring/circular-dependency-resolver-original.js +16 -76
- package/src/refactoring/code-mover-refactored.js +309 -0
- package/src/refactoring/code-mover.js +48 -355
- package/src/refactoring/execution-status.js +18 -0
- package/src/refactoring/execution-strategies.js +172 -0
- package/src/refactoring/file-splitter-core.js +568 -0
- package/src/refactoring/file-splitter-types.js +136 -0
- package/src/refactoring/file-splitter.js +2 -682
- package/src/refactoring/functionality-validator.js +11 -51
- package/src/refactoring/import-manager-refactored.js +385 -0
- package/src/refactoring/import-manager.js +112 -487
- package/src/refactoring/import-models.js +189 -0
- package/src/refactoring/import-parser.js +306 -0
- package/src/refactoring/move-executor.js +431 -0
- package/src/refactoring/move-utils.js +368 -0
- package/src/refactoring/operation-executor.js +76 -0
- package/src/refactoring/plan-creator.js +36 -0
- package/src/refactoring/plan-executor.js +143 -0
- package/src/refactoring/plan-validator.js +68 -0
- package/src/refactoring/refactoring-executor-result.js +70 -0
- package/src/refactoring/refactoring-executor.js +34 -569
- package/src/refactoring/refactoring-operation.js +94 -0
- package/src/refactoring/refactoring-plan.js +69 -0
- package/src/refactoring/refactoring-rollback.js +22 -527
- package/src/refactoring/rollback-handlers/RollbackExecutor.js +107 -0
- package/src/refactoring/rollback-handlers/RollbackManager.js +265 -0
- package/src/refactoring/rollback-handlers/RollbackOperation.js +105 -0
- package/src/refactoring/rollback-handlers/RollbackResult.js +109 -0
- package/src/refactoring/rollback-handlers/RollbackStatistics.js +77 -0
- package/src/refactoring/test-validator.js +32 -448
- package/src/refactoring/validation/baseline-runner.js +71 -0
- package/src/refactoring/validation/report-generator.js +136 -0
- package/src/refactoring/validation/result-comparator.js +92 -0
- package/src/refactoring/validation/test-suite.js +59 -0
- package/src/refactoring/validation/test-validation-result.js +83 -0
- package/src/refactoring/validation/validation-runner.js +95 -0
- package/src/refactoring/validation/validation-status.js +18 -0
- package/src/rui/commands/AgentCommandParser.js +60 -369
- package/src/rui/commands/AgentResponseFormatter.js +7 -47
- package/src/rui/commands/parsers/CommandMapper.js +148 -0
- package/src/rui/commands/parsers/CommandValidator.js +228 -0
- package/src/rui/commands/parsers/ComponentExtractor.js +100 -0
- package/src/rui/commands/parsers/TokenParser.js +69 -0
- package/src/rui/commands/parsers/tokenizer.js +153 -0
- package/src/utils/current-requirement-operations.js +50 -1
- package/src/utils/report-generator.js +18 -514
- package/src/utils/report-generators/analysis-generator.js +115 -0
- package/src/utils/report-generators/base-generator.js +141 -0
- package/src/utils/report-generators/compliance-generator.js +41 -0
- package/src/utils/report-generators/format-handlers.js +185 -0
- package/src/utils/report-generators/refactoring-generator.js +46 -0
- package/src/utils/report-generators/validation-generator.js +63 -0
- package/src/utils/requirement-enable-disable.js +265 -0
- package/src/utils/requirement-helpers/requirement-file-ops.js +69 -1
- package/src/utils/requirement-helpers/requirement-mover.js +88 -1
- package/src/utils/requirement-helpers.js +5 -2
- package/src/utils/smoke-test-cli.js +45 -8
- package/src/utils/specification-enable-disable.js +122 -0
- package/src/utils/specification-helpers.js +30 -4
- package/src/utils/specification-migration.js +5 -5
- package/src/utils/test-comparator.js +118 -0
- package/src/utils/test-config.js +54 -0
- package/src/utils/test-executor.js +133 -0
- package/src/utils/test-parser.js +215 -0
- package/src/utils/test-runner-baseline.js +63 -0
- package/src/utils/test-runner-core.js +98 -0
- package/src/utils/test-runner-report.js +39 -0
- package/src/utils/test-runner-validation.js +71 -0
- package/src/utils/test-runner.js +11 -535
- package/src/validation/comparison-analyzer.js +333 -0
- package/src/validation/compliance-reporter-new.js +282 -0
- package/src/validation/compliance-reporter-refactored.js +344 -0
- package/src/validation/compliance-reporter.js +278 -591
- package/src/validation/compliance-utils.js +278 -0
- package/src/validation/html-generator.js +446 -0
- package/src/validation/metrics/category-calculator.js +137 -0
- package/src/validation/metrics/metrics-helpers.js +155 -0
- package/src/validation/metrics/overview-calculator.js +85 -0
- package/src/validation/metrics/overview-metrics.js +41 -0
- package/src/validation/metrics/quality-calculator.js +166 -0
- package/src/validation/metrics/size-calculator.js +69 -0
- package/src/validation/metrics-calculator.js +27 -551
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refactoring Plan Models
|
|
3
|
+
*
|
|
4
|
+
* Data models for refactoring operations and plans.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Refactoring operation class
|
|
9
|
+
*/
|
|
10
|
+
class RefactoringOperation {
|
|
11
|
+
constructor(type, targetPath, options = {}) {
|
|
12
|
+
this.id = this.generateId();
|
|
13
|
+
this.type = type;
|
|
14
|
+
this.targetPath = targetPath;
|
|
15
|
+
this.options = options;
|
|
16
|
+
this.status = 'pending';
|
|
17
|
+
this.priority = 'medium';
|
|
18
|
+
this.estimatedEffort = 0;
|
|
19
|
+
this.riskLevel = 'medium';
|
|
20
|
+
this.dependencies = [];
|
|
21
|
+
this.outputs = [];
|
|
22
|
+
this.steps = [];
|
|
23
|
+
this.metadata = {
|
|
24
|
+
createdAt: new Date().toISOString(),
|
|
25
|
+
updatedAt: new Date().toISOString(),
|
|
26
|
+
version: '1.0.0'
|
|
27
|
+
};
|
|
28
|
+
this.results = null;
|
|
29
|
+
this.errors = [];
|
|
30
|
+
this.warnings = [];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
generateId() {
|
|
34
|
+
return `op_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
generateStepId() {
|
|
38
|
+
return `step_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
addStep(step) {
|
|
42
|
+
this.steps.push({
|
|
43
|
+
...step,
|
|
44
|
+
id: this.generateStepId(),
|
|
45
|
+
status: 'pending',
|
|
46
|
+
createdAt: new Date().toISOString()
|
|
47
|
+
});
|
|
48
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
updateStatus(status) {
|
|
52
|
+
this.status = status;
|
|
53
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
addError(error) {
|
|
57
|
+
this.errors.push({
|
|
58
|
+
message: error.message,
|
|
59
|
+
timestamp: new Date().toISOString(),
|
|
60
|
+
stack: error.stack
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
addWarning(warning) {
|
|
65
|
+
this.warnings.push({
|
|
66
|
+
message: warning,
|
|
67
|
+
timestamp: new Date().toISOString()
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
setResults(results) {
|
|
72
|
+
this.results = results;
|
|
73
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
getSummary() {
|
|
77
|
+
return {
|
|
78
|
+
id: this.id,
|
|
79
|
+
type: this.type,
|
|
80
|
+
status: this.status,
|
|
81
|
+
priority: this.priority,
|
|
82
|
+
stepsCount: this.steps.length,
|
|
83
|
+
errorsCount: this.errors.length,
|
|
84
|
+
warningsCount: this.warnings.length,
|
|
85
|
+
estimatedEffort: this.estimatedEffort,
|
|
86
|
+
riskLevel: this.riskLevel
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
toJSON() {
|
|
91
|
+
return {
|
|
92
|
+
id: this.id,
|
|
93
|
+
type: this.type,
|
|
94
|
+
targetPath: this.targetPath,
|
|
95
|
+
options: this.options,
|
|
96
|
+
status: this.status,
|
|
97
|
+
priority: this.priority,
|
|
98
|
+
estimatedEffort: this.estimatedEffort,
|
|
99
|
+
riskLevel: this.riskLevel,
|
|
100
|
+
dependencies: this.dependencies,
|
|
101
|
+
outputs: this.outputs,
|
|
102
|
+
steps: this.steps,
|
|
103
|
+
metadata: this.metadata,
|
|
104
|
+
results: this.results,
|
|
105
|
+
errors: this.errors,
|
|
106
|
+
warnings: this.warnings
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Refactoring step class
|
|
113
|
+
*/
|
|
114
|
+
class RefactoringStep {
|
|
115
|
+
constructor(name, type, options = {}) {
|
|
116
|
+
this.id = this.generateId();
|
|
117
|
+
this.name = name;
|
|
118
|
+
this.type = type;
|
|
119
|
+
this.options = options;
|
|
120
|
+
this.status = 'pending';
|
|
121
|
+
this.progress = 0;
|
|
122
|
+
this.startTime = null;
|
|
123
|
+
this.endTime = null;
|
|
124
|
+
this.duration = 0;
|
|
125
|
+
this.dependencies = [];
|
|
126
|
+
this.outputs = [];
|
|
127
|
+
this.metadata = {
|
|
128
|
+
createdAt: new Date().toISOString(),
|
|
129
|
+
updatedAt: new Date().toISOString()
|
|
130
|
+
};
|
|
131
|
+
this.results = null;
|
|
132
|
+
this.errors = [];
|
|
133
|
+
this.warnings = [];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
generateId() {
|
|
137
|
+
return `step_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
start() {
|
|
141
|
+
this.startTime = new Date().toISOString();
|
|
142
|
+
this.status = 'in_progress';
|
|
143
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
complete(results) {
|
|
147
|
+
this.endTime = new Date().toISOString();
|
|
148
|
+
this.status = 'completed';
|
|
149
|
+
this.progress = 100;
|
|
150
|
+
this.duration = this.calculateDuration();
|
|
151
|
+
this.results = results;
|
|
152
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
fail(error) {
|
|
156
|
+
this.endTime = new Date().toISOString();
|
|
157
|
+
this.status = 'failed';
|
|
158
|
+
this.errors.push({
|
|
159
|
+
message: error.message,
|
|
160
|
+
timestamp: new Date().toISOString(),
|
|
161
|
+
stack: error.stack
|
|
162
|
+
});
|
|
163
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
calculateDuration() {
|
|
167
|
+
if (!this.startTime || !this.endTime) return 0;
|
|
168
|
+
|
|
169
|
+
const start = new Date(this.startTime);
|
|
170
|
+
const end = new Date(this.endTime);
|
|
171
|
+
return end - start;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
updateProgress(progress) {
|
|
175
|
+
this.progress = Math.max(0, Math.min(100, progress));
|
|
176
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
addWarning(warning) {
|
|
180
|
+
this.warnings.push({
|
|
181
|
+
message: warning,
|
|
182
|
+
timestamp: new Date().toISOString()
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
getSummary() {
|
|
187
|
+
return {
|
|
188
|
+
id: this.id,
|
|
189
|
+
name: this.name,
|
|
190
|
+
type: this.type,
|
|
191
|
+
status: this.status,
|
|
192
|
+
progress: this.progress,
|
|
193
|
+
duration: this.duration,
|
|
194
|
+
errorsCount: this.errors.length,
|
|
195
|
+
warningsCount: this.warnings.length
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Refactoring plan class
|
|
202
|
+
*/
|
|
203
|
+
class RefactoringPlan {
|
|
204
|
+
constructor(name, description = '') {
|
|
205
|
+
this.id = this.generateId();
|
|
206
|
+
this.name = name;
|
|
207
|
+
this.description = description;
|
|
208
|
+
this.operations = [];
|
|
209
|
+
this.metadata = {
|
|
210
|
+
createdAt: new Date().toISOString(),
|
|
211
|
+
updatedAt: new Date().toISOString(),
|
|
212
|
+
version: '1.0.0',
|
|
213
|
+
author: null
|
|
214
|
+
};
|
|
215
|
+
this.status = 'draft';
|
|
216
|
+
this.priority = 'medium';
|
|
217
|
+
this.estimatedTotalEffort = 0;
|
|
218
|
+
this.riskLevel = 'medium';
|
|
219
|
+
this.tags = [];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
generateId() {
|
|
223
|
+
return `plan_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
addOperation(operation) {
|
|
227
|
+
this.operations.push(operation);
|
|
228
|
+
this.updateMetadata();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
removeOperation(operationId) {
|
|
232
|
+
this.operations = this.operations.filter(op => op.id !== operationId);
|
|
233
|
+
this.updateMetadata();
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
getOperation(operationId) {
|
|
237
|
+
return this.operations.find(op => op.id === operationId);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
updateStatus(status) {
|
|
241
|
+
this.status = status;
|
|
242
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
setPriority(priority) {
|
|
246
|
+
this.priority = priority;
|
|
247
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
addTag(tag) {
|
|
251
|
+
if (!this.tags.includes(tag)) {
|
|
252
|
+
this.tags.push(tag);
|
|
253
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
removeTag(tag) {
|
|
258
|
+
this.tags = this.tags.filter(t => t !== tag);
|
|
259
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
updateMetadata() {
|
|
263
|
+
this.estimatedTotalEffort = this.operations.reduce((sum, op) => sum + op.estimatedEffort, 0);
|
|
264
|
+
|
|
265
|
+
const riskLevels = this.operations.map(op => op.riskLevel);
|
|
266
|
+
if (riskLevels.includes('high')) {
|
|
267
|
+
this.riskLevel = 'high';
|
|
268
|
+
} else if (riskLevels.includes('medium')) {
|
|
269
|
+
this.riskLevel = 'medium';
|
|
270
|
+
} else {
|
|
271
|
+
this.riskLevel = 'low';
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
this.metadata.updatedAt = new Date().toISOString();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
getSummary() {
|
|
278
|
+
return {
|
|
279
|
+
id: this.id,
|
|
280
|
+
name: this.name,
|
|
281
|
+
status: this.status,
|
|
282
|
+
priority: this.priority,
|
|
283
|
+
operationsCount: this.operations.length,
|
|
284
|
+
estimatedTotalEffort: this.estimatedTotalEffort,
|
|
285
|
+
riskLevel: this.riskLevel,
|
|
286
|
+
tags: this.tags
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
toJSON() {
|
|
291
|
+
return {
|
|
292
|
+
id: this.id,
|
|
293
|
+
name: this.name,
|
|
294
|
+
description: this.description,
|
|
295
|
+
operations: this.operations.map(op => op.toJSON()),
|
|
296
|
+
metadata: this.metadata,
|
|
297
|
+
status: this.status,
|
|
298
|
+
priority: this.priority,
|
|
299
|
+
estimatedTotalEffort: this.estimatedTotalEffort,
|
|
300
|
+
riskLevel: this.riskLevel,
|
|
301
|
+
tags: this.tags
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Refactoring result class
|
|
308
|
+
*/
|
|
309
|
+
class RefactoringResult {
|
|
310
|
+
constructor(operationId) {
|
|
311
|
+
this.operationId = operationId;
|
|
312
|
+
this.success = false;
|
|
313
|
+
this.startTime = new Date().toISOString();
|
|
314
|
+
this.endTime = null;
|
|
315
|
+
this.duration = 0;
|
|
316
|
+
this.outputs = [];
|
|
317
|
+
this.metrics = {
|
|
318
|
+
filesModified: 0,
|
|
319
|
+
linesChanged: 0,
|
|
320
|
+
errorsFixed: 0,
|
|
321
|
+
warningsGenerated: 0
|
|
322
|
+
};
|
|
323
|
+
this.errors = [];
|
|
324
|
+
this.warnings = [];
|
|
325
|
+
this.metadata = {
|
|
326
|
+
version: '1.0.0'
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
complete(outputs, metrics = {}) {
|
|
331
|
+
this.endTime = new Date().toISOString();
|
|
332
|
+
this.success = true;
|
|
333
|
+
this.duration = this.calculateDuration();
|
|
334
|
+
this.outputs = outputs;
|
|
335
|
+
this.metrics = { ...this.metrics, ...metrics };
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
fail(error) {
|
|
339
|
+
this.endTime = new Date().toISOString();
|
|
340
|
+
this.success = false;
|
|
341
|
+
this.duration = this.calculateDuration();
|
|
342
|
+
this.errors.push({
|
|
343
|
+
message: error.message,
|
|
344
|
+
timestamp: new Date().toISOString(),
|
|
345
|
+
stack: error.stack
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
calculateDuration() {
|
|
350
|
+
const start = new Date(this.startTime);
|
|
351
|
+
const end = this.endTime ? new Date(this.endTime) : new Date();
|
|
352
|
+
return end - start;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
addWarning(warning) {
|
|
356
|
+
this.warnings.push({
|
|
357
|
+
message: warning,
|
|
358
|
+
timestamp: new Date().toISOString()
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
getSummary() {
|
|
363
|
+
return {
|
|
364
|
+
operationId: this.operationId,
|
|
365
|
+
success: this.success,
|
|
366
|
+
duration: this.duration,
|
|
367
|
+
outputsCount: this.outputs.length,
|
|
368
|
+
metrics: this.metrics,
|
|
369
|
+
errorsCount: this.errors.length,
|
|
370
|
+
warningsCount: this.warnings.length
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
module.exports = {
|
|
376
|
+
RefactoringOperation,
|
|
377
|
+
RefactoringStep,
|
|
378
|
+
RefactoringPlan,
|
|
379
|
+
RefactoringResult
|
|
380
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refactoring Plan Data Model
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive data model for refactoring plans and strategies.
|
|
5
|
+
* Provides structure for storing and managing refactoring operations.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { PlanManager } = require('./plan-manager');
|
|
9
|
+
const {
|
|
10
|
+
RefactoringOperation,
|
|
11
|
+
RefactoringStep,
|
|
12
|
+
RefactoringPlan,
|
|
13
|
+
RefactoringResult
|
|
14
|
+
} = require('./refactoring-models');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Refactoring Plan class (simplified)
|
|
18
|
+
*/
|
|
19
|
+
class RefactoringPlanData {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.planManager = new PlanManager({
|
|
22
|
+
autoSave: true,
|
|
23
|
+
backupPlans: true,
|
|
24
|
+
planDirectory: './refactoring-plans'
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
createPlan(name, description) {
|
|
29
|
+
return this.planManager.createPlan(name, description);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
loadPlan(planId) {
|
|
33
|
+
return this.planManager.loadPlan(planId);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
savePlan(plan) {
|
|
37
|
+
return this.planManager.savePlan(plan);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
deletePlan(planId) {
|
|
41
|
+
return this.planManager.deletePlan(planId);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
listPlans() {
|
|
45
|
+
return this.planManager.listPlans();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
getCurrentPlan() {
|
|
49
|
+
return this.planManager.getCurrentPlan();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
addOperation(operationData) {
|
|
53
|
+
return this.planManager.addOperationToCurrentPlan(operationData);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
addStep(operationId, stepData) {
|
|
57
|
+
return this.planManager.addStepToOperation(operationId, stepData);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
executePlan(planId, options) {
|
|
61
|
+
return this.planManager.executePlan(planId, options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
getExecutionHistory() {
|
|
65
|
+
return this.planManager.getExecutionHistory();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exportPlan(planId, outputPath) {
|
|
69
|
+
return this.planManager.exportPlan(planId, outputPath);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
importPlan(planPath) {
|
|
73
|
+
return this.planManager.importPlan(planPath);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
getPlanInfo() {
|
|
77
|
+
return this.planManager.getManagerInfo();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
module.exports = RefactoringPlanData;
|