mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
feat(automaker): enhance feature management and UI components
- Updated `.gitignore` to include agent context files and user-uploaded images for better organization. - Added "Uncategorized" category to `categories.json` for improved feature classification. - Populated `feature_list.json` with new features, including detailed descriptions and image attachments for better context. - Changed application icon to `icon_gold.png` for a refreshed look. - Enhanced `AutoModeService` to support max concurrency and periodic checks, improving feature execution management. - Updated image handling in `DescriptionImageDropZone` to save images in the project directory. - Improved UI components with better styling and responsiveness, including drag-and-drop functionality for project management. This update significantly enhances the feature management process and user experience within the application.
This commit is contained in:
@@ -75,7 +75,57 @@ class FeatureExecutor {
|
||||
};
|
||||
|
||||
// Build the prompt for this specific feature
|
||||
const prompt = promptBuilder.buildFeaturePrompt(feature);
|
||||
let prompt = promptBuilder.buildFeaturePrompt(feature);
|
||||
|
||||
// Add images to prompt if feature has imagePaths
|
||||
if (feature.imagePaths && feature.imagePaths.length > 0) {
|
||||
const contentBlocks = [];
|
||||
|
||||
// Add text block
|
||||
contentBlocks.push({
|
||||
type: "text",
|
||||
text: prompt,
|
||||
});
|
||||
|
||||
// Add image blocks
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
for (const imagePathObj of feature.imagePaths) {
|
||||
try {
|
||||
const imagePath = imagePathObj.path;
|
||||
const imageBuffer = fs.readFileSync(imagePath);
|
||||
const base64Data = imageBuffer.toString("base64");
|
||||
const ext = path.extname(imagePath).toLowerCase();
|
||||
const mimeTypeMap = {
|
||||
".jpg": "image/jpeg",
|
||||
".jpeg": "image/jpeg",
|
||||
".png": "image/png",
|
||||
".gif": "image/gif",
|
||||
".webp": "image/webp",
|
||||
};
|
||||
const mediaType = mimeTypeMap[ext] || imagePathObj.mimeType || "image/png";
|
||||
|
||||
contentBlocks.push({
|
||||
type: "image",
|
||||
source: {
|
||||
type: "base64",
|
||||
media_type: mediaType,
|
||||
data: base64Data,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(`[FeatureExecutor] Added image to prompt: ${imagePath}`);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`[FeatureExecutor] Failed to load image ${imagePathObj.path}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Use content blocks instead of plain text
|
||||
prompt = contentBlocks;
|
||||
}
|
||||
|
||||
// Planning: Analyze the codebase and create implementation plan
|
||||
sendToRenderer({
|
||||
@@ -274,7 +324,58 @@ class FeatureExecutor {
|
||||
};
|
||||
|
||||
// Build prompt with previous context
|
||||
const prompt = promptBuilder.buildResumePrompt(feature, previousContext);
|
||||
let prompt = promptBuilder.buildResumePrompt(feature, previousContext);
|
||||
|
||||
// Add images to prompt if feature has imagePaths or followUpImages
|
||||
const imagePaths = feature.followUpImages || feature.imagePaths;
|
||||
if (imagePaths && imagePaths.length > 0) {
|
||||
const contentBlocks = [];
|
||||
|
||||
// Add text block
|
||||
contentBlocks.push({
|
||||
type: "text",
|
||||
text: prompt,
|
||||
});
|
||||
|
||||
// Add image blocks
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
for (const imagePathObj of imagePaths) {
|
||||
try {
|
||||
const imagePath = imagePathObj.path;
|
||||
const imageBuffer = fs.readFileSync(imagePath);
|
||||
const base64Data = imageBuffer.toString("base64");
|
||||
const ext = path.extname(imagePath).toLowerCase();
|
||||
const mimeTypeMap = {
|
||||
".jpg": "image/jpeg",
|
||||
".jpeg": "image/jpeg",
|
||||
".png": "image/png",
|
||||
".gif": "image/gif",
|
||||
".webp": "image/webp",
|
||||
};
|
||||
const mediaType = mimeTypeMap[ext] || imagePathObj.mimeType || "image/png";
|
||||
|
||||
contentBlocks.push({
|
||||
type: "image",
|
||||
source: {
|
||||
type: "base64",
|
||||
media_type: mediaType,
|
||||
data: base64Data,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(`[FeatureExecutor] Added image to resume prompt: ${imagePath}`);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`[FeatureExecutor] Failed to load image ${imagePathObj.path}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Use content blocks instead of plain text
|
||||
prompt = contentBlocks;
|
||||
}
|
||||
|
||||
const currentQuery = query({ prompt, options });
|
||||
execution.query = currentQuery;
|
||||
|
||||
@@ -10,6 +10,10 @@ class PromptBuilder {
|
||||
? `\n**⚠️ IMPORTANT - Manual Testing Mode:**\nThis feature has skipTests=true, which means:\n- DO NOT commit changes automatically\n- DO NOT mark as verified - it will automatically go to "waiting_approval" status\n- The user will manually review and commit the changes\n- Just implement the feature and mark it as verified (it will be converted to waiting_approval)\n`
|
||||
: "";
|
||||
|
||||
const imagesNote = feature.imagePaths && feature.imagePaths.length > 0
|
||||
? `\n**📎 Context Images Attached:**\nThe user has attached ${feature.imagePaths.length} image(s) for context. These images will be provided to you visually to help understand the requirements. Review them carefully before implementing.\n`
|
||||
: "";
|
||||
|
||||
return `You are working on a feature implementation task.
|
||||
|
||||
**Current Feature to Implement:**
|
||||
@@ -17,7 +21,7 @@ class PromptBuilder {
|
||||
ID: ${feature.id}
|
||||
Category: ${feature.category}
|
||||
Description: ${feature.description}
|
||||
${skipTestsNote}
|
||||
${skipTestsNote}${imagesNote}
|
||||
**Steps to Complete:**
|
||||
${feature.steps.map((step, i) => `${i + 1}. ${step}`).join("\n")}
|
||||
|
||||
@@ -117,6 +121,10 @@ Begin by reading the project structure and then implementing the feature.`;
|
||||
? `\n**⚠️ IMPORTANT - Manual Testing Mode:**\nThis feature has skipTests=true, which means:\n- DO NOT commit changes automatically\n- DO NOT mark as verified - it will automatically go to "waiting_approval" status\n- The user will manually review and commit the changes\n- Just implement the feature and mark it as verified (it will be converted to waiting_approval)\n`
|
||||
: "";
|
||||
|
||||
const imagesNote = feature.imagePaths && feature.imagePaths.length > 0
|
||||
? `\n**📎 Context Images Attached:**\nThe user has attached ${feature.imagePaths.length} image(s) for context. These images will be provided to you visually to help understand the requirements. Review them carefully before implementing.\n`
|
||||
: "";
|
||||
|
||||
return `You are implementing and verifying a feature until it is complete and working correctly.
|
||||
|
||||
**Feature to Implement/Verify:**
|
||||
@@ -125,7 +133,7 @@ ID: ${feature.id}
|
||||
Category: ${feature.category}
|
||||
Description: ${feature.description}
|
||||
Current Status: ${feature.status}
|
||||
${skipTestsNote}
|
||||
${skipTestsNote}${imagesNote}
|
||||
**Steps that should be implemented:**
|
||||
${feature.steps.map((step, i) => `${i + 1}. ${step}`).join("\n")}
|
||||
|
||||
@@ -216,6 +224,10 @@ Begin by reading the project structure and understanding what needs to be implem
|
||||
? `\n**⚠️ IMPORTANT - Manual Testing Mode:**\nThis feature has skipTests=true, which means:\n- DO NOT commit changes automatically\n- DO NOT mark as verified - it will automatically go to "waiting_approval" status\n- The user will manually review and commit the changes\n- Just implement the feature and mark it as verified (it will be converted to waiting_approval)\n`
|
||||
: "";
|
||||
|
||||
const imagesNote = feature.imagePaths && feature.imagePaths.length > 0
|
||||
? `\n**📎 Context Images Attached:**\nThe user has attached ${feature.imagePaths.length} image(s) for context. These images will be provided to you visually to help understand the requirements. Review them carefully.\n`
|
||||
: "";
|
||||
|
||||
return `You are resuming work on a feature implementation that was previously started.
|
||||
|
||||
**Current Feature:**
|
||||
@@ -223,7 +235,7 @@ Begin by reading the project structure and understanding what needs to be implem
|
||||
ID: ${feature.id}
|
||||
Category: ${feature.category}
|
||||
Description: ${feature.description}
|
||||
${skipTestsNote}
|
||||
${skipTestsNote}${imagesNote}
|
||||
**Steps to Complete:**
|
||||
${feature.steps.map((step, i) => `${i + 1}. ${step}`).join("\n")}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user