This commit is contained in:
Max Sveshnikov 2024-09-07 10:45:29 +02:00
parent 2cac0f1ec3
commit a2e8aa399f
3 changed files with 19 additions and 3 deletions

View file

@ -14,10 +14,18 @@ const ProjectManagerAgent = {
async run(projectStructure, readme) {
console.log(chalk.cyan("🚀 Project Manager Agent starting..."));
await this.orchestrateAgents(projectStructure, readme);
await this.buildApp();
await this.runTests();
await this.performUIChecks();
await this.checkDependencies();
await this.optimizeAssets();
await this.monitorPerformance();
await this.generateDockerfile();
await this.setupCICD();
await this.generateChangeLog();
await this.setupEnvironmentConfig();
await this.generateBuildScript();
await this.orchestrateAgents(projectStructure, readme);
console.log(chalk.green("✅ Project Manager Agent completed its tasks."));
},

View file

@ -86,3 +86,4 @@ AutoCode currently supports the following programming languages:
- Swift
Each language has its own configuration for file extensions, recommended linter, formatter, and package manager.

View file

@ -17,6 +17,7 @@ class TesterAgent {
await this.generateIntegrationTests(projectStructure, readme);
await this.generateUnitTests(projectStructure, readme);
await this.runTests();
await this.optimizeTests();
console.log("Tester Agent completed.");
}
@ -74,7 +75,7 @@ Generate a complete Jest test file for this endpoint. Include necessary imports,
messages: [{ role: "user", content: prompt }],
});
const testContent = response.content[0].text;
const testContent = this.extractCodeSnippet(response.content[0].text);
const testFileName = `${endpoint.file.replace(".js", "")}.test.js`;
const testFilePath = path.join(process.cwd(), this.testsDirectory, testFileName);
@ -122,7 +123,7 @@ Generate a complete Jest test file for this module. Include necessary imports, m
messages: [{ role: "user", content: prompt }],
});
const testContent = response.content[0].text;
const testContent = this.extractCodeSnippet(response.content[0].text);
const testFileName = `${path.basename(file, ".js")}.test.js`;
const testFilePath = path.join(process.cwd(), this.testsDirectory, testFileName);
@ -157,6 +158,12 @@ Generate a complete Jest test file for this module. Include necessary imports, m
await FileManager.write(testFile, optimizedContent);
}
}
extractCodeSnippet(text) {
const codeBlockRegex = /```(?:javascript|js)?\n([\s\S]*?)\n```/;
const match = text.match(codeBlockRegex);
return match ? match[1] : text;
}
}
export default new TesterAgent();