mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-21 23:33:07 +00:00
- Delete the 2705-line auto-mode-service.ts monolith - Create AutoModeServiceCompat as compatibility layer for routes - Create GlobalAutoModeService for cross-project operations - Update all routes to use AutoModeServiceCompat type - Add SharedServices interface for state sharing across facades - Add getActiveProjects/getActiveWorktrees to AutoLoopCoordinator - Delete obsolete monolith test files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
/**
|
|
* Resume Interrupted Features Handler
|
|
*
|
|
* Checks for features that were interrupted (in pipeline steps or in_progress)
|
|
* when the server was restarted and resumes them.
|
|
*/
|
|
|
|
import type { Request, Response } from 'express';
|
|
import { createLogger } from '@automaker/utils';
|
|
import type { AutoModeServiceCompat } from '../../../services/auto-mode/index.js';
|
|
|
|
const logger = createLogger('ResumeInterrupted');
|
|
|
|
interface ResumeInterruptedRequest {
|
|
projectPath: string;
|
|
}
|
|
|
|
export function createResumeInterruptedHandler(autoModeService: AutoModeServiceCompat) {
|
|
return async (req: Request, res: Response): Promise<void> => {
|
|
const { projectPath } = req.body as ResumeInterruptedRequest;
|
|
|
|
if (!projectPath) {
|
|
res.status(400).json({ error: 'Project path is required' });
|
|
return;
|
|
}
|
|
|
|
logger.info(`Checking for interrupted features in ${projectPath}`);
|
|
|
|
try {
|
|
await autoModeService.resumeInterruptedFeatures(projectPath);
|
|
|
|
res.json({
|
|
success: true,
|
|
message: 'Resume check completed',
|
|
});
|
|
} catch (error) {
|
|
logger.error('Error resuming interrupted features:', error);
|
|
res.status(500).json({
|
|
error: error instanceof Error ? error.message : 'Unknown error',
|
|
});
|
|
}
|
|
};
|
|
}
|