@avrm/svi 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +6 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/package.json +39 -0
- package/dist/src/commands/cliOptions.js +58 -0
- package/dist/src/commands/cliOptions.js.map +1 -0
- package/dist/src/commands/entryPoint.js +90 -0
- package/dist/src/commands/entryPoint.js.map +1 -0
- package/dist/src/commands/env.js +141 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/init.js +108 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/run.js +58 -0
- package/dist/src/commands/run.js.map +1 -0
- package/dist/src/commands/runner/checkerForRunManager.js +49 -0
- package/dist/src/commands/runner/checkerForRunManager.js.map +1 -0
- package/dist/src/commands/runner/runManager.js +137 -0
- package/dist/src/commands/runner/runManager.js.map +1 -0
- package/dist/src/commands/runner/runStatistics.js +55 -0
- package/dist/src/commands/runner/runStatistics.js.map +1 -0
- package/dist/src/config/config.js +135 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/configFinder.js +37 -0
- package/dist/src/config/configFinder.js.map +1 -0
- package/dist/src/llm/llm.js +117 -0
- package/dist/src/llm/llm.js.map +1 -0
- package/dist/src/llm/llmServiceByModel.js +43 -0
- package/dist/src/llm/llmServiceByModel.js.map +1 -0
- package/dist/src/llm/llmUtils.js +23 -0
- package/dist/src/llm/llmUtils.js.map +1 -0
- package/dist/src/llm/theMaximalistLlmJs/LlmJsFactories.js +27 -0
- package/dist/src/llm/theMaximalistLlmJs/LlmJsFactories.js.map +1 -0
- package/dist/src/llm/theMaximalistLlmJs/ModelUsageWrapper.js +55 -0
- package/dist/src/llm/theMaximalistLlmJs/ModelUsageWrapper.js.map +1 -0
- package/dist/src/svi/cacheManager.js +187 -0
- package/dist/src/svi/cacheManager.js.map +1 -0
- package/dist/src/svi/promptBuilder.js +59 -0
- package/dist/src/svi/promptBuilder.js.map +1 -0
- package/dist/src/svi/prompts/extractDeclarations.js +25 -0
- package/dist/src/svi/prompts/extractDeclarations.js.map +1 -0
- package/dist/src/svi/prompts/generate.js +36 -0
- package/dist/src/svi/prompts/generate.js.map +1 -0
- package/dist/src/svi/sviChecks.js +131 -0
- package/dist/src/svi/sviChecks.js.map +1 -0
- package/dist/src/svi/sviDependencies.js +139 -0
- package/dist/src/svi/sviDependencies.js.map +1 -0
- package/dist/src/svi/sviFileClass.js +105 -0
- package/dist/src/svi/sviFileClass.js.map +1 -0
- package/dist/src/svi/sviFileOrderOptimizer/sviDependencyCycleAnalyzer.js +154 -0
- package/dist/src/svi/sviFileOrderOptimizer/sviDependencyCycleAnalyzer.js.map +1 -0
- package/dist/src/svi/sviFileOrderOptimizer/sviDependencyFinder.js +57 -0
- package/dist/src/svi/sviFileOrderOptimizer/sviDependencyFinder.js.map +1 -0
- package/dist/src/svi/sviFileOrderOptimizer/sviFileOrderOptimizer.js +93 -0
- package/dist/src/svi/sviFileOrderOptimizer/sviFileOrderOptimizer.js.map +1 -0
- package/dist/src/svi/sviFileOrderOptimizer/types.js +3 -0
- package/dist/src/svi/sviFileOrderOptimizer/types.js.map +1 -0
- package/dist/src/svi/sviImportPrompts.js +138 -0
- package/dist/src/svi/sviImportPrompts.js.map +1 -0
- package/dist/src/svi/sviLoader.js +138 -0
- package/dist/src/svi/sviLoader.js.map +1 -0
- package/dist/src/svi/sviParser/parsedSviDirectory.js +34 -0
- package/dist/src/svi/sviParser/parsedSviDirectory.js.map +1 -0
- package/dist/src/svi/sviParser/sviParser.js +205 -0
- package/dist/src/svi/sviParser/sviParser.js.map +1 -0
- package/dist/src/svi/sviProcessor.js +138 -0
- package/dist/src/svi/sviProcessor.js.map +1 -0
- package/dist/src/svi/types.js +3 -0
- package/dist/src/svi/types.js.map +1 -0
- package/dist/src/utils/codeClear.js +29 -0
- package/dist/src/utils/codeClear.js.map +1 -0
- package/dist/src/utils/constants.js +6 -0
- package/dist/src/utils/constants.js.map +1 -0
- package/dist/src/utils/fastGlobWrapper.js +34 -0
- package/dist/src/utils/fastGlobWrapper.js.map +1 -0
- package/dist/src/utils/file.js +137 -0
- package/dist/src/utils/file.js.map +1 -0
- package/dist/src/utils/file2.js +26 -0
- package/dist/src/utils/file2.js.map +1 -0
- package/dist/src/utils/logger.js +105 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/utils.js +34 -0
- package/dist/src/utils/utils.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const extractDeclarations_1 = require("./prompts/extractDeclarations");
|
|
9
|
+
const cacheManager_1 = __importDefault(require("../svi/cacheManager"));
|
|
10
|
+
const logger_1 = __importDefault(require("../utils/logger"));
|
|
11
|
+
const file_1 = require("../utils/file");
|
|
12
|
+
// Generated file path: src\svi\sviDependencies.ts
|
|
13
|
+
class SviDependencies {
|
|
14
|
+
constructor(llmProcessor, config, isPreliminary) {
|
|
15
|
+
this.dependenciesDeclarations = [];
|
|
16
|
+
this.llmGeneratedFiles = [];
|
|
17
|
+
this.cacheUsedFiles = [];
|
|
18
|
+
this.llmProcessor = llmProcessor;
|
|
19
|
+
this.config = config;
|
|
20
|
+
this.isPreliminary = isPreliminary;
|
|
21
|
+
}
|
|
22
|
+
async loadDependenciesDeclarations(sviFile) {
|
|
23
|
+
logger_1.default.trace(`Starting to load dependencies for SVI file: '${sviFile.getSviFileName()}'`);
|
|
24
|
+
// Clear previous declarations for a fresh load
|
|
25
|
+
this.dependenciesDeclarations = [];
|
|
26
|
+
this.llmGeneratedFiles = [];
|
|
27
|
+
this.cacheUsedFiles = [];
|
|
28
|
+
const sviFileDirectory = sviFile.getSviFileDirectory();
|
|
29
|
+
const dependencies = sviFile.dependencies || [];
|
|
30
|
+
let hasError = false;
|
|
31
|
+
for (const dependencyFilename of dependencies) {
|
|
32
|
+
const dependencyFullPath = path_1.default.resolve(sviFileDirectory, dependencyFilename);
|
|
33
|
+
const relativeDependencyPath = (0, file_1.getRelativePath)(dependencyFullPath, this.config.configDir);
|
|
34
|
+
logger_1.default.trace(`Processing dependency: '${dependencyFilename}' (Resolved to: '${dependencyFullPath}')`);
|
|
35
|
+
if (!fs_1.default.existsSync(dependencyFullPath)) {
|
|
36
|
+
if (this.isPreliminary) {
|
|
37
|
+
logger_1.default.trace(`Skipping non-existent dependency file in preliminary run: '${dependencyFullPath}'`);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
logger_1.default.error(`File '${sviFile.getSviFileName()}' from 'Dependencies' section not found at path: '${dependencyFullPath}'.`);
|
|
42
|
+
hasError = true;
|
|
43
|
+
continue; // Continue to check other dependencies, but flag an error for final return
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const cacheManager = new cacheManager_1.default(path_1.default.dirname(dependencyFullPath));
|
|
47
|
+
let declarationsContent = null;
|
|
48
|
+
let declarationSource = 'llm'; // Default to LLM, will be updated if from cache
|
|
49
|
+
if (cacheManager.isFileExportsCacheValid(dependencyFullPath)) {
|
|
50
|
+
declarationsContent = cacheManager.getFileExportsFromCache(dependencyFullPath);
|
|
51
|
+
if (declarationsContent) {
|
|
52
|
+
declarationSource = 'cache';
|
|
53
|
+
this.cacheUsedFiles.push(relativeDependencyPath);
|
|
54
|
+
logger_1.default.trace(`Declarations for '${relativeDependencyPath}' loaded from cache.`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Cache was valid but content was null (e.g., empty cache file), proceed to LLM
|
|
58
|
+
logger_1.default.trace(`Cache valid for '${relativeDependencyPath}' but content empty. Proceeding to LLM.`);
|
|
59
|
+
declarationsContent = null; // Ensure it's null to trigger LLM path below
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (!declarationsContent) {
|
|
63
|
+
// If not from cache, or cache was empty, ask LLM
|
|
64
|
+
logger_1.default.info(`LLM will be called to generate declarations for the following file: '${relativeDependencyPath}'`);
|
|
65
|
+
try {
|
|
66
|
+
const sourceCode = fs_1.default.readFileSync(dependencyFullPath, 'utf-8');
|
|
67
|
+
const programmingLanguagePhrase = this.config.programmingLanguage
|
|
68
|
+
? `programming language ${this.config.programmingLanguage}`
|
|
69
|
+
: '';
|
|
70
|
+
const prompt = extractDeclarations_1.extractDeclarationsPromptTemplate
|
|
71
|
+
.replace('{{programmingLanguage}}', programmingLanguagePhrase)
|
|
72
|
+
.replace('{{sourceCode}}', sourceCode);
|
|
73
|
+
const promptDescription = `Declarations extraction from ${relativeDependencyPath}`;
|
|
74
|
+
const llmResult = await this.llmProcessor.ask(prompt, undefined, promptDescription);
|
|
75
|
+
if (!llmResult) {
|
|
76
|
+
logger_1.default.error(`LLM returned no declarations for file: '${relativeDependencyPath}'.`);
|
|
77
|
+
hasError = true;
|
|
78
|
+
continue; // Continue to check other dependencies, but flag an error
|
|
79
|
+
}
|
|
80
|
+
declarationsContent = llmResult;
|
|
81
|
+
declarationSource = 'llm';
|
|
82
|
+
this.llmGeneratedFiles.push(relativeDependencyPath);
|
|
83
|
+
cacheManager.updateFileExportsInCache(dependencyFullPath, declarationsContent);
|
|
84
|
+
logger_1.default.trace(`Declarations for '${relativeDependencyPath}' generated by LLM and cached.`);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
logger_1.default.error(`Error processing dependency '${relativeDependencyPath}' with LLM: ${error.message}`);
|
|
88
|
+
hasError = true;
|
|
89
|
+
continue; // Continue on error
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (declarationsContent) {
|
|
93
|
+
this.dependenciesDeclarations.push({
|
|
94
|
+
relativePath: relativeDependencyPath,
|
|
95
|
+
content: declarationsContent,
|
|
96
|
+
source: declarationSource,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (hasError && !this.isPreliminary) {
|
|
101
|
+
logger_1.default.info(`Dependencies declarations retrieval completed with errors for '${sviFile.getSviFileName()}'.`);
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
logger_1.default.info(`Dependencies declarations retrieved for '${sviFile.getSviFileName()}'.`);
|
|
106
|
+
if (this.llmGeneratedFiles.length > 0) {
|
|
107
|
+
logger_1.default.info(` Generated by LLM: ${this.llmGeneratedFiles.join(', ')}`);
|
|
108
|
+
}
|
|
109
|
+
if (this.cacheUsedFiles.length > 0) {
|
|
110
|
+
logger_1.default.info(` From cache: ${this.cacheUsedFiles.join(', ')}`);
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
getDependenciesDeclarationsAsString() {
|
|
116
|
+
if (this.dependenciesDeclarations.length === 0) {
|
|
117
|
+
return '';
|
|
118
|
+
}
|
|
119
|
+
const declarationStrings = this.dependenciesDeclarations.map(dep => {
|
|
120
|
+
// Format: "Declarations from file: <path>\n\n<content>\n"
|
|
121
|
+
return `Declarations from file: ${dep.relativePath}\n\n${dep.content}\n`;
|
|
122
|
+
});
|
|
123
|
+
// Join with an empty line between each block, resulting in the format:
|
|
124
|
+
// Block1\n
|
|
125
|
+
// \n
|
|
126
|
+
// Block2\n
|
|
127
|
+
// Which means:
|
|
128
|
+
// Header1
|
|
129
|
+
//
|
|
130
|
+
// Content1
|
|
131
|
+
//
|
|
132
|
+
// Header2
|
|
133
|
+
//
|
|
134
|
+
// Content2
|
|
135
|
+
return declarationStrings.join('\n');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
exports.default = SviDependencies;
|
|
139
|
+
//# sourceMappingURL=sviDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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EAAuE;QACvE,WAAW;QACX,KAAK;QACL,WAAW;QACX,eAAe;QACf,UAAU;QACV,EAAE;QACF,WAAW;QACX,EAAE;QACF,UAAU;QACV,EAAE;QACF,WAAW;QACX,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AAjJD,kCAiJC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const config_1 = require("../config/config");
|
|
8
|
+
const file_1 = require("../utils/file");
|
|
9
|
+
class SviFileClass {
|
|
10
|
+
constructor(data) {
|
|
11
|
+
this.filePath = data?.filePath;
|
|
12
|
+
this.destinationFile = data?.destinationFile;
|
|
13
|
+
this.dependencies = data?.dependencies;
|
|
14
|
+
this.output = data?.output;
|
|
15
|
+
this.options = data?.options;
|
|
16
|
+
this.importPrompts = data?.importPrompts;
|
|
17
|
+
this.prompt = data?.prompt;
|
|
18
|
+
}
|
|
19
|
+
getSviFileName() {
|
|
20
|
+
if (!this.filePath) {
|
|
21
|
+
throw new Error("SVIFile filePath is not defined, cannot get file name.");
|
|
22
|
+
}
|
|
23
|
+
return path_1.default.basename(this.filePath);
|
|
24
|
+
}
|
|
25
|
+
getSviFileDirectory() {
|
|
26
|
+
if (!this.filePath) {
|
|
27
|
+
throw new Error("SVIFile filePath is not defined, cannot get file directory.");
|
|
28
|
+
}
|
|
29
|
+
return path_1.default.dirname(path_1.default.resolve(this.filePath));
|
|
30
|
+
}
|
|
31
|
+
getSviFileRelativePath() {
|
|
32
|
+
if (!this.filePath) {
|
|
33
|
+
throw new Error("SVIFile filePath is not defined, cannot get relative path.");
|
|
34
|
+
}
|
|
35
|
+
const config = config_1.Config.getInstance();
|
|
36
|
+
return (0, file_1.getRelativePath)(path_1.default.resolve(this.filePath), config.dir);
|
|
37
|
+
}
|
|
38
|
+
getSviFileFullPath() {
|
|
39
|
+
if (!this.filePath) {
|
|
40
|
+
throw new Error("SVIFile filePath is not defined, cannot get full path.");
|
|
41
|
+
}
|
|
42
|
+
return path_1.default.resolve(this.filePath);
|
|
43
|
+
}
|
|
44
|
+
getDestinationFileFullPath() {
|
|
45
|
+
if (!this.destinationFile) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if (!this.filePath) {
|
|
49
|
+
// If SVI file path is not defined, we cannot resolve the destination file relative to it.
|
|
50
|
+
// The interface allows `undefined`, so returning `undefined` is appropriate here.
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return path_1.default.resolve(this.getSviFileDirectory(), this.destinationFile);
|
|
54
|
+
}
|
|
55
|
+
getDestinationFileRelativePath() {
|
|
56
|
+
const fullPath = this.getDestinationFileFullPath();
|
|
57
|
+
if (!fullPath) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const config = config_1.Config.getInstance();
|
|
61
|
+
return (0, file_1.getRelativePath)(fullPath, config.dir);
|
|
62
|
+
}
|
|
63
|
+
getImportPromptsFullPaths() {
|
|
64
|
+
if (!this.importPrompts || this.importPrompts.length === 0) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
if (!this.filePath) {
|
|
68
|
+
// Cannot resolve full paths without the base SVI file path.
|
|
69
|
+
// Returning an empty array to comply with the interface type.
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
const sviFileDir = this.getSviFileDirectory();
|
|
73
|
+
const config = config_1.Config.getInstance();
|
|
74
|
+
return this.importPrompts.map(relativePath => {
|
|
75
|
+
const fullPath = path_1.default.resolve(sviFileDir, relativePath);
|
|
76
|
+
const configRelativePath = (0, file_1.getRelativePath)(fullPath, config.dir);
|
|
77
|
+
return {
|
|
78
|
+
relativePath: configRelativePath,
|
|
79
|
+
fullPath: fullPath,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
getDependenciesFullPaths() {
|
|
84
|
+
if (!this.dependencies || this.dependencies.length === 0) {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
if (!this.filePath) {
|
|
88
|
+
// Cannot resolve full paths without the base SVI file path.
|
|
89
|
+
// Returning an empty array to comply with the interface type.
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const sviFileDir = this.getSviFileDirectory();
|
|
93
|
+
const config = config_1.Config.getInstance();
|
|
94
|
+
return this.dependencies.map(relativePath => {
|
|
95
|
+
const fullPath = path_1.default.resolve(sviFileDir, relativePath);
|
|
96
|
+
const configRelativePath = (0, file_1.getRelativePath)(fullPath, config.dir);
|
|
97
|
+
return {
|
|
98
|
+
relativePath: configRelativePath,
|
|
99
|
+
fullPath: fullPath,
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.default = SviFileClass;
|
|
105
|
+
//# sourceMappingURL=sviFileClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sviFileClass.js","sourceRoot":"","sources":["../../../src/svi/sviFileClass.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,6CAA0C;AAC1C,wCAAgD;AAGhD,MAAqB,YAAY;IAS/B,YAAY,IAAuB;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAE,QAAQ,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,EAAE,eAAe,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,EAAE,YAAY,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,OAAO,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,EAAE,aAAa,CAAC;QACz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EAAE,CAAC;QACZ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,4DAA4D;YAC5D,8DAA8D;YAC9D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC;QAEpC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC1C,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;YACxD,MAAM,kBAAkB,GAAG,IAAA,sBAAe,EAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,YAAY,EAAE,kBAAkB;gBAChC,QAAQ,EAAE,QAAQ;aACnB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlHD,+BAkHC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class SviDependencyCycleAnalyzer {
|
|
4
|
+
constructor(sviDependencies) {
|
|
5
|
+
this._sviDependencies = sviDependencies;
|
|
6
|
+
this._graph = new Map();
|
|
7
|
+
this._fileMap = new Map();
|
|
8
|
+
this._cycles = [];
|
|
9
|
+
this._fileToCyclesMap = new Map();
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Analyzes the sviDependencies[] array to detect dependency cycles.
|
|
13
|
+
* This method populates internal structures used by `isFileInCycle` and `areFilesInTheSameCycle`.
|
|
14
|
+
*/
|
|
15
|
+
findCycles() {
|
|
16
|
+
this._buildGraph(); // Construct the graph representation
|
|
17
|
+
this._cycles = []; // Reset detected cycles
|
|
18
|
+
this._fileToCyclesMap = new Map(); // Reset map for file-to-cycle associations
|
|
19
|
+
const states = new Map(); // Stores the DFS state for each node
|
|
20
|
+
const path = []; // Stores the current path in the DFS traversal
|
|
21
|
+
// Initialize all nodes (files) as unvisited
|
|
22
|
+
for (const fileFullPath of this._fileMap.keys()) {
|
|
23
|
+
states.set(fileFullPath, 0);
|
|
24
|
+
}
|
|
25
|
+
// Iterate over all files to ensure that all connected components of the graph are visited
|
|
26
|
+
// This allows detection of cycles in disconnected parts of the dependency graph.
|
|
27
|
+
for (const fileFullPath of this._fileMap.keys()) {
|
|
28
|
+
if (states.get(fileFullPath) === 0) {
|
|
29
|
+
this._dfs(fileFullPath, states, path);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Recursive Depth-First Search (DFS) function to detect cycles.
|
|
35
|
+
* @param currentFileFullPath The full path of the SVIFile currently being visited.
|
|
36
|
+
* @param states A map tracking the state (unvisited, visiting, visited) of each node.
|
|
37
|
+
* @param path An array representing the current recursion path, used to reconstruct cycles.
|
|
38
|
+
*/
|
|
39
|
+
_dfs(currentFileFullPath, states, path) {
|
|
40
|
+
states.set(currentFileFullPath, 1); // Mark current node as 'visiting' (in recursion stack)
|
|
41
|
+
path.push(currentFileFullPath); // Add current node to the current path
|
|
42
|
+
const dependencies = this._graph.get(currentFileFullPath) || [];
|
|
43
|
+
for (const dependentFileFullPath of dependencies) {
|
|
44
|
+
if (states.get(dependentFileFullPath) === 0) {
|
|
45
|
+
// Neighbor is unvisited, continue DFS
|
|
46
|
+
this._dfs(dependentFileFullPath, states, path);
|
|
47
|
+
}
|
|
48
|
+
else if (states.get(dependentFileFullPath) === 1) {
|
|
49
|
+
// Neighbor is 'visiting', meaning it's already in the current recursion stack.
|
|
50
|
+
// This indicates a back-edge and thus a cycle.
|
|
51
|
+
this._handleCycleDetection(dependentFileFullPath, path);
|
|
52
|
+
}
|
|
53
|
+
// If state is 2 (visited), ignore it as it's already processed and won't lead to new cycles from this path.
|
|
54
|
+
}
|
|
55
|
+
path.pop(); // Remove current node from path (backtrack)
|
|
56
|
+
states.set(currentFileFullPath, 2); // Mark current node as 'visited' (finished processing)
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Extracts and stores a detected cycle.
|
|
60
|
+
* @param cycleStartFileFullPath The full path of the file where the cycle begins (the node that was 'visiting').
|
|
61
|
+
* @param currentPath The current DFS path, from which the cycle will be extracted.
|
|
62
|
+
*/
|
|
63
|
+
_handleCycleDetection(cycleStartFileFullPath, currentPath) {
|
|
64
|
+
const cycleStartIndex = currentPath.indexOf(cycleStartFileFullPath);
|
|
65
|
+
if (cycleStartIndex === -1) {
|
|
66
|
+
// This scenario should ideally not occur if the DFS logic is correct.
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Extract the file paths that form the cycle from the current DFS path.
|
|
70
|
+
const cycleFilePaths = currentPath.slice(cycleStartIndex);
|
|
71
|
+
const newCycle = [];
|
|
72
|
+
// Convert file paths back to SVIFile objects for storage.
|
|
73
|
+
for (const filePath of cycleFilePaths) {
|
|
74
|
+
const sviFile = this._fileMap.get(filePath);
|
|
75
|
+
if (sviFile) {
|
|
76
|
+
newCycle.push(sviFile);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (newCycle.length > 0) {
|
|
80
|
+
const cycleIndex = this._cycles.length; // Assign a unique index to the new cycle
|
|
81
|
+
this._cycles.push(newCycle); // Store the cycle
|
|
82
|
+
// Update the mapping from each file in the cycle to its corresponding cycle index.
|
|
83
|
+
for (const fileInCycle of newCycle) {
|
|
84
|
+
const fileFullPath = fileInCycle.getSviFileFullPath();
|
|
85
|
+
if (!this._fileToCyclesMap.has(fileFullPath)) {
|
|
86
|
+
this._fileToCyclesMap.set(fileFullPath, new Set());
|
|
87
|
+
}
|
|
88
|
+
this._fileToCyclesMap.get(fileFullPath)?.add(cycleIndex);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Builds the graph representation (adjacency list) and the file map from the provided SviDependency array.
|
|
94
|
+
* This prepares the data for the cycle detection algorithm.
|
|
95
|
+
*/
|
|
96
|
+
_buildGraph() {
|
|
97
|
+
this._graph.clear();
|
|
98
|
+
this._fileMap.clear();
|
|
99
|
+
for (const dep of this._sviDependencies) {
|
|
100
|
+
const currentFileFullPath = dep.SVIFile.getSviFileFullPath();
|
|
101
|
+
this._fileMap.set(currentFileFullPath, dep.SVIFile);
|
|
102
|
+
// Ensure an entry exists for the current file in the graph, even if it has no dependencies.
|
|
103
|
+
if (!this._graph.has(currentFileFullPath)) {
|
|
104
|
+
this._graph.set(currentFileFullPath, []);
|
|
105
|
+
}
|
|
106
|
+
for (const dependentFile of dep.SviFilesItDependsOn) {
|
|
107
|
+
const dependentFileFullPath = dependentFile.getSviFileFullPath();
|
|
108
|
+
// Add the dependent file to the file map, in case it hasn't been added as a primary SVIFile yet.
|
|
109
|
+
this._fileMap.set(dependentFileFullPath, dependentFile);
|
|
110
|
+
// Add the dependency to the graph's adjacency list.
|
|
111
|
+
this._graph.get(currentFileFullPath)?.push(dependentFileFullPath);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Checks if a given SVIFile is part of at least one dependency cycle.
|
|
117
|
+
* @param sviFile The SVIFile to check.
|
|
118
|
+
* @returns True if the file is contained in any cycle, false otherwise.
|
|
119
|
+
*/
|
|
120
|
+
isFileInCycle(sviFile) {
|
|
121
|
+
const fileFullPath = sviFile.getSviFileFullPath();
|
|
122
|
+
// A file is in a cycle if it has an entry in _fileToCyclesMap and that set is not empty.
|
|
123
|
+
return this._fileToCyclesMap.has(fileFullPath) && (this._fileToCyclesMap.get(fileFullPath)?.size || 0) > 0;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Checks if two SVIFile instances are contained within the same dependency cycle.
|
|
127
|
+
* @param sviFile1 The first SVIFile.
|
|
128
|
+
* @param sviFile2 The second SVIFile.
|
|
129
|
+
* @returns True if both files share at least one common dependency cycle, false otherwise.
|
|
130
|
+
*/
|
|
131
|
+
areFilesInTheSameCycle(sviFile1, sviFile2) {
|
|
132
|
+
const file1FullPath = sviFile1.getSviFileFullPath();
|
|
133
|
+
const file2FullPath = sviFile2.getSviFileFullPath();
|
|
134
|
+
// If either file is not part of any cycle, they cannot be in the same cycle.
|
|
135
|
+
if (!this._fileToCyclesMap.has(file1FullPath) || !this._fileToCyclesMap.has(file2FullPath)) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
const cyclesOfFile1 = this._fileToCyclesMap.get(file1FullPath);
|
|
139
|
+
const cyclesOfFile2 = this._fileToCyclesMap.get(file2FullPath);
|
|
140
|
+
// This null check provides type safety, though it should logically be true given the check above.
|
|
141
|
+
if (!cyclesOfFile1 || !cyclesOfFile2) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
// Iterate through the cycles associated with file1 and check if any are also associated with file2.
|
|
145
|
+
for (const cycleIndex of cyclesOfFile1) {
|
|
146
|
+
if (cyclesOfFile2.has(cycleIndex)) {
|
|
147
|
+
return true; // Found a common cycle index, so they are in the same cycle.
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return false; // No common cycle found between the two files.
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exports.default = SviDependencyCycleAnalyzer;
|
|
154
|
+
//# sourceMappingURL=sviDependencyCycleAnalyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sviDependencyCycleAnalyzer.js","sourceRoot":"","sources":["../../../../src/svi/sviFileOrderOptimizer/sviDependencyCycleAnalyzer.ts"],"names":[],"mappings":";;AAMA,MAAqB,0BAA0B;IAY7C,YAAY,eAAgC;QAC1C,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,GA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AI,CAAC,CAAC,6DAA6D;YAC5E,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,+CAA+C;IAC/D,CAAC;CACF;AA3LD,6CA2LC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class SviDependencyFinder {
|
|
4
|
+
constructor(sviFiles) {
|
|
5
|
+
this.foundDependencies = [];
|
|
6
|
+
this.destinationFileMap = new Map();
|
|
7
|
+
this.sviDependencyMap = new Map();
|
|
8
|
+
this.sviFiles = sviFiles;
|
|
9
|
+
}
|
|
10
|
+
findDependencies() {
|
|
11
|
+
// Step 1. For each SVIFile it detects target file with SVIFile.getDestinationFileFullPath
|
|
12
|
+
// and stores it in a map for efficient lookup.
|
|
13
|
+
this.destinationFileMap.clear();
|
|
14
|
+
for (const sviFile of this.sviFiles) {
|
|
15
|
+
const destinationFullPath = sviFile.getDestinationFileFullPath();
|
|
16
|
+
if (destinationFullPath) {
|
|
17
|
+
this.destinationFileMap.set(destinationFullPath, sviFile);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Step 2. Then it loops through all the svi files, then for each file loops
|
|
21
|
+
// at each file in dependencies (array which is result of SVIFile.getDependenciesFullPaths()),
|
|
22
|
+
// and if a dependency file is among destination files found at step 1, then the source SVIFile
|
|
23
|
+
// for the destination is added to this SVI file dependencies (SviDependency.SviFilesItDependsOn).
|
|
24
|
+
// If no dependencies are found, an empty array is left in the SviDependency interface.
|
|
25
|
+
// The array of SviDependency elements for each of svi files is stored in class attribute.
|
|
26
|
+
this.foundDependencies = [];
|
|
27
|
+
this.sviDependencyMap.clear();
|
|
28
|
+
for (const sourceSviFile of this.sviFiles) {
|
|
29
|
+
const currentSviDependency = {
|
|
30
|
+
SVIFile: sourceSviFile,
|
|
31
|
+
SviFilesItDependsOn: [],
|
|
32
|
+
};
|
|
33
|
+
const declaredDependencies = sourceSviFile.getDependenciesFullPaths();
|
|
34
|
+
for (const declaredDependency of declaredDependencies) {
|
|
35
|
+
const dependentSviFile = this.destinationFileMap.get(declaredDependency.fullPath);
|
|
36
|
+
if (dependentSviFile) {
|
|
37
|
+
currentSviDependency.SviFilesItDependsOn.push(dependentSviFile);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
this.foundDependencies.push(currentSviDependency);
|
|
41
|
+
this.sviDependencyMap.set(sourceSviFile, currentSviDependency);
|
|
42
|
+
}
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
getFoundDependencies() {
|
|
46
|
+
return this.foundDependencies;
|
|
47
|
+
}
|
|
48
|
+
fileDependsOnAnother(sviFile, sviFileItDependsOnOrNot) {
|
|
49
|
+
const dependencyEntry = this.sviDependencyMap.get(sviFile);
|
|
50
|
+
if (!dependencyEntry) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return dependencyEntry.SviFilesItDependsOn.includes(sviFileItDependsOnOrNot);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = SviDependencyFinder;
|
|
57
|
+
//# sourceMappingURL=sviDependencyFinder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sviDependencyFinder.js","sourceRoot":"","sources":["../../../../src/svi/sviFileOrderOptimizer/sviDependencyFinder.ts"],"names":[],"mappings":";;AAIA,MAAqB,mBAAmB;IAMtC,YAAY,QAAmB;QAJvB,sBAAiB,GAAoB,EAAE,CAAC;QACxC,uBAAkB,GAAyB,IAAI,GAAG,EAAE,CAAC;QACrD,qBAAgB,GAAgC,IAAI,GAAG,EAAE,CAAC;QAGhE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,gBAAgB;QACd,0FAA0F;QAC1F,+CAA+C;QAC/C,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC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OAAO,CAAC,CAAC;QAE3D,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,eAAe,CAAC,mBAAmB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IAC/E,CAAC;CACF;AA/DD,sCA+DC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const sviDependencyFinder_1 = __importDefault(require("./sviDependencyFinder"));
|
|
7
|
+
const sviDependencyCycleAnalyzer_1 = __importDefault(require("./sviDependencyCycleAnalyzer")); // Assuming class name is SviDependencyCycleAnalyzer
|
|
8
|
+
class SviFileOrderOptimizer {
|
|
9
|
+
constructor(sviFiles) {
|
|
10
|
+
this.optimizedResult = null;
|
|
11
|
+
this.sviFiles = sviFiles;
|
|
12
|
+
}
|
|
13
|
+
computeOptimizedOrder() {
|
|
14
|
+
// 1. Run SviDependencyFinder class to get an array of dependencies
|
|
15
|
+
const dependencyFinder = new sviDependencyFinder_1.default(this.sviFiles);
|
|
16
|
+
dependencyFinder.findDependencies();
|
|
17
|
+
const dependencies = dependencyFinder.getFoundDependencies();
|
|
18
|
+
// 2. Create an instance of SviDependencyCycleAnalyzer class and run
|
|
19
|
+
// the findCycles method to prepare for other methods calls.
|
|
20
|
+
const cycleAnalyzer = new sviDependencyCycleAnalyzer_1.default(dependencies);
|
|
21
|
+
cycleAnalyzer.findCycles();
|
|
22
|
+
let swappedOverall;
|
|
23
|
+
// Store full paths of files identified for preliminary generation
|
|
24
|
+
const preliminarySviFilesSet = new Set();
|
|
25
|
+
// Create a mutable copy of the initial sviFiles array to optimize its order
|
|
26
|
+
const currentOptimizedOrder = [...this.sviFiles];
|
|
27
|
+
// 7. If after all loops at least one swap has been done, then repeat these loops.
|
|
28
|
+
// This do-while loop ensures the entire sorting process is repeated as long as swaps occur.
|
|
29
|
+
do {
|
|
30
|
+
swappedOverall = false; // Reset for each full pass of the sorting algorithm
|
|
31
|
+
// 3. Loop at every svi file in the initial sviFiles array, current file is sviFile1
|
|
32
|
+
for (let i = 0; i < currentOptimizedOrder.length; i++) {
|
|
33
|
+
// 4. In each iteration, loop at all files starting from the next after the current
|
|
34
|
+
// till the last one, let it be sviFile2
|
|
35
|
+
for (let j = i + 1; j < currentOptimizedOrder.length; j++) {
|
|
36
|
+
const sviFile1 = currentOptimizedOrder[i];
|
|
37
|
+
const sviFile2 = currentOptimizedOrder[j];
|
|
38
|
+
// 5. For each pair of sviFile1 and sviFile2 use the result of
|
|
39
|
+
// SviDependencyFinder to check if sviFile1 depends on sviFile2
|
|
40
|
+
if (dependencyFinder.fileDependsOnAnother(sviFile1, sviFile2)) {
|
|
41
|
+
// 6. If it is true, then check if sviFile1 and sviFile2 are both in a dependency cycle
|
|
42
|
+
// by calling SviDependencyCycleAnalyzer.isFileInCycle and if it is the case then
|
|
43
|
+
// check if they are in the same cycle by calling
|
|
44
|
+
// SviDependencyCycleAnalyzer.areFilesInTheSameCycle.
|
|
45
|
+
const isFile1InCycle = cycleAnalyzer.isFileInCycle(sviFile1);
|
|
46
|
+
const isFile2InCycle = cycleAnalyzer.isFileInCycle(sviFile2);
|
|
47
|
+
if (isFile1InCycle && isFile2InCycle && cycleAnalyzer.areFilesInTheSameCycle(sviFile1, sviFile2)) {
|
|
48
|
+
// If true, then add this file to a separate array of files that need a preliminary generation
|
|
49
|
+
preliminarySviFilesSet.add(sviFile1.getSviFileFullPath());
|
|
50
|
+
preliminarySviFilesSet.add(sviFile2.getSviFileFullPath());
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// If false (i.e., dependency exists but not in the same cycle, or not in a cycle),
|
|
54
|
+
// then swap sviFile1 and sviFile2 in the list of svi files.
|
|
55
|
+
[currentOptimizedOrder[i], currentOptimizedOrder[j]] = [currentOptimizedOrder[j], currentOptimizedOrder[i]];
|
|
56
|
+
swappedOverall = true;
|
|
57
|
+
// A swap occurred, which means the order has changed.
|
|
58
|
+
// The algorithm requires repeating "these loops" if any swap has been done.
|
|
59
|
+
// To achieve this, we break out of the current nested loops and let the do-while
|
|
60
|
+
// condition re-start the entire iteration from the beginning of the `currentOptimizedOrder`.
|
|
61
|
+
i = currentOptimizedOrder.length; // Force the outer loop to terminate
|
|
62
|
+
break; // Break the inner loop
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} while (swappedOverall); // Repeat as long as swaps were made in the last full pass
|
|
68
|
+
// 7. If not [swapped], then add the unique list in preliminarySviFiles array in the beginning with
|
|
69
|
+
// flag isPreliminary to the result or type SviFileToLoad[].
|
|
70
|
+
// 8. Save the result
|
|
71
|
+
this.optimizedResult = [];
|
|
72
|
+
// Add unique preliminary files first with isPreliminary: true
|
|
73
|
+
for (const preliminaryFilePath of preliminarySviFilesSet) {
|
|
74
|
+
this.optimizedResult.push({ filePath: preliminaryFilePath, isPreliminary: true });
|
|
75
|
+
}
|
|
76
|
+
// Then, add all files from the final optimized order as non-preliminary.
|
|
77
|
+
// Files that were identified as preliminary will appear again here, as required
|
|
78
|
+
// ("If the file is created with a preliminary version, it must be in the array again later
|
|
79
|
+
// to be regenerated in the final version.").
|
|
80
|
+
for (const sviFile of currentOptimizedOrder) {
|
|
81
|
+
this.optimizedResult.push({ filePath: sviFile.getSviFileFullPath(), isPreliminary: false });
|
|
82
|
+
}
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
getOptimizedFiles() {
|
|
86
|
+
if (this.optimizedResult === null) {
|
|
87
|
+
throw new Error("computeOptimizedOrder must be called before getOptimizedFiles to compute the order.");
|
|
88
|
+
}
|
|
89
|
+
return this.optimizedResult;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.default = SviFileOrderOptimizer;
|
|
93
|
+
//# sourceMappingURL=sviFileOrderOptimizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sviFileOrderOptimizer.js","sourceRoot":"","sources":["../../../../src/svi/sviFileOrderOptimizer/sviFileOrderOptimizer.ts"],"names":[],"mappings":";;;;;AAEA,gFAAwD;AACxD,8FAAsE,CAAC,oDAAoD;AAE3H,MAAqB,qBAAqB;IAIxC,YAAY,QAAmB;QAFvB,oBAAe,GAA2B,IAAI,CAAC;QAGrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,qBAAqB;QACnB,mEAAmE;QACnE,MAAM,gBAAgB,GAAG,IAAI,6BAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChE,gBAAgB,CAAC,gBAAgB,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;QAE7D,oEAAoE;QACpE,4DAA4D;QAC5D,MAAM,aAAa,GAAG,IAAI,oCAA0B,CAAC,YAAY,CAAC,CAAC;QACnE,aAAa,CAAC,UAAU,EAAE,CAAC;QAE3B,IAAI,cAAuB,CAAC;QAC5B,kEAAkE;QAClE,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAU,CAAC;QACjD,4EAA4E;QAC5E,MAAM,qBAAqB,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEjD,kFAAkF;QAClF,4FAA4F;QAC5F,GAAG,CAAC;YACF,cAAc,GAAG,KAAK,CAAC,CAAC,oDAAoD;YAC5E,oFAAoF;YACpF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,qBAAqB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtD,mFAAmF;gBACnF,wCAAwC;gBACxC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,qBAAqB,CAAC,MAAM,EAAE,CAAC,EAAE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