deepseek-coder-agent-cli 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities/index.d.ts +1 -18
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +2 -19
- package/dist/capabilities/index.js.map +1 -1
- package/dist/core/agiCore.d.ts.map +1 -1
- package/dist/core/agiCore.js +3 -6
- package/dist/core/agiCore.js.map +1 -1
- package/dist/core/dynamicGuardrails.d.ts.map +1 -1
- package/dist/core/dynamicGuardrails.js +0 -60
- package/dist/core/dynamicGuardrails.js.map +1 -1
- package/dist/core/gitWorktreeManager.d.ts +1 -1
- package/dist/core/gitWorktreeManager.d.ts.map +1 -1
- package/dist/core/gitWorktreeManager.js.map +1 -1
- package/dist/core/hotReload.js.map +1 -1
- package/dist/core/index.d.ts +0 -8
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -15
- package/dist/core/index.js.map +1 -1
- package/dist/core/selfUpgrade.d.ts +34 -208
- package/dist/core/selfUpgrade.d.ts.map +1 -1
- package/dist/core/selfUpgrade.js +54 -631
- package/dist/core/selfUpgrade.js.map +1 -1
- package/dist/headless/interactiveShell.d.ts.map +1 -1
- package/dist/headless/interactiveShell.js +10 -71
- package/dist/headless/interactiveShell.js.map +1 -1
- package/dist/orchestration/index.d.ts +9 -5
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +7 -8
- package/dist/orchestration/index.js.map +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -2
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.d.ts +0 -2
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +0 -6
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/tools/diffUtils.d.ts.map +1 -1
- package/dist/tools/diffUtils.js +0 -14
- package/dist/tools/diffUtils.js.map +1 -1
- package/dist/tools/editTools.d.ts.map +1 -1
- package/dist/tools/editTools.js +20 -168
- package/dist/tools/editTools.js.map +1 -1
- package/dist/tools/fileTools.d.ts.map +1 -1
- package/dist/tools/fileTools.js +1 -10
- package/dist/tools/fileTools.js.map +1 -1
- package/dist/tools/grepTools.d.ts.map +1 -1
- package/dist/tools/grepTools.js +1 -2
- package/dist/tools/grepTools.js.map +1 -1
- package/dist/tools/searchTools.d.ts.map +1 -1
- package/dist/tools/searchTools.js +0 -7
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/telemetryTools.d.ts +5 -0
- package/dist/tools/telemetryTools.d.ts.map +1 -1
- package/dist/tools/telemetryTools.js +6 -6
- package/dist/tools/telemetryTools.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +7 -25
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/package.json +1 -2
- package/dist/capabilities/appleSecurityCapability.d.ts +0 -57
- package/dist/capabilities/appleSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/appleSecurityCapability.js +0 -197
- package/dist/capabilities/appleSecurityCapability.js.map +0 -1
- package/dist/capabilities/authorizedSecurityCapability.d.ts +0 -17
- package/dist/capabilities/authorizedSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/authorizedSecurityCapability.js +0 -333
- package/dist/capabilities/authorizedSecurityCapability.js.map +0 -1
- package/dist/capabilities/autoEnhancementCapability.d.ts +0 -98
- package/dist/capabilities/autoEnhancementCapability.d.ts.map +0 -1
- package/dist/capabilities/autoEnhancementCapability.js +0 -455
- package/dist/capabilities/autoEnhancementCapability.js.map +0 -1
- package/dist/capabilities/biocognitiveWarfare.d.ts +0 -136
- package/dist/capabilities/biocognitiveWarfare.d.ts.map +0 -1
- package/dist/capabilities/biocognitiveWarfare.js +0 -603
- package/dist/capabilities/biocognitiveWarfare.js.map +0 -1
- package/dist/capabilities/chineseCnoIntegration.d.ts +0 -60
- package/dist/capabilities/chineseCnoIntegration.d.ts.map +0 -1
- package/dist/capabilities/chineseCnoIntegration.js +0 -253
- package/dist/capabilities/chineseCnoIntegration.js.map +0 -1
- package/dist/capabilities/cnoCapability.d.ts +0 -110
- package/dist/capabilities/cnoCapability.d.ts.map +0 -1
- package/dist/capabilities/cnoCapability.js +0 -785
- package/dist/capabilities/cnoCapability.js.map +0 -1
- package/dist/capabilities/eliteCryptoMilitaryCapability.d.ts +0 -99
- package/dist/capabilities/eliteCryptoMilitaryCapability.d.ts.map +0 -1
- package/dist/capabilities/eliteCryptoMilitaryCapability.js +0 -618
- package/dist/capabilities/eliteCryptoMilitaryCapability.js.map +0 -1
- package/dist/capabilities/integratedUnifiedCapability.d.ts +0 -105
- package/dist/capabilities/integratedUnifiedCapability.d.ts.map +0 -1
- package/dist/capabilities/integratedUnifiedCapability.js +0 -422
- package/dist/capabilities/integratedUnifiedCapability.js.map +0 -1
- package/dist/capabilities/maxOffensiveUkraineCapability.d.ts +0 -46
- package/dist/capabilities/maxOffensiveUkraineCapability.d.ts.map +0 -1
- package/dist/capabilities/maxOffensiveUkraineCapability.js +0 -725
- package/dist/capabilities/maxOffensiveUkraineCapability.js.map +0 -1
- package/dist/capabilities/migrationUtilities.d.ts +0 -128
- package/dist/capabilities/migrationUtilities.d.ts.map +0 -1
- package/dist/capabilities/migrationUtilities.js +0 -658
- package/dist/capabilities/migrationUtilities.js.map +0 -1
- package/dist/capabilities/offensiveDestructionCapability.d.ts +0 -98
- package/dist/capabilities/offensiveDestructionCapability.d.ts.map +0 -1
- package/dist/capabilities/offensiveDestructionCapability.js +0 -848
- package/dist/capabilities/offensiveDestructionCapability.js.map +0 -1
- package/dist/capabilities/quantumSpaceWarfare.d.ts +0 -108
- package/dist/capabilities/quantumSpaceWarfare.d.ts.map +0 -1
- package/dist/capabilities/quantumSpaceWarfare.js +0 -342
- package/dist/capabilities/quantumSpaceWarfare.js.map +0 -1
- package/dist/capabilities/readmeIntegration.d.ts +0 -161
- package/dist/capabilities/readmeIntegration.d.ts.map +0 -1
- package/dist/capabilities/readmeIntegration.js +0 -1034
- package/dist/capabilities/readmeIntegration.js.map +0 -1
- package/dist/capabilities/selfUpdateSystem.d.ts +0 -122
- package/dist/capabilities/selfUpdateSystem.d.ts.map +0 -1
- package/dist/capabilities/selfUpdateSystem.js +0 -725
- package/dist/capabilities/selfUpdateSystem.js.map +0 -1
- package/dist/capabilities/sharedMilitaryInfrastructure.d.ts +0 -89
- package/dist/capabilities/sharedMilitaryInfrastructure.d.ts.map +0 -1
- package/dist/capabilities/sharedMilitaryInfrastructure.js +0 -233
- package/dist/capabilities/sharedMilitaryInfrastructure.js.map +0 -1
- package/dist/capabilities/simpleSecurityCapability.d.ts +0 -36
- package/dist/capabilities/simpleSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/simpleSecurityCapability.js +0 -271
- package/dist/capabilities/simpleSecurityCapability.js.map +0 -1
- package/dist/capabilities/ultimateChineseCno.d.ts +0 -115
- package/dist/capabilities/ultimateChineseCno.d.ts.map +0 -1
- package/dist/capabilities/ultimateChineseCno.js +0 -516
- package/dist/capabilities/ultimateChineseCno.js.map +0 -1
- package/dist/capabilities/ultimateIntegrationDemo.d.ts +0 -54
- package/dist/capabilities/ultimateIntegrationDemo.d.ts.map +0 -1
- package/dist/capabilities/ultimateIntegrationDemo.js +0 -423
- package/dist/capabilities/ultimateIntegrationDemo.js.map +0 -1
- package/dist/capabilities/unifiedMilitaryCapability.d.ts +0 -63
- package/dist/capabilities/unifiedMilitaryCapability.d.ts.map +0 -1
- package/dist/capabilities/unifiedMilitaryCapability.js +0 -384
- package/dist/capabilities/unifiedMilitaryCapability.js.map +0 -1
- package/dist/capabilities/universalCapabilityFramework.d.ts +0 -352
- package/dist/capabilities/universalCapabilityFramework.d.ts.map +0 -1
- package/dist/capabilities/universalCapabilityFramework.js +0 -1056
- package/dist/capabilities/universalCapabilityFramework.js.map +0 -1
- package/dist/capabilities/universalSecurityCapability.d.ts +0 -46
- package/dist/capabilities/universalSecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/universalSecurityCapability.js +0 -580
- package/dist/capabilities/universalSecurityCapability.js.map +0 -1
- package/dist/capabilities/zeroDayDiscoveryCapability.d.ts +0 -31
- package/dist/capabilities/zeroDayDiscoveryCapability.d.ts.map +0 -1
- package/dist/capabilities/zeroDayDiscoveryCapability.js +0 -183
- package/dist/capabilities/zeroDayDiscoveryCapability.js.map +0 -1
- package/dist/core/antiTermination.d.ts +0 -226
- package/dist/core/antiTermination.d.ts.map +0 -1
- package/dist/core/antiTermination.js +0 -713
- package/dist/core/antiTermination.js.map +0 -1
- package/dist/core/appleSecurityAudit.d.ts +0 -98
- package/dist/core/appleSecurityAudit.d.ts.map +0 -1
- package/dist/core/appleSecurityAudit.js +0 -505
- package/dist/core/appleSecurityAudit.js.map +0 -1
- package/dist/core/appleSecurityIntegration.d.ts +0 -130
- package/dist/core/appleSecurityIntegration.d.ts.map +0 -1
- package/dist/core/appleSecurityIntegration.js +0 -697
- package/dist/core/appleSecurityIntegration.js.map +0 -1
- package/dist/core/dualTournament.d.ts +0 -110
- package/dist/core/dualTournament.d.ts.map +0 -1
- package/dist/core/dualTournament.js +0 -270
- package/dist/core/dualTournament.js.map +0 -1
- package/dist/core/parallel.d.ts +0 -85
- package/dist/core/parallel.d.ts.map +0 -1
- package/dist/core/parallel.js +0 -150
- package/dist/core/parallel.js.map +0 -1
- package/dist/core/parallelCoordinator.d.ts +0 -21
- package/dist/core/parallelCoordinator.d.ts.map +0 -1
- package/dist/core/parallelCoordinator.js +0 -42
- package/dist/core/parallelCoordinator.js.map +0 -1
- package/dist/core/realityScore.d.ts +0 -159
- package/dist/core/realityScore.d.ts.map +0 -1
- package/dist/core/realityScore.js +0 -734
- package/dist/core/realityScore.js.map +0 -1
- package/dist/core/repoUpgradeOrchestrator.d.ts +0 -223
- package/dist/core/repoUpgradeOrchestrator.d.ts.map +0 -1
- package/dist/core/repoUpgradeOrchestrator.js +0 -1003
- package/dist/core/repoUpgradeOrchestrator.js.map +0 -1
- package/dist/core/securityTournament.d.ts +0 -83
- package/dist/core/securityTournament.d.ts.map +0 -1
- package/dist/core/securityTournament.js +0 -357
- package/dist/core/securityTournament.js.map +0 -1
- package/dist/core/tournamentStrategy.d.ts +0 -12
- package/dist/core/tournamentStrategy.d.ts.map +0 -1
- package/dist/core/tournamentStrategy.js +0 -41
- package/dist/core/tournamentStrategy.js.map +0 -1
- package/dist/core/universalSecurityAudit.d.ts +0 -104
- package/dist/core/universalSecurityAudit.d.ts.map +0 -1
- package/dist/core/universalSecurityAudit.js +0 -2190
- package/dist/core/universalSecurityAudit.js.map +0 -1
- package/dist/core/variantExecution.d.ts +0 -23
- package/dist/core/variantExecution.d.ts.map +0 -1
- package/dist/core/variantExecution.js +0 -58
- package/dist/core/variantExecution.js.map +0 -1
- package/dist/core/winnerStrategy.d.ts +0 -15
- package/dist/core/winnerStrategy.d.ts.map +0 -1
- package/dist/core/winnerStrategy.js +0 -18
- package/dist/core/winnerStrategy.js.map +0 -1
- package/dist/core/zeroDayDiscovery.d.ts +0 -96
- package/dist/core/zeroDayDiscovery.d.ts.map +0 -1
- package/dist/core/zeroDayDiscovery.js +0 -358
- package/dist/core/zeroDayDiscovery.js.map +0 -1
- package/dist/orchestration/repoUpgradeRunner.d.ts +0 -44
- package/dist/orchestration/repoUpgradeRunner.d.ts.map +0 -1
- package/dist/orchestration/repoUpgradeRunner.js +0 -375
- package/dist/orchestration/repoUpgradeRunner.js.map +0 -1
- package/dist/orchestration/securityAuditRunner.d.ts +0 -144
- package/dist/orchestration/securityAuditRunner.d.ts.map +0 -1
- package/dist/orchestration/securityAuditRunner.js +0 -526
- package/dist/orchestration/securityAuditRunner.js.map +0 -1
- package/dist/plugins/tools/apple/secureApplePlugin.d.ts +0 -3
- package/dist/plugins/tools/apple/secureApplePlugin.d.ts.map +0 -1
- package/dist/plugins/tools/apple/secureApplePlugin.js +0 -26
- package/dist/plugins/tools/apple/secureApplePlugin.js.map +0 -1
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.d.ts +0 -3
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.js +0 -9
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.js.map +0 -1
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +0 -3
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +0 -27
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +0 -1
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.d.ts +0 -3
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.js +0 -9
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.js.map +0 -1
- package/dist/plugins/tools/tao/secureTaoPlugin.d.ts +0 -3
- package/dist/plugins/tools/tao/secureTaoPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/tao/secureTaoPlugin.js +0 -37
- package/dist/plugins/tools/tao/secureTaoPlugin.js.map +0 -1
- package/dist/tools/secureAppleExploitation.d.ts +0 -29
- package/dist/tools/secureAppleExploitation.d.ts.map +0 -1
- package/dist/tools/secureAppleExploitation.js +0 -518
- package/dist/tools/secureAppleExploitation.js.map +0 -1
- package/dist/ui/maxOffensiveUkraineUI.d.ts +0 -94
- package/dist/ui/maxOffensiveUkraineUI.d.ts.map +0 -1
- package/dist/ui/maxOffensiveUkraineUI.js +0 -316
- package/dist/ui/maxOffensiveUkraineUI.js.map +0 -1
|
@@ -1,658 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MIGRATION UTILITIES FOR UNIVERSAL CAPABILITY FRAMEWORK
|
|
3
|
-
*
|
|
4
|
-
* Utilities to help migrate existing capabilities to the Universal Capability Framework.
|
|
5
|
-
* These tools provide automated migration, compatibility layers, and validation.
|
|
6
|
-
*/
|
|
7
|
-
import { UniversalCapabilityModule } from './universalCapabilityFramework.js';
|
|
8
|
-
import { UniversalCapabilityFramework } from './universalCapabilityFramework.js';
|
|
9
|
-
import { UniversalCapabilityFactory } from './universalCapabilityFramework.js';
|
|
10
|
-
import * as fs from 'fs';
|
|
11
|
-
import * as path from 'path';
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// CAPABILITY MIGRATOR
|
|
14
|
-
// ============================================================================
|
|
15
|
-
export class CapabilityMigrator {
|
|
16
|
-
framework;
|
|
17
|
-
options;
|
|
18
|
-
constructor(framework, options = {}) {
|
|
19
|
-
this.framework = framework;
|
|
20
|
-
this.options = {
|
|
21
|
-
preserveOriginal: true,
|
|
22
|
-
generateCompatibilityLayer: true,
|
|
23
|
-
validateMigration: true,
|
|
24
|
-
outputDir: '/tmp/agi-migration',
|
|
25
|
-
logLevel: 'info',
|
|
26
|
-
...options
|
|
27
|
-
};
|
|
28
|
-
// Create output directory
|
|
29
|
-
fs.mkdirSync(this.options.outputDir, { recursive: true });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Migrate a legacy capability to UniversalCapabilityModule
|
|
33
|
-
*/
|
|
34
|
-
async migrateCapability(legacyCapability) {
|
|
35
|
-
const startTime = Date.now();
|
|
36
|
-
const report = {
|
|
37
|
-
legacyCapability,
|
|
38
|
-
migratedCapability: null,
|
|
39
|
-
success: false,
|
|
40
|
-
errors: [],
|
|
41
|
-
warnings: [],
|
|
42
|
-
migrationTime: 0,
|
|
43
|
-
compatibilityScore: 0
|
|
44
|
-
};
|
|
45
|
-
try {
|
|
46
|
-
this.log('info', `Starting migration of capability: ${legacyCapability.id}`);
|
|
47
|
-
// Step 1: Analyze legacy capability
|
|
48
|
-
const analysis = this.analyzeLegacyCapability(legacyCapability);
|
|
49
|
-
report.compatibilityScore = analysis.compatibilityScore;
|
|
50
|
-
if (analysis.warnings.length > 0) {
|
|
51
|
-
report.warnings.push(...analysis.warnings);
|
|
52
|
-
}
|
|
53
|
-
// Step 2: Generate migrated capability class
|
|
54
|
-
const migratedClass = this.generateMigratedCapability(legacyCapability, analysis);
|
|
55
|
-
// Step 3: Create instance
|
|
56
|
-
const migratedInstance = new migratedClass(this.framework, {
|
|
57
|
-
legacyCapabilityId: legacyCapability.id,
|
|
58
|
-
migrationTimestamp: new Date().toISOString()
|
|
59
|
-
});
|
|
60
|
-
report.migratedCapability = migratedInstance;
|
|
61
|
-
// Step 4: Validate migration
|
|
62
|
-
if (this.options.validateMigration) {
|
|
63
|
-
const validation = await this.validateMigration(legacyCapability, migratedInstance);
|
|
64
|
-
if (!validation.success) {
|
|
65
|
-
report.errors.push(...validation.errors);
|
|
66
|
-
throw new Error(`Migration validation failed: ${validation.errors.join(', ')}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
// Step 5: Generate compatibility layer if requested
|
|
70
|
-
if (this.options.generateCompatibilityLayer) {
|
|
71
|
-
await this.generateCompatibilityLayer(legacyCapability, migratedInstance, report);
|
|
72
|
-
}
|
|
73
|
-
// Step 6: Save migration artifacts
|
|
74
|
-
await this.saveMigrationArtifacts(legacyCapability, migratedInstance, report);
|
|
75
|
-
report.success = true;
|
|
76
|
-
this.log('info', `✅ Successfully migrated capability: ${legacyCapability.id}`);
|
|
77
|
-
this.log('info', ` Compatibility score: ${report.compatibilityScore}/100`);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
report.errors.push(error.message);
|
|
81
|
-
this.log('error', `❌ Failed to migrate capability ${legacyCapability.id}: ${error.message}`);
|
|
82
|
-
}
|
|
83
|
-
finally {
|
|
84
|
-
report.migrationTime = Date.now() - startTime;
|
|
85
|
-
}
|
|
86
|
-
return report;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Analyze a legacy capability for migration compatibility
|
|
90
|
-
*/
|
|
91
|
-
analyzeLegacyCapability(capability) {
|
|
92
|
-
const analysis = {
|
|
93
|
-
hasTools: !!capability.tools && capability.tools.length > 0,
|
|
94
|
-
hasToolSuite: !!capability.toolSuite,
|
|
95
|
-
hasCreateMethod: typeof capability.create === 'function',
|
|
96
|
-
hasExecuteMethod: typeof capability.execute === 'function',
|
|
97
|
-
compatibilityScore: 0,
|
|
98
|
-
warnings: []
|
|
99
|
-
};
|
|
100
|
-
let score = 0;
|
|
101
|
-
const maxScore = 100;
|
|
102
|
-
// Check for required methods
|
|
103
|
-
if (analysis.hasCreateMethod)
|
|
104
|
-
score += 40;
|
|
105
|
-
if (analysis.hasExecuteMethod)
|
|
106
|
-
score += 30;
|
|
107
|
-
if (analysis.hasTools || analysis.hasToolSuite)
|
|
108
|
-
score += 30;
|
|
109
|
-
analysis.compatibilityScore = score;
|
|
110
|
-
// Generate warnings
|
|
111
|
-
if (!analysis.hasCreateMethod) {
|
|
112
|
-
analysis.warnings.push('Legacy capability missing create() method - will need manual implementation');
|
|
113
|
-
}
|
|
114
|
-
if (!analysis.hasExecuteMethod) {
|
|
115
|
-
analysis.warnings.push('Legacy capability missing execute() method - will need manual implementation');
|
|
116
|
-
}
|
|
117
|
-
if (!analysis.hasTools && !analysis.hasToolSuite) {
|
|
118
|
-
analysis.warnings.push('Legacy capability has no tools - empty capability will be created');
|
|
119
|
-
}
|
|
120
|
-
return analysis;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Generate migrated capability class
|
|
124
|
-
*/
|
|
125
|
-
generateMigratedCapability(legacyCapability, analysis) {
|
|
126
|
-
const legacyId = legacyCapability.id;
|
|
127
|
-
const migratedId = this.generateMigratedId(legacyId);
|
|
128
|
-
// Create dynamic class
|
|
129
|
-
class MigratedCapability extends UniversalCapabilityModule {
|
|
130
|
-
id = migratedId;
|
|
131
|
-
metadata = {
|
|
132
|
-
id: migratedId,
|
|
133
|
-
version: '1.0.0',
|
|
134
|
-
description: `Migrated from ${legacyCapability.name}`,
|
|
135
|
-
author: 'Migration Utility',
|
|
136
|
-
dependencies: [],
|
|
137
|
-
provides: this.extractProvidedCapabilities(legacyCapability),
|
|
138
|
-
requires: [],
|
|
139
|
-
category: 'migrated',
|
|
140
|
-
tags: ['migrated', 'legacy', legacyId],
|
|
141
|
-
originalCapability: {
|
|
142
|
-
id: legacyId,
|
|
143
|
-
name: legacyCapability.name,
|
|
144
|
-
description: legacyCapability.description
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
legacyCapability;
|
|
148
|
-
constructor(framework, config) {
|
|
149
|
-
super(framework, config);
|
|
150
|
-
this.legacyCapability = legacyCapability;
|
|
151
|
-
}
|
|
152
|
-
async create(context) {
|
|
153
|
-
// Try to use legacy create method if available
|
|
154
|
-
if (analysis.hasCreateMethod && this.legacyCapability.create) {
|
|
155
|
-
try {
|
|
156
|
-
const legacyContribution = await this.legacyCapability.create(context);
|
|
157
|
-
return this.transformLegacyContribution(legacyContribution);
|
|
158
|
-
}
|
|
159
|
-
catch (error) {
|
|
160
|
-
this.log('warn', `Legacy create() method failed: ${error}`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
// Fallback: generate from tools/toolSuite
|
|
164
|
-
return this.generateContributionFromLegacy(context);
|
|
165
|
-
}
|
|
166
|
-
async execute(params) {
|
|
167
|
-
// Try to use legacy execute method if available
|
|
168
|
-
if (analysis.hasExecuteMethod && this.legacyCapability.execute) {
|
|
169
|
-
try {
|
|
170
|
-
return await this.legacyCapability.execute(params);
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
this.log('warn', `Legacy execute() method failed: ${error}`);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// Fallback: generic execution
|
|
177
|
-
return {
|
|
178
|
-
operation: params.operation,
|
|
179
|
-
parameters: params.parameters,
|
|
180
|
-
migratedFrom: legacyId,
|
|
181
|
-
timestamp: new Date().toISOString(),
|
|
182
|
-
note: 'Executed via migration compatibility layer'
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
extractProvidedCapabilities(capability) {
|
|
186
|
-
const provides = [];
|
|
187
|
-
const baseId = legacyId.replace(/^capability\./, '');
|
|
188
|
-
provides.push(`${baseId}.basic`);
|
|
189
|
-
if (capability.tools && capability.tools.length > 0) {
|
|
190
|
-
provides.push(`${baseId}.tools`);
|
|
191
|
-
}
|
|
192
|
-
if (capability.toolSuite) {
|
|
193
|
-
provides.push(`${baseId}.toolSuite`);
|
|
194
|
-
}
|
|
195
|
-
return provides;
|
|
196
|
-
}
|
|
197
|
-
transformLegacyContribution(legacyContribution) {
|
|
198
|
-
return {
|
|
199
|
-
id: migratedId,
|
|
200
|
-
description: legacyCapability.description || `Migrated capability: ${legacyId}`,
|
|
201
|
-
toolSuite: legacyContribution.toolSuite || {
|
|
202
|
-
id: `${migratedId}-tools`,
|
|
203
|
-
description: `Tools migrated from ${legacyId}`,
|
|
204
|
-
tools: legacyCapability.tools || []
|
|
205
|
-
},
|
|
206
|
-
metadata: {
|
|
207
|
-
...legacyContribution.metadata,
|
|
208
|
-
migrated: true,
|
|
209
|
-
originalId: legacyId,
|
|
210
|
-
migrationTimestamp: new Date().toISOString()
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
generateContributionFromLegacy(context) {
|
|
215
|
-
const tools = legacyCapability.tools || [];
|
|
216
|
-
const toolSuite = legacyCapability.toolSuite;
|
|
217
|
-
return {
|
|
218
|
-
id: migratedId,
|
|
219
|
-
description: legacyCapability.description || `Migrated capability: ${legacyId}`,
|
|
220
|
-
toolSuite: toolSuite || {
|
|
221
|
-
id: `${migratedId}-tools`,
|
|
222
|
-
description: `Tools migrated from ${legacyId}`,
|
|
223
|
-
tools
|
|
224
|
-
},
|
|
225
|
-
metadata: {
|
|
226
|
-
workingDir: context.workingDir,
|
|
227
|
-
migrated: true,
|
|
228
|
-
originalId: legacyId,
|
|
229
|
-
toolsCount: tools.length,
|
|
230
|
-
migrationTimestamp: new Date().toISOString()
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
log(level, message, data) {
|
|
235
|
-
// Use the framework's log method from UniversalCapabilityModule
|
|
236
|
-
super.log(level, message, data);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return MigratedCapability;
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Generate compatibility layer for legacy code
|
|
243
|
-
*/
|
|
244
|
-
async generateCompatibilityLayer(legacyCapability, migratedCapability, report) {
|
|
245
|
-
const compatibilityCode = this.generateCompatibilityCode(legacyCapability, migratedCapability);
|
|
246
|
-
const filePath = path.join(this.options.outputDir, `${legacyCapability.id}.compatibility.ts`);
|
|
247
|
-
fs.writeFileSync(filePath, compatibilityCode, 'utf8');
|
|
248
|
-
report.warnings.push(`Compatibility layer generated at: ${filePath}`);
|
|
249
|
-
this.log('info', `📄 Compatibility layer generated: ${filePath}`);
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Generate TypeScript code for compatibility layer
|
|
253
|
-
*/
|
|
254
|
-
generateCompatibilityCode(legacyCapability, migratedCapability) {
|
|
255
|
-
const legacyId = legacyCapability.id;
|
|
256
|
-
const migratedId = migratedCapability.id;
|
|
257
|
-
const className = this.generateClassName(legacyId);
|
|
258
|
-
return `/**
|
|
259
|
-
* COMPATIBILITY LAYER: ${legacyId}
|
|
260
|
-
*
|
|
261
|
-
* Generated by Universal Capability Framework Migration Utility
|
|
262
|
-
* Date: ${new Date().toISOString()}
|
|
263
|
-
*
|
|
264
|
-
* This file provides backward compatibility for code using the legacy
|
|
265
|
-
* ${legacyId} capability. It wraps the migrated capability in the
|
|
266
|
-
* Universal Capability Framework.
|
|
267
|
-
*/
|
|
268
|
-
|
|
269
|
-
import { UniversalCapabilityFramework } from '../capabilities/universalCapabilityFramework.js';
|
|
270
|
-
import { UniversalCapabilityFactory } from '../capabilities/universalCapabilityFramework.js';
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Legacy ${legacyId} compatibility wrapper
|
|
274
|
-
*/
|
|
275
|
-
export class ${className} {
|
|
276
|
-
private migratedCapability: any;
|
|
277
|
-
private framework: UniversalCapabilityFramework;
|
|
278
|
-
|
|
279
|
-
constructor(config: any = {}) {
|
|
280
|
-
// Initialize framework
|
|
281
|
-
this.framework = new UniversalCapabilityFramework({
|
|
282
|
-
rootDir: config.workingDir || process.cwd(),
|
|
283
|
-
debug: config.debug || false,
|
|
284
|
-
enableEvents: true,
|
|
285
|
-
enableDependencyResolution: true
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
// Get migrated capability
|
|
289
|
-
this.migratedCapability = UniversalCapabilityFactory.createCapability(
|
|
290
|
-
'${this.getFactoryId(migratedId)}',
|
|
291
|
-
this.framework,
|
|
292
|
-
{
|
|
293
|
-
legacyCapabilityId: '${legacyId}',
|
|
294
|
-
...config
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Get capability ID
|
|
301
|
-
*/
|
|
302
|
-
get id(): string {
|
|
303
|
-
return '${legacyId}';
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Get migrated capability ID
|
|
308
|
-
*/
|
|
309
|
-
get migratedId(): string {
|
|
310
|
-
return '${migratedId}';
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Create capability contribution (legacy compatibility)
|
|
315
|
-
*/
|
|
316
|
-
async create(context: any): Promise<any> {
|
|
317
|
-
if (!this.migratedCapability) {
|
|
318
|
-
throw new Error('Migrated capability not initialized');
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return await this.migratedCapability.create(context);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Execute operation (legacy compatibility)
|
|
326
|
-
*/
|
|
327
|
-
async execute(params: any): Promise<any> {
|
|
328
|
-
if (!this.migratedCapability) {
|
|
329
|
-
throw new Error('Migrated capability not initialized');
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return await this.migratedCapability.execute(params);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Get tools (legacy compatibility)
|
|
337
|
-
*/
|
|
338
|
-
get tools(): any[] {
|
|
339
|
-
// Return empty array - tools are now managed by framework
|
|
340
|
-
return [];
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Get tool suite (legacy compatibility)
|
|
345
|
-
*/
|
|
346
|
-
get toolSuite(): any {
|
|
347
|
-
// Return minimal tool suite for compatibility
|
|
348
|
-
return {
|
|
349
|
-
id: '${legacyId}-compatibility',
|
|
350
|
-
description: 'Compatibility layer for ${legacyId}',
|
|
351
|
-
tools: []
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Migration helper: check if capability is migrated
|
|
357
|
-
*/
|
|
358
|
-
static isMigrated(): boolean {
|
|
359
|
-
return true;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Migration helper: get migration info
|
|
364
|
-
*/
|
|
365
|
-
static getMigrationInfo(): any {
|
|
366
|
-
return {
|
|
367
|
-
legacyId: '${legacyId}',
|
|
368
|
-
migratedId: '${migratedId}',
|
|
369
|
-
migrationDate: '${new Date().toISOString()}',
|
|
370
|
-
frameworkVersion: '1.0.0',
|
|
371
|
-
compatibility: true
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Factory function for backward compatibility
|
|
378
|
-
*/
|
|
379
|
-
export function create${this.generateFactoryName(legacyId)}(config?: any): ${className} {
|
|
380
|
-
return new ${className}(config);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Default export for backward compatibility
|
|
385
|
-
*/
|
|
386
|
-
export default ${className};
|
|
387
|
-
`;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Save migration artifacts
|
|
391
|
-
*/
|
|
392
|
-
async saveMigrationArtifacts(legacyCapability, migratedCapability, report) {
|
|
393
|
-
const artifactsDir = path.join(this.options.outputDir, 'artifacts', legacyCapability.id);
|
|
394
|
-
fs.mkdirSync(artifactsDir, { recursive: true });
|
|
395
|
-
// Save migration report
|
|
396
|
-
const reportPath = path.join(artifactsDir, 'migration_report.json');
|
|
397
|
-
fs.writeFileSync(reportPath, JSON.stringify(report, null, 2), 'utf8');
|
|
398
|
-
// Save capability analysis
|
|
399
|
-
const analysisPath = path.join(artifactsDir, 'capability_analysis.json');
|
|
400
|
-
const analysis = this.analyzeLegacyCapability(legacyCapability);
|
|
401
|
-
fs.writeFileSync(analysisPath, JSON.stringify(analysis, null, 2), 'utf8');
|
|
402
|
-
// Save migrated capability metadata
|
|
403
|
-
const metadataPath = path.join(artifactsDir, 'migrated_metadata.json');
|
|
404
|
-
fs.writeFileSync(metadataPath, JSON.stringify(migratedCapability.metadata, null, 2), 'utf8');
|
|
405
|
-
this.log('info', `📁 Migration artifacts saved to: ${artifactsDir}`);
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Validate migration results
|
|
409
|
-
*/
|
|
410
|
-
async validateMigration(legacyCapability, migratedCapability) {
|
|
411
|
-
const errors = [];
|
|
412
|
-
// Basic validation
|
|
413
|
-
if (!migratedCapability.id) {
|
|
414
|
-
errors.push('Migrated capability missing id');
|
|
415
|
-
}
|
|
416
|
-
if (!migratedCapability.metadata) {
|
|
417
|
-
errors.push('Migrated capability missing metadata');
|
|
418
|
-
}
|
|
419
|
-
// Validate create method exists
|
|
420
|
-
if (typeof migratedCapability.create !== 'function') {
|
|
421
|
-
errors.push('Migrated capability missing create() method');
|
|
422
|
-
}
|
|
423
|
-
// Validate execute method exists
|
|
424
|
-
if (typeof migratedCapability.execute !== 'function') {
|
|
425
|
-
errors.push('Migrated capability missing execute() method');
|
|
426
|
-
}
|
|
427
|
-
// Try to create contribution (basic test)
|
|
428
|
-
try {
|
|
429
|
-
const testContext = {
|
|
430
|
-
profile: 'default',
|
|
431
|
-
workspaceContext: null,
|
|
432
|
-
workingDir: process.cwd(),
|
|
433
|
-
env: process.env
|
|
434
|
-
};
|
|
435
|
-
const contribution = await migratedCapability.create(testContext);
|
|
436
|
-
// Handle both single contribution and array of contributions
|
|
437
|
-
const contributions = Array.isArray(contribution) ? contribution : [contribution];
|
|
438
|
-
for (const contrib of contributions) {
|
|
439
|
-
if (contrib && contrib.id) {
|
|
440
|
-
// At least one contribution has an id, that's sufficient
|
|
441
|
-
break;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
// Check if we found at least one valid contribution
|
|
445
|
-
const hasValidContribution = contributions.some(contrib => contrib && contrib.id);
|
|
446
|
-
if (!hasValidContribution) {
|
|
447
|
-
errors.push('No valid contribution with id found');
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
catch (error) {
|
|
451
|
-
errors.push(`Create method test failed: ${error.message}`);
|
|
452
|
-
}
|
|
453
|
-
return {
|
|
454
|
-
success: errors.length === 0,
|
|
455
|
-
errors
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* Generate a migrated ID from legacy ID
|
|
460
|
-
*/
|
|
461
|
-
generateMigratedId(legacyId) {
|
|
462
|
-
// Convert legacy ID to migrated format
|
|
463
|
-
if (legacyId.startsWith('capability.')) {
|
|
464
|
-
return `migrated.${legacyId.substring(11)}`;
|
|
465
|
-
}
|
|
466
|
-
return `migrated.${legacyId}`;
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Generate class name from ID
|
|
470
|
-
*/
|
|
471
|
-
generateClassName(id) {
|
|
472
|
-
const parts = id.split('.');
|
|
473
|
-
return parts.map(part => part.charAt(0).toUpperCase() + part.slice(1)).join('') + 'Capability';
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Generate factory name from ID
|
|
477
|
-
*/
|
|
478
|
-
generateFactoryName(id) {
|
|
479
|
-
const className = this.generateClassName(id);
|
|
480
|
-
return className.replace('Capability', '');
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Get factory ID from migrated ID
|
|
484
|
-
*/
|
|
485
|
-
getFactoryId(migratedId) {
|
|
486
|
-
// Extract base name for factory registration
|
|
487
|
-
const parts = migratedId.split('.');
|
|
488
|
-
return parts[parts.length - 1]; // Last part
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Log message with level
|
|
492
|
-
*/
|
|
493
|
-
log(level, message) {
|
|
494
|
-
if (this.options.logLevel !== 'silent') {
|
|
495
|
-
console.log(`[${level.toUpperCase()}] Migration: ${message}`);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
/**
|
|
499
|
-
* Batch migrate multiple capabilities
|
|
500
|
-
*/
|
|
501
|
-
async migrateCapabilities(capabilities) {
|
|
502
|
-
this.log('info', `Starting batch migration of ${capabilities.length} capabilities`);
|
|
503
|
-
const reports = [];
|
|
504
|
-
const successful = [];
|
|
505
|
-
const failed = [];
|
|
506
|
-
for (const capability of capabilities) {
|
|
507
|
-
try {
|
|
508
|
-
const report = await this.migrateCapability(capability);
|
|
509
|
-
reports.push(report);
|
|
510
|
-
if (report.success) {
|
|
511
|
-
successful.push(capability.id);
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
failed.push(capability.id);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
catch (error) {
|
|
518
|
-
failed.push(capability.id);
|
|
519
|
-
this.log('error', `Failed to migrate ${capability.id}: ${error.message}`);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
// Generate summary report
|
|
523
|
-
const summary = {
|
|
524
|
-
total: capabilities.length,
|
|
525
|
-
successful: successful.length,
|
|
526
|
-
failed: failed.length,
|
|
527
|
-
successRate: (successful.length / capabilities.length) * 100,
|
|
528
|
-
successfulCapabilities: successful,
|
|
529
|
-
failedCapabilities: failed,
|
|
530
|
-
totalMigrationTime: reports.reduce((sum, r) => sum + r.migrationTime, 0),
|
|
531
|
-
averageCompatibilityScore: reports.reduce((sum, r) => sum + r.compatibilityScore, 0) / reports.length
|
|
532
|
-
};
|
|
533
|
-
const summaryPath = path.join(this.options.outputDir, 'migration_summary.json');
|
|
534
|
-
fs.writeFileSync(summaryPath, JSON.stringify(summary, null, 2), 'utf8');
|
|
535
|
-
this.log('info', `📊 Migration Summary:`);
|
|
536
|
-
this.log('info', ` Total: ${summary.total}`);
|
|
537
|
-
this.log('info', ` Successful: ${summary.successful}`);
|
|
538
|
-
this.log('info', ` Failed: ${summary.failed}`);
|
|
539
|
-
this.log('info', ` Success Rate: ${summary.successRate.toFixed(1)}%`);
|
|
540
|
-
this.log('info', ` Avg Compatibility: ${summary.averageCompatibilityScore.toFixed(1)}/100`);
|
|
541
|
-
return reports;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Analyze directory for legacy capabilities
|
|
545
|
-
*/
|
|
546
|
-
analyzeDirectory(dirPath) {
|
|
547
|
-
this.log('info', `Analyzing directory: ${dirPath}`);
|
|
548
|
-
const capabilities = [];
|
|
549
|
-
const analysis = {};
|
|
550
|
-
// This would normally scan files and detect capability patterns
|
|
551
|
-
// For now, return mock analysis
|
|
552
|
-
return {
|
|
553
|
-
capabilities,
|
|
554
|
-
totalFiles: 0,
|
|
555
|
-
compatibleFiles: 0,
|
|
556
|
-
analysis
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
// ============================================================================
|
|
561
|
-
// MIGRATION HELPERS
|
|
562
|
-
// ============================================================================
|
|
563
|
-
/**
|
|
564
|
-
* Create a migration-ready framework instance
|
|
565
|
-
*/
|
|
566
|
-
export function createMigrationFramework(config) {
|
|
567
|
-
return new UniversalCapabilityFramework({
|
|
568
|
-
rootDir: process.cwd(),
|
|
569
|
-
debug: true,
|
|
570
|
-
enableEvents: true,
|
|
571
|
-
enableDependencyResolution: true,
|
|
572
|
-
sharedDataDir: '/tmp/agi-migration-framework',
|
|
573
|
-
...config
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* Register migrated capabilities with factory
|
|
578
|
-
*/
|
|
579
|
-
export function registerMigratedCapabilities(framework, migratedClasses) {
|
|
580
|
-
migratedClasses.forEach((CapabilityClass, index) => {
|
|
581
|
-
const instance = new CapabilityClass(framework, {});
|
|
582
|
-
const factoryId = `migrated-${index}-${instance.id}`;
|
|
583
|
-
UniversalCapabilityFactory.registerCapability(factoryId, CapabilityClass);
|
|
584
|
-
console.log(`✅ Registered migrated capability: ${instance.id} as ${factoryId}`);
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* Generate migration report from results
|
|
589
|
-
*/
|
|
590
|
-
export function generateMigrationReport(results) {
|
|
591
|
-
const total = results.length;
|
|
592
|
-
const successful = results.filter(r => r.success).length;
|
|
593
|
-
const failed = results.filter(r => !r.success).length;
|
|
594
|
-
const avgScore = results.reduce((sum, r) => sum + r.compatibilityScore, 0) / total;
|
|
595
|
-
const avgTime = results.reduce((sum, r) => sum + r.migrationTime, 0) / total;
|
|
596
|
-
const report = `
|
|
597
|
-
# MIGRATION REPORT
|
|
598
|
-
|
|
599
|
-
## Summary
|
|
600
|
-
- **Total Capabilities**: ${total}
|
|
601
|
-
- **Successful**: ${successful} (${((successful / total) * 100).toFixed(1)}%)
|
|
602
|
-
- **Failed**: ${failed} (${((failed / total) * 100).toFixed(1)}%)
|
|
603
|
-
- **Average Compatibility Score**: ${avgScore.toFixed(1)}/100
|
|
604
|
-
- **Average Migration Time**: ${avgTime.toFixed(0)}ms
|
|
605
|
-
|
|
606
|
-
## Successful Migrations
|
|
607
|
-
${results.filter(r => r.success).map(r => `- ${r.legacyCapability.id} → ${r.migratedCapability?.id || 'unknown'} (${r.compatibilityScore}/100)`).join('\n')}
|
|
608
|
-
|
|
609
|
-
## Failed Migrations
|
|
610
|
-
${results.filter(r => !r.success).map(r => `- ${r.legacyCapability.id}: ${r.errors.join(', ')}`).join('\n')}
|
|
611
|
-
|
|
612
|
-
## Recommendations
|
|
613
|
-
${generateRecommendations(results)}
|
|
614
|
-
`;
|
|
615
|
-
return report;
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* Generate recommendations based on migration results
|
|
619
|
-
*/
|
|
620
|
-
function generateRecommendations(results) {
|
|
621
|
-
const recommendations = [];
|
|
622
|
-
const lowScore = results.filter(r => r.compatibilityScore < 50);
|
|
623
|
-
if (lowScore.length > 0) {
|
|
624
|
-
recommendations.push(`**${lowScore.length} capabilities have low compatibility (<50%).** Consider manual refactoring for these.`);
|
|
625
|
-
}
|
|
626
|
-
const highScore = results.filter(r => r.compatibilityScore >= 80);
|
|
627
|
-
if (highScore.length > 0) {
|
|
628
|
-
recommendations.push(`**${highScore.length} capabilities have high compatibility (≥80%).** These can be migrated automatically.`);
|
|
629
|
-
}
|
|
630
|
-
const withWarnings = results.filter(r => r.warnings.length > 0);
|
|
631
|
-
if (withWarnings.length > 0) {
|
|
632
|
-
recommendations.push(`**${withWarnings.length} capabilities have warnings.** Review these before production deployment.`);
|
|
633
|
-
}
|
|
634
|
-
if (recommendations.length === 0) {
|
|
635
|
-
recommendations.push('All capabilities migrated successfully. Ready for production deployment.');
|
|
636
|
-
}
|
|
637
|
-
return recommendations.join('\n\n');
|
|
638
|
-
}
|
|
639
|
-
// ============================================================================
|
|
640
|
-
// QUICK MIGRATION UTILITY
|
|
641
|
-
// ============================================================================
|
|
642
|
-
/**
|
|
643
|
-
* Quick migration utility for common patterns
|
|
644
|
-
*/
|
|
645
|
-
export async function quickMigrate(legacyCapability, options) {
|
|
646
|
-
const framework = createMigrationFramework();
|
|
647
|
-
const migrator = new CapabilityMigrator(framework, options);
|
|
648
|
-
return await migrator.migrateCapability(legacyCapability);
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Quick batch migration
|
|
652
|
-
*/
|
|
653
|
-
export async function quickBatchMigrate(capabilities, options) {
|
|
654
|
-
const framework = createMigrationFramework();
|
|
655
|
-
const migrator = new CapabilityMigrator(framework, options);
|
|
656
|
-
return await migrator.migrateCapabilities(capabilities);
|
|
657
|
-
}
|
|
658
|
-
//# sourceMappingURL=migrationUtilities.js.map
|