mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
- Introduced a new endpoint `/resume-interrupted` to handle resuming features that were interrupted during server restarts. - Implemented the `createResumeInterruptedHandler` to check for and resume interrupted features based on the project path. - Enhanced the `AutoModeService` to track and manage the execution state of features, ensuring they can be resumed correctly. - Updated relevant types and prompts to include the new 'ux-reviewer' enhancement mode for better user experience handling. - Added new templates for UX review and other enhancement modes to improve task descriptions from a user experience perspective.
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
/**
|
|
* POST /update endpoint - Update a feature
|
|
*/
|
|
|
|
import type { Request, Response } from 'express';
|
|
import { FeatureLoader } from '../../../services/feature-loader.js';
|
|
import type { Feature } from '@automaker/types';
|
|
import { getErrorMessage, logError } from '../common.js';
|
|
|
|
export function createUpdateHandler(featureLoader: FeatureLoader) {
|
|
return async (req: Request, res: Response): Promise<void> => {
|
|
try {
|
|
const { projectPath, featureId, updates, descriptionHistorySource, enhancementMode } =
|
|
req.body as {
|
|
projectPath: string;
|
|
featureId: string;
|
|
updates: Partial<Feature>;
|
|
descriptionHistorySource?: 'enhance' | 'edit';
|
|
enhancementMode?: 'improve' | 'technical' | 'simplify' | 'acceptance' | 'ux-reviewer';
|
|
};
|
|
|
|
if (!projectPath || !featureId || !updates) {
|
|
res.status(400).json({
|
|
success: false,
|
|
error: 'projectPath, featureId, and updates are required',
|
|
});
|
|
return;
|
|
}
|
|
|
|
const updated = await featureLoader.update(
|
|
projectPath,
|
|
featureId,
|
|
updates,
|
|
descriptionHistorySource,
|
|
enhancementMode
|
|
);
|
|
res.json({ success: true, feature: updated });
|
|
} catch (error) {
|
|
logError(error, 'Update feature failed');
|
|
res.status(500).json({ success: false, error: getErrorMessage(error) });
|
|
}
|
|
};
|
|
}
|