mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: add GitHub setup step and enhance setup flow
- Introduced a new GitHubSetupStep component for GitHub CLI configuration during the setup process. - Updated SetupView to include the GitHub step in the setup flow, allowing users to skip or proceed based on their GitHub CLI status. - Enhanced state management to track GitHub CLI installation and authentication status. - Added logging for transitions between setup steps to improve user feedback. - Updated related files to ensure cross-platform path normalization and compatibility.
This commit is contained in:
@@ -337,8 +337,8 @@ export class AutoModeService {
|
||||
featureId: string,
|
||||
useWorktrees = true
|
||||
): Promise<void> {
|
||||
// Check if context exists in external automaker directory
|
||||
const featureDir = await getFeatureDir(projectPath, featureId);
|
||||
// Check if context exists in .automaker directory
|
||||
const featureDir = getFeatureDir(projectPath, featureId);
|
||||
const contextPath = path.join(featureDir, "agent-output.md");
|
||||
|
||||
let hasContext = false;
|
||||
@@ -399,8 +399,8 @@ export class AutoModeService {
|
||||
// Load feature info for context
|
||||
const feature = await this.loadFeature(projectPath, featureId);
|
||||
|
||||
// Load previous agent output if it exists (from external automaker)
|
||||
const featureDir = await getFeatureDir(projectPath, featureId);
|
||||
// Load previous agent output if it exists
|
||||
const featureDir = getFeatureDir(projectPath, featureId);
|
||||
const contextPath = path.join(featureDir, "agent-output.md");
|
||||
let previousContext = "";
|
||||
try {
|
||||
@@ -461,10 +461,10 @@ Address the follow-up instructions above. Review the previous work and make the
|
||||
// Update feature status to in_progress
|
||||
await this.updateFeatureStatus(projectPath, featureId, "in_progress");
|
||||
|
||||
// Copy follow-up images to feature folder (external automaker)
|
||||
// Copy follow-up images to feature folder
|
||||
const copiedImagePaths: string[] = [];
|
||||
if (imagePaths && imagePaths.length > 0) {
|
||||
const featureDirForImages = await getFeatureDir(projectPath, featureId);
|
||||
const featureDirForImages = getFeatureDir(projectPath, featureId);
|
||||
const featureImagesDir = path.join(featureDirForImages, "images");
|
||||
|
||||
await fs.mkdir(featureImagesDir, { recursive: true });
|
||||
@@ -512,9 +512,9 @@ Address the follow-up instructions above. Review the previous work and make the
|
||||
allImagePaths.push(...allPaths);
|
||||
}
|
||||
|
||||
// Save updated feature.json with new images (external automaker)
|
||||
// Save updated feature.json with new images
|
||||
if (copiedImagePaths.length > 0 && feature) {
|
||||
const featureDirForSave = await getFeatureDir(projectPath, featureId);
|
||||
const featureDirForSave = getFeatureDir(projectPath, featureId);
|
||||
const featurePath = path.join(featureDirForSave, "feature.json");
|
||||
|
||||
try {
|
||||
@@ -707,8 +707,8 @@ Address the follow-up instructions above. Review the previous work and make the
|
||||
projectPath: string,
|
||||
featureId: string
|
||||
): Promise<boolean> {
|
||||
// Context is stored in external automaker directory
|
||||
const featureDir = await getFeatureDir(projectPath, featureId);
|
||||
// Context is stored in .automaker directory
|
||||
const featureDir = getFeatureDir(projectPath, featureId);
|
||||
const contextPath = path.join(featureDir, "agent-output.md");
|
||||
|
||||
try {
|
||||
@@ -782,8 +782,8 @@ Format your response as a structured markdown document.`;
|
||||
}
|
||||
}
|
||||
|
||||
// Save analysis to external automaker directory
|
||||
const automakerDir = await getAutomakerDir(projectPath);
|
||||
// Save analysis to .automaker directory
|
||||
const automakerDir = getAutomakerDir(projectPath);
|
||||
const analysisPath = path.join(automakerDir, "project-analysis.md");
|
||||
await fs.mkdir(automakerDir, { recursive: true });
|
||||
await fs.writeFile(analysisPath, analysisResult);
|
||||
@@ -844,7 +844,7 @@ Format your response as a structured markdown document.`;
|
||||
featureId: string,
|
||||
branchName: string
|
||||
): Promise<string> {
|
||||
// Git worktrees stay in project directory (not external automaker)
|
||||
// Git worktrees stay in project directory
|
||||
const worktreesDir = path.join(projectPath, ".worktrees");
|
||||
const worktreePath = path.join(worktreesDir, featureId);
|
||||
|
||||
@@ -883,8 +883,8 @@ Format your response as a structured markdown document.`;
|
||||
projectPath: string,
|
||||
featureId: string
|
||||
): Promise<Feature | null> {
|
||||
// Features are stored in external automaker directory
|
||||
const featureDir = await getFeatureDir(projectPath, featureId);
|
||||
// Features are stored in .automaker directory
|
||||
const featureDir = getFeatureDir(projectPath, featureId);
|
||||
const featurePath = path.join(featureDir, "feature.json");
|
||||
|
||||
try {
|
||||
@@ -900,8 +900,8 @@ Format your response as a structured markdown document.`;
|
||||
featureId: string,
|
||||
status: string
|
||||
): Promise<void> {
|
||||
// Features are stored in external automaker directory
|
||||
const featureDir = await getFeatureDir(projectPath, featureId);
|
||||
// Features are stored in .automaker directory
|
||||
const featureDir = getFeatureDir(projectPath, featureId);
|
||||
const featurePath = path.join(featureDir, "feature.json");
|
||||
|
||||
try {
|
||||
@@ -924,8 +924,8 @@ Format your response as a structured markdown document.`;
|
||||
}
|
||||
|
||||
private async loadPendingFeatures(projectPath: string): Promise<Feature[]> {
|
||||
// Features are stored in external automaker directory
|
||||
const featuresDir = await getFeaturesDir(projectPath);
|
||||
// Features are stored in .automaker directory
|
||||
const featuresDir = getFeaturesDir(projectPath);
|
||||
|
||||
try {
|
||||
const entries = await fs.readdir(featuresDir, { withFileTypes: true });
|
||||
@@ -1114,11 +1114,11 @@ When done, summarize what you implemented and any notes for the developer.`;
|
||||
// Execute via provider
|
||||
const stream = provider.executeQuery(options);
|
||||
let responseText = "";
|
||||
// Agent output goes to external automaker directory
|
||||
// Agent output goes to .automaker directory
|
||||
// Note: We use the original projectPath here (from config), not workDir
|
||||
// because workDir might be a worktree path
|
||||
const configProjectPath = this.config?.projectPath || workDir;
|
||||
const featureDirForOutput = await getFeatureDir(configProjectPath, featureId);
|
||||
const featureDirForOutput = getFeatureDir(configProjectPath, featureId);
|
||||
const outputPath = path.join(featureDirForOutput, "agent-output.md");
|
||||
|
||||
for await (const msg of stream) {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/**
|
||||
* Feature Loader - Handles loading and managing features from individual feature folders
|
||||
* Each feature is stored in external automaker storage: ~/.automaker/projects/{project-id}/features/{featureId}/feature.json
|
||||
*
|
||||
* Features are stored outside the git repo to avoid worktree conflicts.
|
||||
* Each feature is stored in .automaker/features/{featureId}/feature.json
|
||||
*/
|
||||
|
||||
import path from "path";
|
||||
@@ -29,17 +27,14 @@ export class FeatureLoader {
|
||||
/**
|
||||
* Get the features directory path
|
||||
*/
|
||||
async getFeaturesDir(projectPath: string): Promise<string> {
|
||||
getFeaturesDir(projectPath: string): string {
|
||||
return getFeaturesDir(projectPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the images directory path for a feature
|
||||
*/
|
||||
async getFeatureImagesDir(
|
||||
projectPath: string,
|
||||
featureId: string
|
||||
): Promise<string> {
|
||||
getFeatureImagesDir(projectPath: string, featureId: string): string {
|
||||
return getFeatureImagesDir(projectPath, featureId);
|
||||
}
|
||||
|
||||
@@ -95,10 +90,7 @@ export class FeatureLoader {
|
||||
return imagePaths;
|
||||
}
|
||||
|
||||
const featureImagesDir = await this.getFeatureImagesDir(
|
||||
projectPath,
|
||||
featureId
|
||||
);
|
||||
const featureImagesDir = this.getFeatureImagesDir(projectPath, featureId);
|
||||
await fs.mkdir(featureImagesDir, { recursive: true });
|
||||
|
||||
const updatedPaths: Array<string | { path: string; [key: string]: unknown }> =
|
||||
@@ -166,30 +158,22 @@ export class FeatureLoader {
|
||||
/**
|
||||
* Get the path to a specific feature folder
|
||||
*/
|
||||
async getFeatureDir(projectPath: string, featureId: string): Promise<string> {
|
||||
getFeatureDir(projectPath: string, featureId: string): string {
|
||||
return getFeatureDir(projectPath, featureId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to a feature's feature.json file
|
||||
*/
|
||||
async getFeatureJsonPath(
|
||||
projectPath: string,
|
||||
featureId: string
|
||||
): Promise<string> {
|
||||
const featureDir = await this.getFeatureDir(projectPath, featureId);
|
||||
return path.join(featureDir, "feature.json");
|
||||
getFeatureJsonPath(projectPath: string, featureId: string): string {
|
||||
return path.join(this.getFeatureDir(projectPath, featureId), "feature.json");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the path to a feature's agent-output.md file
|
||||
*/
|
||||
async getAgentOutputPath(
|
||||
projectPath: string,
|
||||
featureId: string
|
||||
): Promise<string> {
|
||||
const featureDir = await this.getFeatureDir(projectPath, featureId);
|
||||
return path.join(featureDir, "agent-output.md");
|
||||
getAgentOutputPath(projectPath: string, featureId: string): string {
|
||||
return path.join(this.getFeatureDir(projectPath, featureId), "agent-output.md");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,7 +188,7 @@ export class FeatureLoader {
|
||||
*/
|
||||
async getAll(projectPath: string): Promise<Feature[]> {
|
||||
try {
|
||||
const featuresDir = await this.getFeaturesDir(projectPath);
|
||||
const featuresDir = this.getFeaturesDir(projectPath);
|
||||
|
||||
// Check if features directory exists
|
||||
try {
|
||||
@@ -221,10 +205,7 @@ export class FeatureLoader {
|
||||
const features: Feature[] = [];
|
||||
for (const dir of featureDirs) {
|
||||
const featureId = dir.name;
|
||||
const featureJsonPath = await this.getFeatureJsonPath(
|
||||
projectPath,
|
||||
featureId
|
||||
);
|
||||
const featureJsonPath = this.getFeatureJsonPath(projectPath, featureId);
|
||||
|
||||
try {
|
||||
const content = await fs.readFile(featureJsonPath, "utf-8");
|
||||
@@ -273,10 +254,7 @@ export class FeatureLoader {
|
||||
*/
|
||||
async get(projectPath: string, featureId: string): Promise<Feature | null> {
|
||||
try {
|
||||
const featureJsonPath = await this.getFeatureJsonPath(
|
||||
projectPath,
|
||||
featureId
|
||||
);
|
||||
const featureJsonPath = this.getFeatureJsonPath(projectPath, featureId);
|
||||
const content = await fs.readFile(featureJsonPath, "utf-8");
|
||||
return JSON.parse(content);
|
||||
} catch (error) {
|
||||
@@ -299,8 +277,8 @@ export class FeatureLoader {
|
||||
featureData: Partial<Feature>
|
||||
): Promise<Feature> {
|
||||
const featureId = featureData.id || this.generateFeatureId();
|
||||
const featureDir = await this.getFeatureDir(projectPath, featureId);
|
||||
const featureJsonPath = await this.getFeatureJsonPath(projectPath, featureId);
|
||||
const featureDir = this.getFeatureDir(projectPath, featureId);
|
||||
const featureJsonPath = this.getFeatureJsonPath(projectPath, featureId);
|
||||
|
||||
// Ensure automaker directory exists
|
||||
await ensureAutomakerDir(projectPath);
|
||||
@@ -376,7 +354,7 @@ export class FeatureLoader {
|
||||
};
|
||||
|
||||
// Write back to file
|
||||
const featureJsonPath = await this.getFeatureJsonPath(projectPath, featureId);
|
||||
const featureJsonPath = this.getFeatureJsonPath(projectPath, featureId);
|
||||
await fs.writeFile(
|
||||
featureJsonPath,
|
||||
JSON.stringify(updatedFeature, null, 2),
|
||||
@@ -392,7 +370,7 @@ export class FeatureLoader {
|
||||
*/
|
||||
async delete(projectPath: string, featureId: string): Promise<boolean> {
|
||||
try {
|
||||
const featureDir = await this.getFeatureDir(projectPath, featureId);
|
||||
const featureDir = this.getFeatureDir(projectPath, featureId);
|
||||
await fs.rm(featureDir, { recursive: true, force: true });
|
||||
console.log(`[FeatureLoader] Deleted feature ${featureId}`);
|
||||
return true;
|
||||
@@ -413,10 +391,7 @@ export class FeatureLoader {
|
||||
featureId: string
|
||||
): Promise<string | null> {
|
||||
try {
|
||||
const agentOutputPath = await this.getAgentOutputPath(
|
||||
projectPath,
|
||||
featureId
|
||||
);
|
||||
const agentOutputPath = this.getAgentOutputPath(projectPath, featureId);
|
||||
const content = await fs.readFile(agentOutputPath, "utf-8");
|
||||
return content;
|
||||
} catch (error) {
|
||||
@@ -439,10 +414,10 @@ export class FeatureLoader {
|
||||
featureId: string,
|
||||
content: string
|
||||
): Promise<void> {
|
||||
const featureDir = await this.getFeatureDir(projectPath, featureId);
|
||||
const featureDir = this.getFeatureDir(projectPath, featureId);
|
||||
await fs.mkdir(featureDir, { recursive: true });
|
||||
|
||||
const agentOutputPath = await this.getAgentOutputPath(projectPath, featureId);
|
||||
const agentOutputPath = this.getAgentOutputPath(projectPath, featureId);
|
||||
await fs.writeFile(agentOutputPath, content, "utf-8");
|
||||
}
|
||||
|
||||
@@ -454,10 +429,7 @@ export class FeatureLoader {
|
||||
featureId: string
|
||||
): Promise<void> {
|
||||
try {
|
||||
const agentOutputPath = await this.getAgentOutputPath(
|
||||
projectPath,
|
||||
featureId
|
||||
);
|
||||
const agentOutputPath = this.getAgentOutputPath(projectPath, featureId);
|
||||
await fs.unlink(agentOutputPath);
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
|
||||
|
||||
Reference in New Issue
Block a user